staging/ft1000: fix the no brace needed warning in ft1000_interrupt
PATCH 1/8 staging/ft1000: fix the no brace needed warning in ft1000_interrupt
as the if statement encloses only one line braces around it are not needed.
The following warn fixed,
WARNING: braces {} are not necessary for single statement blocks
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +2 -3
@@ -1998,9 +1998,8 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)// Make sure we process all interrupt before leaving the ISR due to the edge trigger interrupt type while (inttype) { -if (inttype &ISR_DOORBELL_PEND ) { -ft1000_parse_dpram_msg (dev); - } +if (inttype &ISR_DOORBELL_PEND ) +ft1000_parse_dpram_msg (dev);if (inttype &ISR_RCV ) {DEBUG (1 ,"Data in FIFO\n" );
Signature · 1 line
1.7.9.5
PATCH 2/8 staging/ft1000: fix the spaces issue at the start of line
The following warns fixed
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2032: ERROR: code indent should use tabs where possible drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2032: WARNING: please, no spaces at the start of a line
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +1 -1
@@ -2029,7 +2029,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)ft1000_write_reg (dev,FT1000_REG_SUP_ISR , tempword);// Read interrupt type - inttype =ft1000_read_reg (dev,FT1000_REG_SUP_ISR ); + inttype =ft1000_read_reg (dev,FT1000_REG_SUP_ISR );DEBUG (1 ,"ft1000_hw: interrupt status register after clear = 0x%x\n" ,inttype); }ft1000_enable_interrupts (dev);
Signature · 1 line
1.7.9.5
Greg KH
maintainerRe: [PATCH 2/8] staging/ft1000: fix the spaces issue at the start of line
Quoted 15 lines · Devendra Naga
The following warns fixed
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2032: ERROR: code indent should use tabs where possibledrivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2032: WARNING: please, no spaces at the start of a lineSigned-off-by Devendra Naga <[email protected]>--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +0
-0
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c static irqreturn_t ft1000_interrupt(int irq, void *dev_id) · line 2032
Quoted 5 lines
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +1
-1@@ -2029,7 +2029,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)ft1000_write_reg (dev,FT1000_REG_SUP_ISR , tempword);// Read interrupt type - inttype =ft1000_read_reg (dev,FT1000_REG_SUP_ISR ); + inttype =ft1000_read_reg (dev,FT1000_REG_SUP_ISR );
Did you just indent this one too many tabs? Remember, a tab is 8 spaces, this should have lined up wit the line above it. Which, for some odd reason, is also using spaces, so why didn't that get fixed also?
thanks,
greg k-h
PATCH 3/8 staging/ft1000: fix sparse warning
In reply to Devendra Nagasparse warns about having 0 assigned to a pointer, fix it up by using NULL.
The following sparse warning is fixed
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c:170:52: warning: Using plain integer as NULL pointer
--- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +1 -1
@@ -167,7 +167,7 @@ int ft1000_create_dev(struct ft1000_device *dev) goto fail; } - dir =debugfs_create_dir (info->DeviceName,0 ); + dir =debugfs_create_dir (info->DeviceName,NULL );if (IS_ERR (dir)) { result =PTR_ERR (dir); goto debug_dir_fail;
Signature · 1 line
1.7.9.5
PATCH 4/8 staging/ft1000: fix sparse warning about the kernel thread handler function
In reply to Devendra Nagasparse throws warning about the ft1000_poll_thread as
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c:40:5: warning: symbol 'ft1000_poll_thread' was not declared. Should it be static?
--- drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +1 -1
@@ -37,7 +37,7 @@ static struct usb_device_id id_table[] = {MODULE_DEVICE_TABLE (usb, id_table);static bool gPollingfailed = FALSE; -int ft1000_poll_thread (void *arg) +static int ft1000_poll_thread (void *arg) {int ret =STATUS_SUCCESS ;
Signature · 1 line
1.7.9.5
PATCH 5/8 staging/ft1000: fix the no brace needed warning in ft1000_read_fifo_len
In reply to Devendra Nagaas the if else statements enclose only one line, so braces around them are not needed.
The following warning is fixed
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:100: WARNING: braces {} are not necessary for any arm of this statement
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +2 -3
@@ -97,11 +97,10 @@ static inline u16 ft1000_read_fifo_len(struct net_device *dev) {struct ft1000_info *info =netdev_priv (dev); -if (info->AsicID ==ELECTRABUZZ_ID ) { +if (info->AsicID ==ELECTRABUZZ_ID )return (ft1000_read_reg (dev,FT1000_REG_UFIFO_STAT ) -16 ); - }else { +else return (ft1000_read_reg (dev,FT1000_REG_MAG_UFSR ) -16 ); - } }//---------------------------------------------------------------------------
Signature · 1 line
1.7.9.5
PATCH 6/8 staging/ft1000: fix the foo * bar warning
In reply to Devendra Naga--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +1 -1
@@ -115,7 +115,7 @@ static inline u16 ft1000_read_fifo_len(struct net_device *dev)// value - value of dpram // //--------------------------------------------------------------------------- -u16 ft1000_read_dpram (struct net_device * dev,int offset) +u16 ft1000_read_dpram (struct net_device *dev,int offset) {struct ft1000_info *info =netdev_priv (dev);unsigned long flags;
Signature · 1 line
1.7.9.5
PATCH 7/8 staging/ft1000-pcmcia: fix checkpatch warnings
In reply to Devendra NagaThe below checkpatch warns fixed,
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:38: ERROR: that open brace { should be on the previous line drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:45: ERROR: that open brace { should be on the previous line drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:57: ERROR: that open brace { should be on the previous line
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c +4 -6
@@ -34,16 +34,14 @@#define PUTX_TO_PAGE (len, page, message, size, var) \ len += snprintf(page+len, PAGE_SIZE - len, message); \ - for(i = 0; i < (size - 1); i++) \ - { \ + for(i = 0; i < (size - 1); i++) { \ len += snprintf(page+len, PAGE_SIZE - len, "%02x:", var[i]); \ } \ len += snprintf(page+len, PAGE_SIZE - len, "%02x\n", var[i])#define PUTD_TO_PAGE (len, page, message, size, var) \ len += snprintf(page+len, PAGE_SIZE - len, message); \ - for(i = 0; i < (size - 1); i++) \ - { \ + for(i = 0; i < (size - 1); i++) { \ len += snprintf(page+len, PAGE_SIZE - len, "%d.", var[i]); \ } \ len += snprintf(page+len, PAGE_SIZE - len, "%d\n", var[i])
@@ -55,8 +53,8 @@ static int ft1000ReadProc(char *page, char **start, off_t off,int len;int i;struct ft1000_info *info; -char *status[] = - {"Idle (Disconnect)" ,"Searching" ,"Active (Connected)" , +char *status[] = { +"Idle (Disconnect)" ,"Searching" ,"Active (Connected)" ,"Waiting for L2" ,"Sleep" ,"No Coverage" ,"" ,"" };char *signal[] = {"" ,"*" ,"**" ,"***" ,"****" };
Signature · 1 line
1.7.9.5
PATCH 8/8 staging/ft1000: remove unnecessary assignment of ret with STATUS_SUCCESS
In reply to Devendra Nagaas ret is assigned to the return of ft1000_poll, we dont need to initialise ret with STATUS_SUCCESS.
--- drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +1 -1
@@ -39,7 +39,7 @@ MODULE_DEVICE_TABLE(usb, id_table);static bool gPollingfailed = FALSE;static int ft1000_poll_thread (void *arg) { -int ret =STATUS_SUCCESS ; +int ret;while (!kthread_should_stop ()) {msleep (10 );
Signature · 1 line
1.7.9.5