s390/zcrypt: code beautify

Code beautify by following most of the checkpatch suggestions:
 - SPDX license identifier line complains by checkpatch
 - missing space or newline complains by checkpatch
 - octal numbers for permssions complains by checkpatch
 - renaming of static sysfs functions complains by checkpatch
 - fix of block comment complains by checkpatch
 - fix printf like calls where function name instead of %s __func__
   was used
 - __packed instead of __attribute__((packed))
 - init to zero for static variables removed
 - use of DEVICE_ATTR_RO and DEVICE_ATTR_RW macros

No functional code changes or API changes!

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Harald Freudenberger
2018-08-17 12:36:01 +02:00
committed by Martin Schwidefsky
parent 9b97e9f555
commit ac2b96f351
19 changed files with 270 additions and 241 deletions

View File

@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0+
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* zcrypt 2.1.0
*
@@ -31,7 +31,7 @@ struct cca_token_hdr {
unsigned char version;
unsigned short token_length;
unsigned char reserved[4];
} __attribute__((packed));
} __packed;
#define CCA_TKN_HDR_ID_EXT 0x1E
@@ -51,7 +51,7 @@ struct cca_public_sec {
unsigned short exponent_len;
unsigned short modulus_bit_len;
unsigned short modulus_byte_len; /* In a private key, this is 0 */
} __attribute__((packed));
} __packed;
/**
* mapping for the cca private CRT key 'token'
@@ -85,7 +85,7 @@ struct cca_pvt_ext_CRT_sec {
unsigned short pad_len;
unsigned char reserved4[52];
unsigned char confounder[8];
} __attribute__((packed));
} __packed;
#define CCA_PVT_EXT_CRT_SEC_ID_PVT 0x08
#define CCA_PVT_EXT_CRT_SEC_FMT_CL 0x40
@@ -114,7 +114,7 @@ static inline int zcrypt_type6_mex_key_en(struct ica_rsa_modexpo *mex, void *p)
struct cca_token_hdr pubHdr;
struct cca_public_sec pubSec;
char exponent[0];
} __attribute__((packed)) *key = p;
} __packed *key = p;
unsigned char *temp;
int i;
@@ -183,7 +183,7 @@ static inline int zcrypt_type6_crt_key(struct ica_rsa_modexpo_crt *crt, void *p)
struct cca_token_hdr token;
struct cca_pvt_ext_CRT_sec pvt;
char key_parts[0];
} __attribute__((packed)) *key = p;
} __packed *key = p;
struct cca_public_sec *pub;
int short_len, long_len, pad_len, key_len, size;