]> git.baikalelectronics.ru Git - kernel.git/commitdiff
s390/crypto: fix function/prototype mismatches
authorSven Schnelle <svens@linux.ibm.com>
Tue, 4 May 2021 15:07:02 +0000 (17:07 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 7 Jun 2021 15:06:58 +0000 (17:06 +0200)
gcc-11 warns:

drivers/s390/crypto/zcrypt_ccamisc.c:298:38: warning: argument 4 of type u8[64] {aka unsigned char[64]} with mismatched bound [-Warray-parameter=]
  298 |                   u32 keybitsize, u8 seckey[SECKEYBLOBSIZE])
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/s390/crypto/zcrypt_ccamisc.c:24:
drivers/s390/crypto/zcrypt_ccamisc.h:162:63: note: previously declared as u8 * {aka unsigned char *}
  162 | int cca_genseckey(u16 cardnr, u16 domain, u32 keybitsize, u8 *seckey);
      |                                                           ~~~~^~~~~~
drivers/s390/crypto/zcrypt_ccamisc.c:441:41: warning: argument 5 of type u8[64] {aka unsigned char[64]} with mismatched bound [-Warray-parameter=]
  441 |                    const u8 *clrkey, u8 seckey[SECKEYBLOBSIZE])
      |                                      ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/s390/crypto/zcrypt_ccamisc.c:24:
drivers/s390/crypto/zcrypt_ccamisc.h:168:42: note: previously declared as u8 * {aka unsigned char *}
  168 |                    const u8 *clrkey, u8 *seckey);
      |                                      ~~~~^~~~~~

Fix this by making the prototypes match the functions.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Cc: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/zcrypt_ccamisc.c
drivers/s390/crypto/zcrypt_ccamisc.h

index d68c0ed5e0dd856cbd4aa51cdebb74b94a87adb4..6a82033696e5092c921e1db033547be4146ddc0a 100644 (file)
@@ -295,7 +295,7 @@ static inline void prep_xcrb(struct ica_xcRB *pxcrb,
  * Generate (random) CCA AES DATA secure key.
  */
 int cca_genseckey(u16 cardnr, u16 domain,
-                 u32 keybitsize, u8 seckey[SECKEYBLOBSIZE])
+                 u32 keybitsize, u8 *seckey)
 {
        int i, rc, keysize;
        int seckeysize;
@@ -438,7 +438,7 @@ EXPORT_SYMBOL(cca_genseckey);
  * Generate an CCA AES DATA secure key with given key value.
  */
 int cca_clr2seckey(u16 cardnr, u16 domain, u32 keybitsize,
-                  const u8 *clrkey, u8 seckey[SECKEYBLOBSIZE])
+                  const u8 *clrkey, u8 *seckey)
 {
        int rc, keysize, seckeysize;
        u8 *mem, *ptr;
@@ -577,8 +577,8 @@ EXPORT_SYMBOL(cca_clr2seckey);
  * Derive proteced key from an CCA AES DATA secure key.
  */
 int cca_sec2protkey(u16 cardnr, u16 domain,
-                   const u8 seckey[SECKEYBLOBSIZE],
-                   u8 *protkey, u32 *protkeylen, u32 *protkeytype)
+                   const u8 *seckey, u8 *protkey, u32 *protkeylen,
+                   u32 *protkeytype)
 {
        int rc;
        u8 *mem, *ptr;
index e7105443d5cb36814a42edfc7b80a05c30651ca1..3513cd8ab9bc1a39a6c38bda7c04c82a5b494a50 100644 (file)
@@ -171,8 +171,8 @@ int cca_clr2seckey(u16 cardnr, u16 domain, u32 keybitsize,
  * Derive proteced key from an CCA AES DATA secure key.
  */
 int cca_sec2protkey(u16 cardnr, u16 domain,
-                   const u8 seckey[SECKEYBLOBSIZE],
-                   u8 *protkey, u32 *protkeylen, u32 *protkeytype);
+                   const u8 *seckey, u8 *protkey, u32 *protkeylen,
+                   u32 *protkeytype);
 
 /*
  * Generate (random) CCA AES CIPHER secure key.