Re: [PATCH V2] staging: ccree: - style fix, spaces and tabs
On Sat, Jun 17, 2017 at 5:44 AM, Derek Robsonwrote: > Changed code indent to be tabs across whole driver > Found using checkpatch > > Signed-off-by: Derek Robson > > V1 had vague subject. Acked-by: Gilad Ben-Yossef Thanks you, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru
Re: [PATCH V2] staging: ccree: - style fix, spaces and tabs
On Sat, Jun 17, 2017 at 5:44 AM, Derek Robson wrote: > Changed code indent to be tabs across whole driver > Found using checkpatch > > Signed-off-by: Derek Robson > > V1 had vague subject. Acked-by: Gilad Ben-Yossef Thanks you, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru
[PATCH V2] staging: ccree: - style fix, spaces and tabs
Changed code indent to be tabs across whole driver Found using checkpatch Signed-off-by: Derek RobsonV1 had vague subject. --- drivers/staging/ccree/ssi_cipher.c | 45 +- drivers/staging/ccree/ssi_driver.c | 6 ++--- drivers/staging/ccree/ssi_driver.h | 6 ++--- drivers/staging/ccree/ssi_fips.h | 8 +++--- drivers/staging/ccree/ssi_fips_ext.c | 4 +-- drivers/staging/ccree/ssi_fips_ll.c| 40 +++--- drivers/staging/ccree/ssi_fips_local.c | 28 ++--- drivers/staging/ccree/ssi_fips_local.h | 12 - 8 files changed, 75 insertions(+), 74 deletions(-) diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 2dfc6a3bd4c1..34450a5e6573 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -258,45 +258,45 @@ static void ssi_blkcipher_exit(struct crypto_tfm *tfm) typedef struct tdes_keys{ -u8 key1[DES_KEY_SIZE]; -u8 key2[DES_KEY_SIZE]; -u8 key3[DES_KEY_SIZE]; + u8 key1[DES_KEY_SIZE]; + u8 key2[DES_KEY_SIZE]; + u8 key3[DES_KEY_SIZE]; }tdes_keys_t; -static const u8 zero_buff[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +static const u8 zero_buff[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; /* The function verifies that tdes keys are not weak.*/ static int ssi_fips_verify_3des_keys(const u8 *key, unsigned int keylen) { #ifdef CCREE_FIPS_SUPPORT -tdes_keys_t *tdes_key = (tdes_keys_t*)key; + tdes_keys_t *tdes_key = (tdes_keys_t*)key; /* verify key1 != key2 and key3 != key2*/ -if (unlikely( (memcmp((u8*)tdes_key->key1, (u8*)tdes_key->key2, sizeof(tdes_key->key1)) == 0) || + if (unlikely( (memcmp((u8*)tdes_key->key1, (u8*)tdes_key->key2, sizeof(tdes_key->key1)) == 0) || (memcmp((u8*)tdes_key->key3, (u8*)tdes_key->key2, sizeof(tdes_key->key3)) == 0) )) { -return -ENOEXEC; -} + return -ENOEXEC; + } #endif /* CCREE_FIPS_SUPPORT */ -return 0; + return 0; } /* The function verifies that xts keys are not weak.*/ static int ssi_fips_verify_xts_keys(const u8 *key, unsigned int keylen) { #ifdef CCREE_FIPS_SUPPORT -/* Weak key is define as key that its first half (128/256 lsb) equals its second half (128/256 msb) */ -int singleKeySize = keylen >> 1; + /* Weak key is define as key that its first half (128/256 lsb) equals its second half (128/256 msb) */ + int singleKeySize = keylen >> 1; if (unlikely(memcmp(key, [singleKeySize], singleKeySize) == 0)) { return -ENOEXEC; } #endif /* CCREE_FIPS_SUPPORT */ -return 0; + return 0; } static enum cc_hw_crypto_key hw_key_to_cc_hw_key(int slot_num) @@ -720,12 +720,13 @@ ssi_blkcipher_create_data_desc( } static int ssi_blkcipher_complete(struct device *dev, - struct ssi_ablkcipher_ctx *ctx_p, - struct blkcipher_req_ctx *req_ctx, - struct scatterlist *dst, struct scatterlist *src, - unsigned int ivsize, - void *areq, - void __iomem *cc_base) + struct ssi_ablkcipher_ctx *ctx_p, + struct blkcipher_req_ctx *req_ctx, + struct scatterlist *dst, + struct scatterlist *src, + unsigned int ivsize, + void *areq, + void __iomem *cc_base) { int completion_error = 0; u32 inflight_counter; @@ -779,7 +780,7 @@ static int ssi_blkcipher_process( /* No data to process is valid */ return 0; } -/*For CTS in case of data size aligned to 16 use CBC mode*/ + /*For CTS in case of data size aligned to 16 use CBC mode*/ if (((nbytes % AES_BLOCK_SIZE) == 0) && (ctx_p->cipher_mode == DRV_CIPHER_CBC_CTS)){ ctx_p->cipher_mode = DRV_CIPHER_CBC; diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c index 190922970bf0..b9d0dd27e853 100644 --- a/drivers/staging/ccree/ssi_driver.c +++ b/drivers/staging/ccree/ssi_driver.c @@ -437,9 +437,9 @@ static void
[PATCH V2] staging: ccree: - style fix, spaces and tabs
Changed code indent to be tabs across whole driver Found using checkpatch Signed-off-by: Derek Robson V1 had vague subject. --- drivers/staging/ccree/ssi_cipher.c | 45 +- drivers/staging/ccree/ssi_driver.c | 6 ++--- drivers/staging/ccree/ssi_driver.h | 6 ++--- drivers/staging/ccree/ssi_fips.h | 8 +++--- drivers/staging/ccree/ssi_fips_ext.c | 4 +-- drivers/staging/ccree/ssi_fips_ll.c| 40 +++--- drivers/staging/ccree/ssi_fips_local.c | 28 ++--- drivers/staging/ccree/ssi_fips_local.h | 12 - 8 files changed, 75 insertions(+), 74 deletions(-) diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 2dfc6a3bd4c1..34450a5e6573 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -258,45 +258,45 @@ static void ssi_blkcipher_exit(struct crypto_tfm *tfm) typedef struct tdes_keys{ -u8 key1[DES_KEY_SIZE]; -u8 key2[DES_KEY_SIZE]; -u8 key3[DES_KEY_SIZE]; + u8 key1[DES_KEY_SIZE]; + u8 key2[DES_KEY_SIZE]; + u8 key3[DES_KEY_SIZE]; }tdes_keys_t; -static const u8 zero_buff[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; +static const u8 zero_buff[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; /* The function verifies that tdes keys are not weak.*/ static int ssi_fips_verify_3des_keys(const u8 *key, unsigned int keylen) { #ifdef CCREE_FIPS_SUPPORT -tdes_keys_t *tdes_key = (tdes_keys_t*)key; + tdes_keys_t *tdes_key = (tdes_keys_t*)key; /* verify key1 != key2 and key3 != key2*/ -if (unlikely( (memcmp((u8*)tdes_key->key1, (u8*)tdes_key->key2, sizeof(tdes_key->key1)) == 0) || + if (unlikely( (memcmp((u8*)tdes_key->key1, (u8*)tdes_key->key2, sizeof(tdes_key->key1)) == 0) || (memcmp((u8*)tdes_key->key3, (u8*)tdes_key->key2, sizeof(tdes_key->key3)) == 0) )) { -return -ENOEXEC; -} + return -ENOEXEC; + } #endif /* CCREE_FIPS_SUPPORT */ -return 0; + return 0; } /* The function verifies that xts keys are not weak.*/ static int ssi_fips_verify_xts_keys(const u8 *key, unsigned int keylen) { #ifdef CCREE_FIPS_SUPPORT -/* Weak key is define as key that its first half (128/256 lsb) equals its second half (128/256 msb) */ -int singleKeySize = keylen >> 1; + /* Weak key is define as key that its first half (128/256 lsb) equals its second half (128/256 msb) */ + int singleKeySize = keylen >> 1; if (unlikely(memcmp(key, [singleKeySize], singleKeySize) == 0)) { return -ENOEXEC; } #endif /* CCREE_FIPS_SUPPORT */ -return 0; + return 0; } static enum cc_hw_crypto_key hw_key_to_cc_hw_key(int slot_num) @@ -720,12 +720,13 @@ ssi_blkcipher_create_data_desc( } static int ssi_blkcipher_complete(struct device *dev, - struct ssi_ablkcipher_ctx *ctx_p, - struct blkcipher_req_ctx *req_ctx, - struct scatterlist *dst, struct scatterlist *src, - unsigned int ivsize, - void *areq, - void __iomem *cc_base) + struct ssi_ablkcipher_ctx *ctx_p, + struct blkcipher_req_ctx *req_ctx, + struct scatterlist *dst, + struct scatterlist *src, + unsigned int ivsize, + void *areq, + void __iomem *cc_base) { int completion_error = 0; u32 inflight_counter; @@ -779,7 +780,7 @@ static int ssi_blkcipher_process( /* No data to process is valid */ return 0; } -/*For CTS in case of data size aligned to 16 use CBC mode*/ + /*For CTS in case of data size aligned to 16 use CBC mode*/ if (((nbytes % AES_BLOCK_SIZE) == 0) && (ctx_p->cipher_mode == DRV_CIPHER_CBC_CTS)){ ctx_p->cipher_mode = DRV_CIPHER_CBC; diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c index 190922970bf0..b9d0dd27e853 100644 --- a/drivers/staging/ccree/ssi_driver.c +++ b/drivers/staging/ccree/ssi_driver.c @@ -437,9 +437,9 @@ static void cleanup_cc_resources(struct