Skip to contentSkip to conversation

Fix coding style of driver/staging/ccree/ssi_aead.c ERROR: space required after that

PATCH In review Jhih-Ming Huang 3 participants 15 messages Jun 20, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/11 Fix coding style of driver/staging/ccree/ssi_aead.c ERROR: space required after that

From: Jhih-Ming Hunag <[email protected]>

In this series patches, I fix all of the coding style error in driver/staging/ccree/ssi_aead.c from 54 errors to 0 error.

The first patch fixed 'ERROR: space required after that'.

---
 drivers/staging/ccree/ssi_aead.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/staging/ccree/ssi_aead.c +11 -11
index e8936a3..5bc3a53 100644
@@ -155,7 +155,7 @@ static int ssi_aead_init(struct crypto_aead *tfm)
 	ctx->auth_mode = ssi_alg->auth_mode;
 	ctx->drvdata = ssi_alg->drvdata;
 	dev = &ctx->drvdata->plat_dev->dev;
-	crypto_aead_set_reqsize(tfm,sizeof(struct aead_req_ctx));
+	crypto_aead_set_reqsize(tfm, sizeof(struct aead_req_ctx));
 
 	/* Allocate key buffer, cache line aligned */
 	ctx->enckey = dma_alloc_coherent(dev, AES_MAX_KEY_SIZE,
@@ -1566,7 +1566,7 @@ static int config_ccm_adata(struct aead_request *req) {
 	/* taken from crypto/ccm.c */
 	/* 2 <= L <= 8, so 1 <= L' <= 7. */
 	if (2 > l || l > 8) {
-		SSI_LOG_ERR("illegal iv value %X\n",req->iv[0]);
+		SSI_LOG_ERR("illegal iv value %X\n", req->iv[0]);
 		return -EINVAL;
 	}
 	memcpy(b0, req->iv, AES_BLOCK_SIZE);
@@ -1862,27 +1862,27 @@ static inline void ssi_aead_dump_gcm(
 				 ctx->cipher_mode, ctx->authsize, ctx->enc_keylen, req->assoclen, req_ctx->cryptlen );
 
 	if ( ctx->enckey != NULL ) {
-		dump_byte_array("mac key",ctx->enckey, 16);
+		dump_byte_array("mac key", ctx->enckey, 16);
 	}
 
-	dump_byte_array("req->iv",req->iv, AES_BLOCK_SIZE);
+	dump_byte_array("req->iv", req->iv, AES_BLOCK_SIZE);
 
-	dump_byte_array("gcm_iv_inc1",req_ctx->gcm_iv_inc1, AES_BLOCK_SIZE);
+	dump_byte_array("gcm_iv_inc1", req_ctx->gcm_iv_inc1, AES_BLOCK_SIZE);
 
-	dump_byte_array("gcm_iv_inc2",req_ctx->gcm_iv_inc2, AES_BLOCK_SIZE);
+	dump_byte_array("gcm_iv_inc2", req_ctx->gcm_iv_inc2, AES_BLOCK_SIZE);
 
-	dump_byte_array("hkey",req_ctx->hkey, AES_BLOCK_SIZE);
+	dump_byte_array("hkey", req_ctx->hkey, AES_BLOCK_SIZE);
 
-	dump_byte_array("mac_buf",req_ctx->mac_buf, AES_BLOCK_SIZE);
+	dump_byte_array("mac_buf", req_ctx->mac_buf, AES_BLOCK_SIZE);
 
-	dump_byte_array("gcm_len_block",req_ctx->gcm_len_block.lenA, AES_BLOCK_SIZE);
+	dump_byte_array("gcm_len_block", req_ctx->gcm_len_block.lenA, AES_BLOCK_SIZE);
 
 	if (req->src!=NULL && req->cryptlen) {
-		dump_byte_array("req->src",sg_virt(req->src), req->cryptlen+req->assoclen);
+		dump_byte_array("req->src", sg_virt(req->src), req->cryptlen+req->assoclen);
 	}
 
 	if (req->dst!=NULL) {
-		dump_byte_array("req->dst",sg_virt(req->dst), req->cryptlen+ctx->authsize+req->assoclen);
+		dump_byte_array("req->dst", sg_virt(req->dst), req->cryptlen+ctx->authsize+req->assoclen);
     }
 }
 #endif
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/11 Fix ERROR: spaces required around that

From: Jhih-Ming Hunag <[email protected]>

Fixed 'ERROR: spaces required around that'

---
 drivers/staging/ccree/ssi_aead.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/ccree/ssi_aead.c +6 -6
index 5bc3a53..0f95a54 100644
@@ -663,7 +663,7 @@ static int ssi_aead_setauthsize(
 	CHECK_AND_RETURN_UPON_FIPS_ERROR();
 	/* Unsupported auth. sizes */
 	if ((authsize == 0) ||
-	    (authsize >crypto_aead_maxauthsize(authenc))) {
+	    (authsize > crypto_aead_maxauthsize(authenc))) {
 		return -ENOTSUPP;
 	}
 
@@ -1715,7 +1715,7 @@ static inline void ssi_aead_gcm_setup_gctr_desc(
 	set_flow_mode(&desc[idx], S_DIN_to_AES);
 	idx++;
 
-	if ((req_ctx->cryptlen != 0) && (req_ctx->plaintext_authenticate_only==false)){
+	if ((req_ctx->cryptlen != 0) && (req_ctx->plaintext_authenticate_only == false)){
 		/* load AES/CTR initial CTR value inc by 2*/
 		hw_desc_init(&desc[idx]);
 		set_cipher_mode(&desc[idx], DRV_CIPHER_GCTR);
@@ -1815,7 +1815,7 @@ static inline int ssi_aead_gcm(
 
 
 	//in RFC4543 no data to encrypt. just copy data from src to dest.
-	if (req_ctx->plaintext_authenticate_only==true){
+	if (req_ctx->plaintext_authenticate_only == true){
 		ssi_aead_process_cipher_data_desc(req, BYPASS, desc, seq_size);
 		ssi_aead_gcm_setup_ghash_desc(req, desc, seq_size);
 		/* process(ghash) assoc data */
@@ -1877,11 +1877,11 @@ static inline void ssi_aead_dump_gcm(
 
 	dump_byte_array("gcm_len_block", req_ctx->gcm_len_block.lenA, AES_BLOCK_SIZE);
 
-	if (req->src!=NULL && req->cryptlen) {
+	if (req->src != NULL && req->cryptlen) {
 		dump_byte_array("req->src", sg_virt(req->src), req->cryptlen+req->assoclen);
 	}
 
-	if (req->dst!=NULL) {
+	if (req->dst != NULL) {
 		dump_byte_array("req->dst", sg_virt(req->dst), req->cryptlen+ctx->authsize+req->assoclen);
     }
 }
@@ -1959,7 +1959,7 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction
 
 
 	SSI_LOG_DEBUG("%s context=%p req=%p iv=%p src=%p src_ofs=%d dst=%p dst_ofs=%d cryptolen=%d\n",
-		((direct==DRV_CRYPTO_DIRECTION_ENCRYPT)?"Encrypt":"Decrypt"), ctx, req, req->iv,
+		((direct == DRV_CRYPTO_DIRECTION_ENCRYPT) ? "Encrypt" : "Decrypt"), ctx, req, req->iv,
 		sg_virt(req->src), req->src->offset, sg_virt(req->dst), req->dst->offset, req->cryptlen);
 	CHECK_AND_RETURN_UPON_FIPS_ERROR();
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/11 Fix ERROR: space required before the open brace

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed 'ERROR: space required before the open brace'.

---
 drivers/staging/ccree/ssi_aead.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/ccree/ssi_aead.c +3 -3
index 0f95a54..ca3f11f 100644
@@ -791,7 +791,7 @@ ssi_aead_process_authenc_data_desc(
 		u32 mlli_nents = areq_ctx->assoc.mlli_nents;
 
 		if (likely(areq_ctx->is_single_pass == true)) {
-			if (direct == DRV_CRYPTO_DIRECTION_ENCRYPT){
+			if (direct == DRV_CRYPTO_DIRECTION_ENCRYPT) {
 				mlli_addr = areq_ctx->dst.sram_addr;
 				mlli_nents = areq_ctx->dst.mlli_nents;
 			} else {
@@ -1715,7 +1715,7 @@ static inline void ssi_aead_gcm_setup_gctr_desc(
 	set_flow_mode(&desc[idx], S_DIN_to_AES);
 	idx++;
 
-	if ((req_ctx->cryptlen != 0) && (req_ctx->plaintext_authenticate_only == false)){
+	if ((req_ctx->cryptlen != 0) && (req_ctx->plaintext_authenticate_only == false)) {
 		/* load AES/CTR initial CTR value inc by 2*/
 		hw_desc_init(&desc[idx]);
 		set_cipher_mode(&desc[idx], DRV_CIPHER_GCTR);
@@ -1815,7 +1815,7 @@ static inline int ssi_aead_gcm(
 
 
 	//in RFC4543 no data to encrypt. just copy data from src to dest.
-	if (req_ctx->plaintext_authenticate_only == true){
+	if (req_ctx->plaintext_authenticate_only == true) {
 		ssi_aead_process_cipher_data_desc(req, BYPASS, desc, seq_size);
 		ssi_aead_gcm_setup_ghash_desc(req, desc, seq_size);
 		/* process(ghash) assoc data */
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/11 Fix ERROR: that open brace { should be on the previous line

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed 'ERROR: that open brace { should be on the previous line'.

---
 drivers/staging/ccree/ssi_aead.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/ccree/ssi_aead.c +2 -4
index ca3f11f..6bcab5a 100644
@@ -1340,8 +1340,7 @@ static int validate_data_size(struct ssi_aead_ctx *ctx,
 			goto data_size_err;
 		if (ctx->cipher_mode == DRV_CIPHER_CCM)
 			break;
-		if (ctx->cipher_mode == DRV_CIPHER_GCTR)
-		{
+		if (ctx->cipher_mode == DRV_CIPHER_GCTR) {
 			if (areq_ctx->plaintext_authenticate_only == true)
 				areq_ctx->is_single_pass = false;
 			break;
@@ -1912,8 +1911,7 @@ static int config_gcm_context(struct aead_request *req) {
 	memcpy(req_ctx->gcm_iv_inc1, req->iv, 16);
 
 
-	if (req_ctx->plaintext_authenticate_only == false)
-	{
+	if (req_ctx->plaintext_authenticate_only == false) {
 		__be64 temp64;
 		temp64 = cpu_to_be64(req->assoclen * 8);
 		memcpy ( &req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64) );
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/11 Fix ERROR: space prohibited after that open parenthesis '('

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed "ERROR: space prohibited after that open parenthesis '('".

---
 drivers/staging/ccree/ssi_aead.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/ccree/ssi_aead.c +8 -8
index 6bcab5a..5166874 100644
@@ -1375,10 +1375,10 @@ static int validate_data_size(struct ssi_aead_ctx *ctx,
 static unsigned int format_ccm_a0(u8 *pA0Buff, u32 headerSize)
 {
 	unsigned int len = 0;
-	if ( headerSize == 0 ) {
+	if (headerSize == 0 ) {
 		return 0;
 	}
-	if ( headerSize < ((1UL << 16) - (1UL << 8) )) {
+	if (headerSize < ((1UL << 16) - (1UL << 8) )) {
 		len = 2;
 
 		pA0Buff[0] = (headerSize >> 8) & 0xFF;
@@ -1860,7 +1860,7 @@ static inline void ssi_aead_dump_gcm(
 	SSI_LOG_DEBUG("cipher_mode %d, authsize %d, enc_keylen %d, assoclen %d, cryptlen %d \n", \
 				 ctx->cipher_mode, ctx->authsize, ctx->enc_keylen, req->assoclen, req_ctx->cryptlen );
 
-	if ( ctx->enckey != NULL ) {
+	if (ctx->enckey != NULL ) {
 		dump_byte_array("mac key", ctx->enckey, 16);
 	}
 
@@ -1914,16 +1914,16 @@ static int config_gcm_context(struct aead_request *req) {
 	if (req_ctx->plaintext_authenticate_only == false) {
 		__be64 temp64;
 		temp64 = cpu_to_be64(req->assoclen * 8);
-		memcpy ( &req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64) );
+		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64) );
 		temp64 = cpu_to_be64(cryptlen * 8);
-		memcpy ( &req_ctx->gcm_len_block.lenC , &temp64, 8 );
+		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8 );
 	}
 	else { //rfc4543=>  all data(AAD,IV,Plain) are considered additional data that is nothing is encrypted.
 		__be64 temp64;
 		temp64 = cpu_to_be64((req->assoclen+GCM_BLOCK_RFC4_IV_SIZE+cryptlen) * 8);
-		memcpy ( &req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64) );
+		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64) );
 		temp64 = 0;
-		memcpy ( &req_ctx->gcm_len_block.lenC , &temp64, 8 );
+		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8 );
 	}
 
 	return 0;
@@ -2080,7 +2080,7 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction
 	case DRV_HASH_XCBC_MAC:
 		ssi_aead_xcbc_authenc(req, desc, &seq_len);
 		break;
-#if ( SSI_CC_HAS_AES_CCM || SSI_CC_HAS_AES_GCM )
+#if (SSI_CC_HAS_AES_CCM || SSI_CC_HAS_AES_GCM )
 	case DRV_HASH_NULL:
 #if SSI_CC_HAS_AES_CCM
 		if (ctx->cipher_mode == DRV_CIPHER_CCM) {
Signature · 1 line
2.7.4
#7 lore raw

PATCH 6/11 Fix ERROR: space prohibited before that close parenthesis ')'

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed "ERROR: space prohibited before that close parenthesis ')'".

---
 drivers/staging/ccree/ssi_aead.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/ccree/ssi_aead.c +15 -15
index 5166874..32edebe 100644
@@ -1375,10 +1375,10 @@ static int validate_data_size(struct ssi_aead_ctx *ctx,
 static unsigned int format_ccm_a0(u8 *pA0Buff, u32 headerSize)
 {
 	unsigned int len = 0;
-	if (headerSize == 0 ) {
+	if (headerSize == 0) {
 		return 0;
 	}
-	if (headerSize < ((1UL << 16) - (1UL << 8) )) {
+	if (headerSize < ((1UL << 16) - (1UL << 8))) {
 		len = 2;
 
 		pA0Buff[0] = (headerSize >> 8) & 0xFF;
@@ -1858,9 +1858,9 @@ static inline void ssi_aead_dump_gcm(
 	}
 
 	SSI_LOG_DEBUG("cipher_mode %d, authsize %d, enc_keylen %d, assoclen %d, cryptlen %d \n", \
-				 ctx->cipher_mode, ctx->authsize, ctx->enc_keylen, req->assoclen, req_ctx->cryptlen );
+				 ctx->cipher_mode, ctx->authsize, ctx->enc_keylen, req->assoclen, req_ctx->cryptlen);
 
-	if (ctx->enckey != NULL ) {
+	if (ctx->enckey != NULL) {
 		dump_byte_array("mac key", ctx->enckey, 16);
 	}
 
@@ -1914,16 +1914,16 @@ static int config_gcm_context(struct aead_request *req) {
 	if (req_ctx->plaintext_authenticate_only == false) {
 		__be64 temp64;
 		temp64 = cpu_to_be64(req->assoclen * 8);
-		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64) );
+		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64));
 		temp64 = cpu_to_be64(cryptlen * 8);
-		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8 );
+		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8);
 	}
 	else { //rfc4543=>  all data(AAD,IV,Plain) are considered additional data that is nothing is encrypted.
 		__be64 temp64;
 		temp64 = cpu_to_be64((req->assoclen+GCM_BLOCK_RFC4_IV_SIZE+cryptlen) * 8);
-		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64) );
+		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64));
 		temp64 = 0;
-		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8 );
+		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8);
 	}
 
 	return 0;
@@ -1999,7 +1999,7 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction
 		req->iv = areq_ctx->ctr_iv;
 		areq_ctx->hw_iv_size = CTR_RFC3686_BLOCK_SIZE;
 	} else if ((ctx->cipher_mode == DRV_CIPHER_CCM) ||
-		   (ctx->cipher_mode == DRV_CIPHER_GCTR) ) {
+		   (ctx->cipher_mode == DRV_CIPHER_GCTR)) {
 		areq_ctx->hw_iv_size = AES_BLOCK_SIZE;
 		if (areq_ctx->ctr_iv != req->iv) {
 			memcpy(areq_ctx->ctr_iv, req->iv, crypto_aead_ivsize(tfm));
@@ -2080,7 +2080,7 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction
 	case DRV_HASH_XCBC_MAC:
 		ssi_aead_xcbc_authenc(req, desc, &seq_len);
 		break;
-#if (SSI_CC_HAS_AES_CCM || SSI_CC_HAS_AES_GCM )
+#if (SSI_CC_HAS_AES_CCM || SSI_CC_HAS_AES_GCM)
 	case DRV_HASH_NULL:
 #if SSI_CC_HAS_AES_CCM
 		if (ctx->cipher_mode == DRV_CIPHER_CCM) {
@@ -2144,7 +2144,7 @@ static int ssi_rfc4309_ccm_encrypt(struct aead_request *req)
 	int rc = -EINVAL;
 
 	if (!valid_assoclen(req)) {
-		SSI_LOG_ERR("invalid Assoclen:%u\n", req->assoclen );
+		SSI_LOG_ERR("invalid Assoclen:%u\n", req->assoclen);
 		goto out;
 	}
 
@@ -2219,7 +2219,7 @@ static int ssi_rfc4106_gcm_setkey(struct crypto_aead *tfm, const u8 *key, unsign
 	struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
 	int rc = 0;
 
-	SSI_LOG_DEBUG("ssi_rfc4106_gcm_setkey()  keylen %d, key %p \n", keylen, key );
+	SSI_LOG_DEBUG("ssi_rfc4106_gcm_setkey()  keylen %d, key %p \n", keylen, key);
 
 	if (keylen < 4)
 		return -EINVAL;
@@ -2237,7 +2237,7 @@ static int ssi_rfc4543_gcm_setkey(struct crypto_aead *tfm, const u8 *key, unsign
 	struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
 	int rc = 0;
 
-	SSI_LOG_DEBUG("ssi_rfc4543_gcm_setkey()  keylen %d, key %p \n", keylen, key );
+	SSI_LOG_DEBUG("ssi_rfc4543_gcm_setkey()  keylen %d, key %p \n", keylen, key);
 
 	if (keylen < 4)
 		return -EINVAL;
@@ -2272,7 +2272,7 @@ static int ssi_gcm_setauthsize(struct crypto_aead *authenc,
 static int ssi_rfc4106_gcm_setauthsize(struct crypto_aead *authenc,
 				      unsigned int authsize)
 {
-	SSI_LOG_DEBUG("ssi_rfc4106_gcm_setauthsize()  authsize %d \n", authsize );
+	SSI_LOG_DEBUG("ssi_rfc4106_gcm_setauthsize()  authsize %d \n", authsize);
 
 	switch (authsize) {
 	case 8:
@@ -2289,7 +2289,7 @@ static int ssi_rfc4106_gcm_setauthsize(struct crypto_aead *authenc,
 static int ssi_rfc4543_gcm_setauthsize(struct crypto_aead *authenc,
 				       unsigned int authsize)
 {
-	SSI_LOG_DEBUG("ssi_rfc4543_gcm_setauthsize()  authsize %d \n", authsize );
+	SSI_LOG_DEBUG("ssi_rfc4543_gcm_setauthsize()  authsize %d \n", authsize);
 
 	if (authsize != 16)
 		return -EINVAL;
Signature · 1 line
2.7.4
#8 lore raw

PATCH 7/11 Fix ERROR: open brace '{' following function declarations go on the next line

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed "ERROR: open brace '{' following function declarations go on the next line".

---
 drivers/staging/ccree/ssi_aead.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/ccree/ssi_aead.c +4 -2
index 32edebe..7bc1193 100644
@@ -1542,7 +1542,8 @@ static inline int ssi_aead_ccm(
 	return 0;
 }
 
-static int config_ccm_adata(struct aead_request *req) {
+static int config_ccm_adata(struct aead_request *req)
+{
 	struct crypto_aead *tfm = crypto_aead_reqtfm(req);
 	struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
 	struct aead_req_ctx *req_ctx = aead_request_ctx(req);
@@ -1886,7 +1887,8 @@ static inline void ssi_aead_dump_gcm(
 }
 #endif
 
-static int config_gcm_context(struct aead_request *req) {
+static int config_gcm_context(struct aead_request *req)
+{
 	struct crypto_aead *tfm = crypto_aead_reqtfm(req);
 	struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
 	struct aead_req_ctx *req_ctx = aead_request_ctx(req);
Signature · 1 line
2.7.4
#9 lore raw

PATCH 8/11 Fix ERROR: space prohibited before open square bracket '['

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixied "ERROR: space prohibited before open square bracket '['".

---
 drivers/staging/ccree/ssi_aead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ccree/ssi_aead.c +1 -1
index 7bc1193..6d2c035 100644
@@ -1588,7 +1588,7 @@ static int config_ccm_adata(struct aead_request *req)
 	req_ctx->ccm_hdr_size = format_ccm_a0 (a0, req->assoclen);
 
 	memset(req->iv + 15 - req->iv[0], 0, req->iv[0] + 1);
-	req->iv [15] = 1;
+	req->iv[15] = 1;
 
 	memcpy(ctr_count_0, req->iv, AES_BLOCK_SIZE) ;
 	ctr_count_0[15] = 0;
Signature · 1 line
2.7.4
#10 lore raw

PATCH 9/11 Fix ERROR: space prohibited before that ','

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed "ERROR: space prohibited before that ','".

---
 drivers/staging/ccree/ssi_aead.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/ccree/ssi_aead.c +4 -4
index 6d2c035..d697244 100644
@@ -1916,16 +1916,16 @@ static int config_gcm_context(struct aead_request *req)
 	if (req_ctx->plaintext_authenticate_only == false) {
 		__be64 temp64;
 		temp64 = cpu_to_be64(req->assoclen * 8);
-		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64));
+		memcpy (&req_ctx->gcm_len_block.lenA, &temp64, sizeof(temp64));
 		temp64 = cpu_to_be64(cryptlen * 8);
-		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8);
+		memcpy (&req_ctx->gcm_len_block.lenC, &temp64, 8);
 	}
 	else { //rfc4543=>  all data(AAD,IV,Plain) are considered additional data that is nothing is encrypted.
 		__be64 temp64;
 		temp64 = cpu_to_be64((req->assoclen+GCM_BLOCK_RFC4_IV_SIZE+cryptlen) * 8);
-		memcpy (&req_ctx->gcm_len_block.lenA , &temp64, sizeof(temp64));
+		memcpy (&req_ctx->gcm_len_block.lenA, &temp64, sizeof(temp64));
 		temp64 = 0;
-		memcpy (&req_ctx->gcm_len_block.lenC , &temp64, 8);
+		memcpy (&req_ctx->gcm_len_block.lenC, &temp64, 8);
 	}
 
 	return 0;
Signature · 1 line
2.7.4
#11 lore raw

PATCH 10/11 Fix ERROR: else should follow close brace '}'

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixied "ERROR: else should follow close brace '}'".

---
 drivers/staging/ccree/ssi_aead.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/ccree/ssi_aead.c +1 -2
index d697244..c148d81 100644
@@ -1919,8 +1919,7 @@ static int config_gcm_context(struct aead_request *req)
 		memcpy (&req_ctx->gcm_len_block.lenA, &temp64, sizeof(temp64));
 		temp64 = cpu_to_be64(cryptlen * 8);
 		memcpy (&req_ctx->gcm_len_block.lenC, &temp64, 8);
-	}
-	else { //rfc4543=>  all data(AAD,IV,Plain) are considered additional data that is nothing is encrypted.
+	} else { //rfc4543=>  all data(AAD,IV,Plain) are considered additional data that is nothing is encrypted.
 		__be64 temp64;
 		temp64 = cpu_to_be64((req->assoclen+GCM_BLOCK_RFC4_IV_SIZE+cryptlen) * 8);
 		memcpy (&req_ctx->gcm_len_block.lenA, &temp64, sizeof(temp64));
Signature · 1 line
2.7.4
#12 lore raw

PATCH 11/11 Fix ERROR: "foo* bar" should be "foo *bar"

In reply to Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed 'ERROR: "foo* bar" should be "foo *bar"'.

---
 drivers/staging/ccree/ssi_aead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ccree/ssi_aead.c +1 -1
index c148d81..c70e450 100644
@@ -1843,7 +1843,7 @@ static inline int ssi_aead_gcm(
 
 #ifdef CC_DEBUG
 static inline void ssi_aead_dump_gcm(
-	const char* title,
+	const char *title,
 	struct aead_request *req)
 {
 	struct crypto_aead *tfm = crypto_aead_reqtfm(req);
Signature · 1 line
2.7.4
#13 lore raw
In reply to Jhih-Ming Huang

Subject is wrong. It should be:

[PATCH 1/11] Staging: ccree: add spaces blah blah blah

Quoted 2 lines · Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

No need.

Quoted 2 lines

In this series patches, I fix all of the coding style error in driver/staging/ccree/ssi_aead.c from 54 errors to 0 error.

You could put this into the cover letter. When we put this into the final git log we don't see the series only individual patches.

Quoted 3 lines

The first patch fixed 'ERROR: space required after that'.

This patch fixes ...

regards,
dan carpenter

#2 lore raw

Re: [PATCH 02/11] Fix ERROR: spaces required around that

In reply to Jhih-Ming Huang
Quoted 4 lines · Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed 'ERROR: spaces required around that'

You're breaking the patches up in a bad way. This one should be combined with the previous patch.

regards,
dan carpenter

#6 lore raw

Re: [PATCH 05/11] Fix ERROR: space prohibited after that open parenthesis '('

In reply to Jhih-Ming Huang
Quoted 14 lines · Jhih-Ming Huang

From: Jhih-Ming Hunag <[email protected]>

Fixed "ERROR: space prohibited after that open parenthesis '('".

---
 drivers/staging/ccree/ssi_aead.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/ccree/ssi_aead.c +0 -0
index 6bcab5a..5166874 100644

drivers/staging/ccree/ssi_aead.c static int validate_data_size(struct ssi_aead_ctx *ctx, · line 1378

Quoted 5 lines
drivers/staging/ccree/ssi_aead.c +1 -1
@@ -1375,10 +1375,10 @@ static int validate_data_size(struct ssi_aead_ctx *ctx,
 static unsigned int format_ccm_a0(u8 *pA0Buff, u32 headerSize)
 {
 	unsigned int len = 0;
-	if ( headerSize == 0 ) {
+	if (headerSize == 0 ) {

Remove the other space as well. I looked ahead in the series so I see that you do it later, but it should be done here.

regards,
dan carpenter

#14 lore raw
In reply to Dan Carpenter
Quoted 1 line · Dan Carpenter

On Tue, Jun 20, 2017 at 01:19:44PM +0800, Jhih-Ming Huang wrote:

[]

Quoted 5 lines
Quoted 2 lines

In this series patches, I fix all of the coding style error in driver/staging/ccree/ssi_aead.c from 54 errors to 0 error.

You could put this into the cover letter. When we put this into the final git log we don't see the series only individual patches.

Which sometimes is a pity as the cover letter can contain useful information which can easily be added in a merge.