Re: [PATCH v3 11/22] staging: ccree: fix line indentation and breaks

2017-08-16 Thread Greg Kroah-Hartman
On Tue, Aug 15, 2017 at 09:26:39AM +0300, Gilad Ben-Yossef wrote:
> Fix wrong indentation and line breaks, including missing tabs,
> breaking lines longer then 80 char or wrongly broken.
> 
> Signed-off-by: Gilad Ben-Yossef 
> ---
>  drivers/staging/ccree/ssi_driver.c | 107 
> +++--
>  1 file changed, 67 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/staging/ccree/ssi_driver.c 
> b/drivers/staging/ccree/ssi_driver.c
> index 81cb63d..0ce2f57 100644
> --- a/drivers/staging/ccree/ssi_driver.c
> +++ b/drivers/staging/ccree/ssi_driver.c
> @@ -87,27 +87,31 @@ void dump_byte_array(const char *name, const u8 
> *the_array, unsigned long size)
>  
>   ret = snprintf(line_buf, sizeof(line_buf), "%s[%lu]: ", name, size);
>   if (ret < 0) {
> - SSI_LOG_ERR("snprintf returned %d . aborting buffer array 
> dump\n", ret);
> + SSI_LOG_ERR
> + ("snprintf returned %d . aborting buffer array dump\n",
> +  ret);

As Joe said, this is pretty bad.  Just move "ret);" to the next line,
and then fix it up so that there are not SSI_LOG_ERR() macros and use
the normal in-kernel printing functions instead, then you will not get
this type of warning.

thanks,

greg k-h


Re: [PATCH v3 11/22] staging: ccree: fix line indentation and breaks

2017-08-15 Thread Joe Perches
On Tue, 2017-08-15 at 09:26 +0300, Gilad Ben-Yossef wrote:
> Fix wrong indentation and line breaks, including missing tabs,
> breaking lines longer then 80 char or wrongly broken.
[]
> diff --git a/drivers/staging/ccree/ssi_driver.c 
> b/drivers/staging/ccree/ssi_driver.c
[]
> - SSI_LOG_ERR("snprintf returned %d . aborting buffer 
> array dump\n", ret);
> + SSI_LOG_ERR
> + ("snprintf returned %d . aborting buffer array 
> dump\n",
> +  ret);

This change is quite unpleasant to read.



[PATCH v3 11/22] staging: ccree: fix line indentation and breaks

2017-08-15 Thread Gilad Ben-Yossef
Fix wrong indentation and line breaks, including missing tabs,
breaking lines longer then 80 char or wrongly broken.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/staging/ccree/ssi_driver.c | 107 +++--
 1 file changed, 67 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/ccree/ssi_driver.c 
b/drivers/staging/ccree/ssi_driver.c
index 81cb63d..0ce2f57 100644
--- a/drivers/staging/ccree/ssi_driver.c
+++ b/drivers/staging/ccree/ssi_driver.c
@@ -87,27 +87,31 @@ void dump_byte_array(const char *name, const u8 *the_array, 
unsigned long size)
 
ret = snprintf(line_buf, sizeof(line_buf), "%s[%lu]: ", name, size);
if (ret < 0) {
-   SSI_LOG_ERR("snprintf returned %d . aborting buffer array 
dump\n", ret);
+   SSI_LOG_ERR
+   ("snprintf returned %d . aborting buffer array dump\n",
+ret);
return;
}
line_offset = ret;
for (i = 0, cur_byte = the_array;
 (i < size) && (line_offset < sizeof(line_buf)); i++, cur_byte++) {
-   ret = snprintf(line_buf + line_offset,
-  sizeof(line_buf) - line_offset,
-  "0x%02X ", *cur_byte);
+   ret = snprintf(line_buf + line_offset,
+  sizeof(line_buf) - line_offset,
+  "0x%02X ", *cur_byte);
if (ret < 0) {
-   SSI_LOG_ERR("snprintf returned %d . aborting buffer 
array dump\n", ret);
+   SSI_LOG_ERR
+   ("snprintf returned %d . aborting buffer array 
dump\n",
+ret);
return;
}
line_offset += ret;
-   if (line_offset > 75) { /* Cut before line end */
+   if (line_offset > 75) { /* Cut before line end */
SSI_LOG_DEBUG("%s\n", line_buf);
line_offset = 0;
}
}
 
-   if (line_offset > 0) /* Dump remaining line */
+   if (line_offset > 0)/* Dump remaining line */
SSI_LOG_DEBUG("%s\n", line_buf);
 }
 #endif
@@ -124,7 +128,7 @@ static irqreturn_t cc_isr(int irq, void *dev_id)
/* read the interrupt status */
irr = CC_HAL_READ_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_IRR));
SSI_LOG_DEBUG("Got IRR=0x%08X\n", irr);
-   if (unlikely(irr == 0)) { /* Probably shared interrupt line */
+   if (unlikely(irr == 0)) {   /* Probably shared interrupt line */
SSI_LOG_ERR("Got interrupt with empty IRR\n");
return IRQ_NONE;
}
@@ -137,7 +141,8 @@ static irqreturn_t cc_isr(int irq, void *dev_id)
/* Completion interrupt - most probable */
if (likely((irr & SSI_COMP_IRQ_MASK) != 0)) {
/* Mask AXI completion interrupt - will be unmasked in Deferred 
service handler */
-   CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_IMR), imr | 
SSI_COMP_IRQ_MASK);
+   CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_IMR),
+ imr | SSI_COMP_IRQ_MASK);
irr &= ~SSI_COMP_IRQ_MASK;
complete_request(drvdata);
}
@@ -145,7 +150,8 @@ static irqreturn_t cc_isr(int irq, void *dev_id)
/* TEE FIPS interrupt */
if (likely((irr & SSI_GPR0_IRQ_MASK) != 0)) {
/* Mask interrupt - will be unmasked in Deferred service 
handler */
-   CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_IMR), imr | 
SSI_GPR0_IRQ_MASK);
+   CC_HAL_WRITE_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_IMR),
+ imr | SSI_GPR0_IRQ_MASK);
irr &= ~SSI_GPR0_IRQ_MASK;
fips_handler(drvdata);
}
@@ -155,14 +161,18 @@ static irqreturn_t cc_isr(int irq, void *dev_id)
u32 axi_err;
 
/* Read the AXI error ID */
-   axi_err = CC_HAL_READ_REGISTER(CC_REG_OFFSET(CRY_KERNEL, 
AXIM_MON_ERR));
-   SSI_LOG_DEBUG("AXI completion error: axim_mon_err=0x%08X\n", 
axi_err);
+   axi_err =
+   CC_HAL_READ_REGISTER(CC_REG_OFFSET
+(CRY_KERNEL, AXIM_MON_ERR));
+   SSI_LOG_DEBUG("AXI completion error: axim_mon_err=0x%08X\n",
+ axi_err);
 
irr &= ~SSI_AXI_ERR_IRQ_MASK;
}
 
if (unlikely(irr != 0)) {
-   SSI_LOG_DEBUG("IRR includes unknown cause bits (0x%08X)\n", 
irr);
+   SSI_LOG_DEBUG("IRR includes unknown cause bits (0x%08X)\n",
+ irr);
/* Just warning */
}
 
@@ -176,8 +186,11 @@ int init_cc_regs(struct ssi_drvdata *drvdata, bool 
is_probe)
 
/* Unmask all AXI interrupt