* [PATCH] staging: slicoss.c: checkpatch warnings
@ 2014-11-06 23:24 Jaime Arrocha
2014-11-06 23:33 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Jaime Arrocha @ 2014-11-06 23:24 UTC (permalink / raw)
To: gregkh; +Cc: liodot, charrer, linux-kernel
Correction of warnings of lines with 80 plus character.
Some warnings were left in favor of readability, others
were created by breaking quoted strings.
Memory barriers comments are obvious but remove warnings.
Let me know if any corrections are needed.
Signed-off-by: Jaime Arrocha <jarrocha27@gmail.com>
---
drivers/staging/slicoss/slicoss.c | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index cff7cbe..e546dae 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -99,8 +99,8 @@
#include "slic.h"
static uint slic_first_init = 1;
-static char *slic_banner = "Alacritech SLIC Technology(tm) Server "
- "and Storage Accelerator (Non-Accelerated)";
+char *slic_banner = "Alacritech SLIC Technology(tm) Server and "
+ "Storage Accelerator (Non-Accelerated)";
static char *slic_proc_version = "2.0.351 2006/07/14 12:26:00";
@@ -139,7 +139,7 @@ static inline void slic_reg32_write(void __iomem *reg, u32 value, bool flush)
{
writel(value, reg);
if (flush)
- mb();
+ mb(); /* memory barrier for mapped registry */
}
static inline void slic_reg64_write(struct adapter *adapter, void __iomem *reg,
@@ -154,7 +154,7 @@ static inline void slic_reg64_write(struct adapter *adapter, void __iomem *reg,
}
writel(value, reg);
if (flush)
- mb();
+ mb(); /* memory barrier for mapped registry */
spin_unlock_irqrestore(&adapter->bit64reglock.lock,
adapter->bit64reglock.flags);
}
@@ -498,12 +498,14 @@ static int slic_card_download(struct adapter *adapter)
slic_reg32_write(&slic_regs->slic_wcs,
baseaddress + codeaddr, FLUSH);
/* Write out instruction to low addr */
- slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
+ slic_reg32_write(&slic_regs->slic_wcs,
+ instruction, FLUSH);
instruction = *(u32 *)(fw->data + index);
index += 4;
/* Write out instruction to high addr */
- slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
+ slic_reg32_write(&slic_regs->slic_wcs,
+ instruction, FLUSH);
instruction = *(u32 *)(fw->data + index);
index += 4;
}
@@ -1884,7 +1886,8 @@ static void slic_xmit_fail(struct adapter *adapter,
break;
case XMIT_FAIL_HOSTCMD_FAIL:
dev_err(&adapter->netdev->dev,
- "xmit_start skb[%p] type[%x] No host commands available\n", skb, skb->pkt_type);
+ "xmit_start skb[%p] type[%x] No host commands available\n",
+ skb, skb->pkt_type);
break;
}
}
@@ -2096,11 +2099,10 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
}
} else if (isr & ISR_XDROP) {
dev_err(&dev->dev,
- "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
+ "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
} else {
dev_err(&dev->dev,
- "isr & ISR_ERR [%x]\n",
- isr);
+ "isr & ISR_ERR [%x]\n", isr);
}
}
@@ -2340,7 +2342,8 @@ static int slic_if_init(struct adapter *adapter)
SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
#else
slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
- slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
+ slic_reg32_write(&slic_regs->slic_isp,
+ (u32)&pshmem->isr, FLUSH);
#endif
spin_unlock_irqrestore(&adapter->bit64reglock.lock,
adapter->bit64reglock.flags);
@@ -2555,7 +2558,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (copy_from_user(data, rq->ifr_data, 28)) {
PRINT_ERROR
- ("slic: copy_from_user FAILED getting initial simba param\n");
+ ("slic: copy_from_user FAILED getting"
+ " initial simba param\n");
return -EFAULT;
}
@@ -2570,7 +2574,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
(tracemon_request ==
SLIC_DUMP_IN_PROGRESS)) {
PRINT_ERROR
- ("ATK Diagnostic Trace Dump Requested but already in progress... ignore\n");
+ ("ATK Diagnostic Trace Dump Requested"
+ " but already in progress... ignore\n");
} else {
PRINT_ERROR
("ATK Diagnostic Trace Dump Requested\n");
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: slicoss.c: checkpatch warnings
2014-11-06 23:24 [PATCH] staging: slicoss.c: checkpatch warnings Jaime Arrocha
@ 2014-11-06 23:33 ` Greg KH
0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-11-06 23:33 UTC (permalink / raw)
To: Jaime Arrocha; +Cc: liodot, charrer, linux-kernel
On Thu, Nov 06, 2014 at 05:24:54PM -0600, Jaime Arrocha wrote:
> Correction of warnings of lines with 80 plus character.
> Some warnings were left in favor of readability, others
> were created by breaking quoted strings.
> Memory barriers comments are obvious but remove warnings.
> Let me know if any corrections are needed.
>
> Signed-off-by: Jaime Arrocha <jarrocha27@gmail.com>
Please only make one change per patch, so this needs to be split up into
multiple patches.
Also use scripts/get_maintainer.pl to find the correct mailing lists to
cc on the patch.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] staging: slicoss.c: checkpatch warnings
@ 2014-11-07 0:57 Jaime Arrocha
2014-11-07 2:48 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Jaime Arrocha @ 2014-11-07 0:57 UTC (permalink / raw)
To: gregkh, liodot, charrer; +Cc: matlackdavid, monamagarwal123, joe, linux-kernel
Correction of warnings of lines with 80 plus character.
The rest were left for better code readability
Signed-off-by: Jaime Arrocha <jarrocha27@gmail.com>
---
drivers/staging/slicoss/slicoss.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index cff7cbe..d65fa92 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -99,8 +99,8 @@
#include "slic.h"
static uint slic_first_init = 1;
-static char *slic_banner = "Alacritech SLIC Technology(tm) Server "
- "and Storage Accelerator (Non-Accelerated)";
+char *slic_banner = "Alacritech SLIC Technology(tm) Server and "
+ "Storage Accelerator (Non-Accelerated)";
static char *slic_proc_version = "2.0.351 2006/07/14 12:26:00";
@@ -498,12 +498,14 @@ static int slic_card_download(struct adapter *adapter)
slic_reg32_write(&slic_regs->slic_wcs,
baseaddress + codeaddr, FLUSH);
/* Write out instruction to low addr */
- slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
+ slic_reg32_write(&slic_regs->slic_wcs,
+ instruction, FLUSH);
instruction = *(u32 *)(fw->data + index);
index += 4;
/* Write out instruction to high addr */
- slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
+ slic_reg32_write(&slic_regs->slic_wcs,
+ instruction, FLUSH);
instruction = *(u32 *)(fw->data + index);
index += 4;
}
@@ -1884,7 +1886,8 @@ static void slic_xmit_fail(struct adapter *adapter,
break;
case XMIT_FAIL_HOSTCMD_FAIL:
dev_err(&adapter->netdev->dev,
- "xmit_start skb[%p] type[%x] No host commands available\n", skb, skb->pkt_type);
+ "xmit_start skb[%p] type[%x] No host commands available\n",
+ skb, skb->pkt_type);
break;
}
}
@@ -2096,11 +2099,10 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
}
} else if (isr & ISR_XDROP) {
dev_err(&dev->dev,
- "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
+ "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
} else {
dev_err(&dev->dev,
- "isr & ISR_ERR [%x]\n",
- isr);
+ "isr & ISR_ERR [%x]\n", isr);
}
}
@@ -2340,7 +2342,8 @@ static int slic_if_init(struct adapter *adapter)
SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
#else
slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
- slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
+ slic_reg32_write(&slic_regs->slic_isp,
+ (u32)&pshmem->isr, FLUSH);
#endif
spin_unlock_irqrestore(&adapter->bit64reglock.lock,
adapter->bit64reglock.flags);
@@ -2555,7 +2558,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (copy_from_user(data, rq->ifr_data, 28)) {
PRINT_ERROR
- ("slic: copy_from_user FAILED getting initial simba param\n");
+ ("slic: copy_from_user FAILED getting"
+ " initial simba param\n");
return -EFAULT;
}
@@ -2570,7 +2574,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
(tracemon_request ==
SLIC_DUMP_IN_PROGRESS)) {
PRINT_ERROR
- ("ATK Diagnostic Trace Dump Requested but already in progress... ignore\n");
+ ("ATK Diagnostic Trace Dump Requested"
+ " but already in progress... ignore\n");
} else {
PRINT_ERROR
("ATK Diagnostic Trace Dump Requested\n");
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: slicoss.c: checkpatch warnings
2014-11-07 0:57 Jaime Arrocha
@ 2014-11-07 2:48 ` Greg KH
2014-11-07 3:37 ` Jaime Arrocha
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-11-07 2:48 UTC (permalink / raw)
To: Jaime Arrocha
Cc: liodot, charrer, matlackdavid, monamagarwal123, joe, linux-kernel
On Thu, Nov 06, 2014 at 06:57:27PM -0600, Jaime Arrocha wrote:
> Correction of warnings of lines with 80 plus character.
> The rest were left for better code readability
>
> Signed-off-by: Jaime Arrocha <jarrocha27@gmail.com>
> ---
> drivers/staging/slicoss/slicoss.c | 27 ++++++++++++++++-----------
> 1 file changed, 16 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
> index cff7cbe..d65fa92 100644
> --- a/drivers/staging/slicoss/slicoss.c
> +++ b/drivers/staging/slicoss/slicoss.c
> @@ -99,8 +99,8 @@
> #include "slic.h"
>
> static uint slic_first_init = 1;
> -static char *slic_banner = "Alacritech SLIC Technology(tm) Server "
> - "and Storage Accelerator (Non-Accelerated)";
> +char *slic_banner = "Alacritech SLIC Technology(tm) Server and "
> + "Storage Accelerator (Non-Accelerated)";
Why did you take away the 'static' marking here? And make this one full
line please.
>
> static char *slic_proc_version = "2.0.351 2006/07/14 12:26:00";
>
> @@ -498,12 +498,14 @@ static int slic_card_download(struct adapter *adapter)
> slic_reg32_write(&slic_regs->slic_wcs,
> baseaddress + codeaddr, FLUSH);
> /* Write out instruction to low addr */
> - slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
> + slic_reg32_write(&slic_regs->slic_wcs,
> + instruction, FLUSH);
> instruction = *(u32 *)(fw->data + index);
> index += 4;
>
> /* Write out instruction to high addr */
> - slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
> + slic_reg32_write(&slic_regs->slic_wcs,
> + instruction, FLUSH);
> instruction = *(u32 *)(fw->data + index);
> index += 4;
> }
> @@ -1884,7 +1886,8 @@ static void slic_xmit_fail(struct adapter *adapter,
> break;
> case XMIT_FAIL_HOSTCMD_FAIL:
> dev_err(&adapter->netdev->dev,
> - "xmit_start skb[%p] type[%x] No host commands available\n", skb, skb->pkt_type);
> + "xmit_start skb[%p] type[%x] No host commands available\n",
> + skb, skb->pkt_type);
> break;
> }
> }
> @@ -2096,11 +2099,10 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
> }
> } else if (isr & ISR_XDROP) {
> dev_err(&dev->dev,
> - "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
> + "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
> } else {
> dev_err(&dev->dev,
> - "isr & ISR_ERR [%x]\n",
> - isr);
> + "isr & ISR_ERR [%x]\n", isr);
> }
> }
>
> @@ -2340,7 +2342,8 @@ static int slic_if_init(struct adapter *adapter)
> SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
> #else
> slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
> - slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
> + slic_reg32_write(&slic_regs->slic_isp,
> + (u32)&pshmem->isr, FLUSH);
> #endif
> spin_unlock_irqrestore(&adapter->bit64reglock.lock,
> adapter->bit64reglock.flags);
> @@ -2555,7 +2558,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
>
> if (copy_from_user(data, rq->ifr_data, 28)) {
> PRINT_ERROR
> - ("slic: copy_from_user FAILED getting initial simba param\n");
> + ("slic: copy_from_user FAILED getting"
> + " initial simba param\n");
Never break a string across a line.
> return -EFAULT;
> }
>
> @@ -2570,7 +2574,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
> (tracemon_request ==
> SLIC_DUMP_IN_PROGRESS)) {
> PRINT_ERROR
> - ("ATK Diagnostic Trace Dump Requested but already in progress... ignore\n");
> + ("ATK Diagnostic Trace Dump Requested"
> + " but already in progress... ignore\n");
Same here, never do this.
If you fix up the PRINT_ERROR() macros, you will not get checkpatch
warnings. But that's not a real issue, this driver has so many other
problems...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: slicoss.c: checkpatch warnings
2014-11-07 2:48 ` Greg KH
@ 2014-11-07 3:37 ` Jaime Arrocha
0 siblings, 0 replies; 5+ messages in thread
From: Jaime Arrocha @ 2014-11-07 3:37 UTC (permalink / raw)
To: Greg KH
Cc: Lior Dotan, charrer, matlackdavid, monamagarwal123, joe,
linux-kernel
Thanks for the feedback. I'll pay more attention.
On Thu, Nov 6, 2014 at 8:48 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Nov 06, 2014 at 06:57:27PM -0600, Jaime Arrocha wrote:
>> Correction of warnings of lines with 80 plus character.
>> The rest were left for better code readability
>>
>> Signed-off-by: Jaime Arrocha <jarrocha27@gmail.com>
>> ---
>> drivers/staging/slicoss/slicoss.c | 27 ++++++++++++++++-----------
>> 1 file changed, 16 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
>> index cff7cbe..d65fa92 100644
>> --- a/drivers/staging/slicoss/slicoss.c
>> +++ b/drivers/staging/slicoss/slicoss.c
>> @@ -99,8 +99,8 @@
>> #include "slic.h"
>>
>> static uint slic_first_init = 1;
>> -static char *slic_banner = "Alacritech SLIC Technology(tm) Server "
>> - "and Storage Accelerator (Non-Accelerated)";
>> +char *slic_banner = "Alacritech SLIC Technology(tm) Server and "
>> + "Storage Accelerator (Non-Accelerated)";
>
> Why did you take away the 'static' marking here? And make this one full
> line please.
>
>
>
>>
>> static char *slic_proc_version = "2.0.351 2006/07/14 12:26:00";
>>
>> @@ -498,12 +498,14 @@ static int slic_card_download(struct adapter *adapter)
>> slic_reg32_write(&slic_regs->slic_wcs,
>> baseaddress + codeaddr, FLUSH);
>> /* Write out instruction to low addr */
>> - slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
>> + slic_reg32_write(&slic_regs->slic_wcs,
>> + instruction, FLUSH);
>> instruction = *(u32 *)(fw->data + index);
>> index += 4;
>>
>> /* Write out instruction to high addr */
>> - slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
>> + slic_reg32_write(&slic_regs->slic_wcs,
>> + instruction, FLUSH);
>> instruction = *(u32 *)(fw->data + index);
>> index += 4;
>> }
>> @@ -1884,7 +1886,8 @@ static void slic_xmit_fail(struct adapter *adapter,
>> break;
>> case XMIT_FAIL_HOSTCMD_FAIL:
>> dev_err(&adapter->netdev->dev,
>> - "xmit_start skb[%p] type[%x] No host commands available\n", skb, skb->pkt_type);
>> + "xmit_start skb[%p] type[%x] No host commands available\n",
>> + skb, skb->pkt_type);
>> break;
>> }
>> }
>> @@ -2096,11 +2099,10 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
>> }
>> } else if (isr & ISR_XDROP) {
>> dev_err(&dev->dev,
>> - "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
>> + "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
>> } else {
>> dev_err(&dev->dev,
>> - "isr & ISR_ERR [%x]\n",
>> - isr);
>> + "isr & ISR_ERR [%x]\n", isr);
>> }
>> }
>>
>> @@ -2340,7 +2342,8 @@ static int slic_if_init(struct adapter *adapter)
>> SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
>> #else
>> slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
>> - slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
>> + slic_reg32_write(&slic_regs->slic_isp,
>> + (u32)&pshmem->isr, FLUSH);
>> #endif
>> spin_unlock_irqrestore(&adapter->bit64reglock.lock,
>> adapter->bit64reglock.flags);
>> @@ -2555,7 +2558,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
>>
>> if (copy_from_user(data, rq->ifr_data, 28)) {
>> PRINT_ERROR
>> - ("slic: copy_from_user FAILED getting initial simba param\n");
>> + ("slic: copy_from_user FAILED getting"
>> + " initial simba param\n");
>
> Never break a string across a line.
>
>> return -EFAULT;
>> }
>>
>> @@ -2570,7 +2574,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
>> (tracemon_request ==
>> SLIC_DUMP_IN_PROGRESS)) {
>> PRINT_ERROR
>> - ("ATK Diagnostic Trace Dump Requested but already in progress... ignore\n");
>> + ("ATK Diagnostic Trace Dump Requested"
>> + " but already in progress... ignore\n");
>
> Same here, never do this.
>
> If you fix up the PRINT_ERROR() macros, you will not get checkpatch
> warnings. But that's not a real issue, this driver has so many other
> problems...
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-07 3:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06 23:24 [PATCH] staging: slicoss.c: checkpatch warnings Jaime Arrocha
2014-11-06 23:33 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2014-11-07 0:57 Jaime Arrocha
2014-11-07 2:48 ` Greg KH
2014-11-07 3:37 ` Jaime Arrocha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox