drivers: staging: ccree: ISO C forbids casting to and from non-scalar
authorRaphaël Beamonte <raphael.beamonte@gmail.com>
Tue, 23 May 2017 18:53:14 +0000 (20:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 16:37:52 +0000 (18:37 +0200)
Fixes the following sparse warnings:
drivers/staging/ccree/ssi_hash.c:2447:24: warning: cast to non-scalar
drivers/staging/ccree/ssi_hash.c:2447:24: warning: cast from non-scalar
drivers/staging/ccree/ssi_hash.c:2448:28: warning: cast to non-scalar
drivers/staging/ccree/ssi_hash.c:2448:28: warning: cast from non-scalar

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ccree/ssi_hash.c

index 162d17dee2cdc63d1061242a12a5329887fff707..8585f73161b3a4e1b3bdf35aa0416c8fcebc71a9 100644 (file)
@@ -2444,8 +2444,8 @@ int ssi_hash_alloc(struct ssi_drvdata *drvdata)
 
                /* register hmac version */
 
-               if ((((struct ssi_hash_template)driver_hash[alg]).hw_mode != DRV_CIPHER_XCBC_MAC) &&
-                       (((struct ssi_hash_template)driver_hash[alg]).hw_mode != DRV_CIPHER_CMAC)) {
+               if ((((struct ssi_hash_template *)&driver_hash[alg])->hw_mode != DRV_CIPHER_XCBC_MAC) &&
+                   (((struct ssi_hash_template *)&driver_hash[alg])->hw_mode != DRV_CIPHER_CMAC)) {
                        t_alg = ssi_hash_create_alg(&driver_hash[alg], true);
                        if (IS_ERR(t_alg)) {
                                rc = PTR_ERR(t_alg);