Removed some checkpatch.pl warnings.
Subsystems (2)
cover Removed some checkpatch.pl warnings.
This patch set removes following checkpatch.pl warnings from ft1000_hw.c.
WARNING: Use #include <linux/io.h> instead of <asm/io.h>
WARNING: Use #include <linux/bitops.h> instead of <asm/bitops.h>
WARNING: else is not generally useful after a break or return
WARNING: braces {} are not necessary for any arm of this statement
WARNING: Unnecessary parentheses
WARNING: Missing a blank line after declarations
Gulsah Kose (7):
staging: arch: alpha: boot: Combined seperated strings.
staging: ft1000: ft1000-pcmcia: Used "linux" instead of "asm".
staging: ft1000: ft1000-pcmcia: Used "linux" instead of "asm"
staging: ft1000: ft1000-pcmcia: Removed all useless "else"
staging: ft1000: ft1000-pcmcia: Deleted unnecessary braces.
staging: ft1000: ft1000-pcmcia: Removed unnecessary parentheses.
staging: ft1000: ft1000-pcmcia: Added missing blank line.
arch/alpha/boot/bootpz.c | 3 +- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 295 +++++++++++------------ 2 files changed, 147 insertions(+), 151 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/7 staging: arch: alpha: boot: Combined seperated strings.
This patch fixes "quoted string split across lines" checkpatch.pl warning in bootpz.c
--- arch/alpha/boot/bootpz.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/alpha/boot/bootpz.c +1 -2
@@ -87,8 +87,7 @@ check_range(unsigned long vstart, unsigned long vend, kaddr = (find_pa (vaddr) |PAGE_OFFSET );if (kaddr >= kstart && kaddr <= kend) {#ifdef DEBUG_CHECK_RANGE -srm_printk ("OVERLAP: vaddr 0x%lx kaddr 0x%lx" -" [0x%lx:0x%lx]\n" , +srm_printk ("OVERLAP: vaddr 0x%lx kaddr 0x%lx [0x%lx:0x%lx]\n" , vaddr, kaddr, kstart, kend);#endif return 1 ;
Signature · 1 line
1.9.1
PATCH 2/7 staging: ft1000: ft1000-pcmcia: Used "linux" instead of "asm".
In reply to Gulsah KoseUsed "linux" instead of "asm" and removed following checkpatch.pl warning:
WARNING: Use #include <linux/io.h> instead of <asm/io.h>
--- 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
@@ -28,7 +28,7 @@#include <linux/timer.h> #include <linux/interrupt.h> #include <linux/in.h> -#include <asm/io.h> +#include <linux/io.h> #include <asm/bitops.h> #include <linux/netdevice.h>
Signature · 1 line
1.9.1
PATCH 3/7 staging: ft1000: ft1000-pcmcia: Used "linux" instead of "asm"
In reply to Gulsah KoseUsed "linux" instead of "asm" in include line and removed following checkpatch.pl warning:
WARNING: Use #include <linux/bitops.h> instead of <asm/bitops.h>
--- 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
@@ -29,7 +29,7 @@#include <linux/interrupt.h> #include <linux/in.h> #include <linux/io.h> -#include <asm/bitops.h> +#include <linux/bitops.h> #include <linux/netdevice.h> #include <linux/etherdevice.h>
Signature · 1 line
1.9.1
PATCH 4/7 staging: ft1000: ft1000-pcmcia: Removed all useless "else"
In reply to Gulsah KoseRemoved all else keywords that used after break or return. Removed following checkpatch.pl warnings:
WARNING: else is not generally useful after a break or return
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 285 +++++++++++------------ 1 file changed, 141 insertions(+), 144 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +141 -144
@@ -459,9 +459,8 @@ static int ft1000_reset_card(struct net_device *dev)if (card_download (dev, fw_entry->data, fw_entry->size)) {pr_debug ("card download unsuccessful\n" );return false; - }else { -pr_debug ("card download successful\n" ); } +pr_debug ("card download successful\n" );mdelay (10 );
@@ -860,64 +859,63 @@ static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer,if (size > maxsz) {pr_debug ("Invalid command length = %d\n" , size);return false; + } + ppseudohdr = (u16 *)pbuffer; +spin_lock_irqsave (&info->dpram_lock, flags); +if (info->AsicID ==ELECTRABUZZ_ID ) { +ft1000_write_reg (dev,FT1000_REG_DPRAM_ADDR , +FT1000_DPRAM_RX_BASE +2 ); +for (i =0 ; i <= (size >>1 ); i++) { + tempword = +ft1000_read_reg (dev,FT1000_REG_DPRAM_DATA ); + *pbuffer++ =ntohs (tempword); + } }else { - ppseudohdr = (u16 *)pbuffer; -spin_lock_irqsave (&info->dpram_lock, flags); -if (info->AsicID ==ELECTRABUZZ_ID ) { -ft1000_write_reg (dev,FT1000_REG_DPRAM_ADDR , -FT1000_DPRAM_RX_BASE +2 ); -for (i =0 ; i <= (size >>1 ); i++) { - tempword = -ft1000_read_reg (dev,FT1000_REG_DPRAM_DATA ); - *pbuffer++ =ntohs (tempword); - } - }else { -ft1000_write_reg (dev,FT1000_REG_DPRAM_ADDR , -FT1000_DPRAM_MAG_RX_BASE ); - *pbuffer =inw (dev->base_addr +FT1000_REG_MAG_DPDATAH ); -pr_debug ("received data = 0x%x\n" , *pbuffer); - pbuffer++; -ft1000_write_reg (dev,FT1000_REG_DPRAM_ADDR , -FT1000_DPRAM_MAG_RX_BASE +1 ); -for (i =0 ; i <= (size >>2 ); i++) { - *pbuffer = -inw (dev->base_addr + -FT1000_REG_MAG_DPDATAL ); - pbuffer++; - *pbuffer = -inw (dev->base_addr + -FT1000_REG_MAG_DPDATAH ); - pbuffer++; - } -/* copy odd aligned word */ - *pbuffer =inw (dev->base_addr +FT1000_REG_MAG_DPDATAL ); -pr_debug ("received data = 0x%x\n" , *pbuffer); +ft1000_write_reg (dev,FT1000_REG_DPRAM_ADDR , +FT1000_DPRAM_MAG_RX_BASE ); + *pbuffer =inw (dev->base_addr +FT1000_REG_MAG_DPDATAH ); +pr_debug ("received data = 0x%x\n" , *pbuffer); + pbuffer++; +ft1000_write_reg (dev,FT1000_REG_DPRAM_ADDR , +FT1000_DPRAM_MAG_RX_BASE +1 ); +for (i =0 ; i <= (size >>2 ); i++) { + *pbuffer = +inw (dev->base_addr + +FT1000_REG_MAG_DPDATAL ); pbuffer++; - *pbuffer =inw (dev->base_addr +FT1000_REG_MAG_DPDATAH ); -pr_debug ("received data = 0x%x\n" , *pbuffer); + *pbuffer = +inw (dev->base_addr + +FT1000_REG_MAG_DPDATAH ); pbuffer++; } -if (size &0x0001 ) { -/* copy odd byte from fifo */ - tempword =ft1000_read_reg (dev,FT1000_REG_DPRAM_DATA ); - *pbuffer =ntohs (tempword); - } -spin_unlock_irqrestore (&info->dpram_lock, flags); +/* copy odd aligned word */ + *pbuffer =inw (dev->base_addr +FT1000_REG_MAG_DPDATAL ); +pr_debug ("received data = 0x%x\n" , *pbuffer); + pbuffer++; + *pbuffer =inw (dev->base_addr +FT1000_REG_MAG_DPDATAH ); +pr_debug ("received data = 0x%x\n" , *pbuffer); + pbuffer++; + } +if (size &0x0001 ) { +/* copy odd byte from fifo */ + tempword =ft1000_read_reg (dev,FT1000_REG_DPRAM_DATA ); + *pbuffer =ntohs (tempword); + } +spin_unlock_irqrestore (&info->dpram_lock, flags); -/* -* Check if pseudo header checksum is good -* Calculate pseudo header checksum -*/ - tempword = *ppseudohdr++; -for (i =1 ; i <7 ; i++) - tempword ^= *ppseudohdr++; -if ((tempword != *ppseudohdr)) { -pr_debug ("Pseudo header checksum mismatch\n" ); -/* Drop this message */ -return false; - } -return true; +/* +* Check if pseudo header checksum is good +* Calculate pseudo header checksum +*/ + tempword = *ppseudohdr++; +for (i =1 ; i <7 ; i++) + tempword ^= *ppseudohdr++; +if ((tempword != *ppseudohdr)) { +pr_debug ("Pseudo header checksum mismatch\n" ); +/* Drop this message */ +return false; } +return true; }/*---------------------------------------------------------------------------
@@ -1400,105 +1398,104 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) info->DrvErrNum = DrvErrNum;ft1000_reset_card (dev);return ; - }else { -/* Flush corrupted pkt from FIFO */ - i =0 ; -do { + } +/* Flush corrupted pkt from FIFO */ + i =0 ; +do { +if (info->AsicID ==ELECTRABUZZ_ID ) { + tempword = +ft1000_read_reg (dev,FT1000_REG_DFIFO ); + tempword = +ft1000_read_reg (dev,FT1000_REG_DFIFO_STAT ); + }else { + templong = +inl (dev->base_addr +FT1000_REG_MAG_DFR ); + tempword = +inw (dev->base_addr +FT1000_REG_MAG_DFSR ); + } + i++; +/* +* This should never happen unless the ASIC is broken. +* We must reset to recover. +*/ +if ((i >2048 ) || (tempword ==0 )) {if (info->AsicID ==ELECTRABUZZ_ID ) { - tempword = -ft1000_read_reg (dev,FT1000_REG_DFIFO ); - tempword = -ft1000_read_reg (dev,FT1000_REG_DFIFO_STAT ); + info->DSP_TIME[0 ] = +ft1000_read_dpram (dev, +FT1000_DSP_TIMER0 ); + info->DSP_TIME[1 ] = +ft1000_read_dpram (dev, +FT1000_DSP_TIMER1 ); + info->DSP_TIME[2 ] = +ft1000_read_dpram (dev, +FT1000_DSP_TIMER2 ); + info->DSP_TIME[3 ] = +ft1000_read_dpram (dev, +FT1000_DSP_TIMER3 ); }else { - templong = -inl (dev->base_addr +FT1000_REG_MAG_DFR ); - tempword = -inw (dev->base_addr +FT1000_REG_MAG_DFSR ); + info->DSP_TIME[0 ] = +ft1000_read_dpram_mag_16 (dev, +FT1000_MAG_DSP_TIMER0 , +FT1000_MAG_DSP_TIMER0_INDX ); + info->DSP_TIME[1 ] = +ft1000_read_dpram_mag_16 (dev, +FT1000_MAG_DSP_TIMER1 , +FT1000_MAG_DSP_TIMER1_INDX ); + info->DSP_TIME[2 ] = +ft1000_read_dpram_mag_16 (dev, +FT1000_MAG_DSP_TIMER2 , +FT1000_MAG_DSP_TIMER2_INDX ); + info->DSP_TIME[3 ] = +ft1000_read_dpram_mag_16 (dev, +FT1000_MAG_DSP_TIMER3 , +FT1000_MAG_DSP_TIMER3_INDX ); } - i++; -/* -* This should never happen unless the ASIC is broken. -* We must reset to recover. -*/ -if ((i >2048 ) || (tempword ==0 )) { -if (info->AsicID ==ELECTRABUZZ_ID ) { - info->DSP_TIME[0 ] = -ft1000_read_dpram (dev, -FT1000_DSP_TIMER0 ); - info->DSP_TIME[1 ] = -ft1000_read_dpram (dev, -FT1000_DSP_TIMER1 ); - info->DSP_TIME[2 ] = -ft1000_read_dpram (dev, -FT1000_DSP_TIMER2 ); - info->DSP_TIME[3 ] = -ft1000_read_dpram (dev, -FT1000_DSP_TIMER3 ); - }else { - info->DSP_TIME[0 ] = -ft1000_read_dpram_mag_16 (dev, -FT1000_MAG_DSP_TIMER0 , -FT1000_MAG_DSP_TIMER0_INDX ); - info->DSP_TIME[1 ] = -ft1000_read_dpram_mag_16 (dev, -FT1000_MAG_DSP_TIMER1 , -FT1000_MAG_DSP_TIMER1_INDX ); - info->DSP_TIME[2 ] = -ft1000_read_dpram_mag_16 (dev, -FT1000_MAG_DSP_TIMER2 , -FT1000_MAG_DSP_TIMER2_INDX ); - info->DSP_TIME[3 ] = -ft1000_read_dpram_mag_16 (dev, -FT1000_MAG_DSP_TIMER3 , -FT1000_MAG_DSP_TIMER3_INDX ); - } +if (tempword ==0 ) { +/* +* Let's check if ASIC reads are still ok by reading the Mask register +* which is never zero at this point of the code. +*/ + tempword = +inw (dev->base_addr + +FT1000_REG_SUP_IMASK );if (tempword ==0 ) { -/* -* Let's check if ASIC reads are still ok by reading the Mask register -* which is never zero at this point of the code. -*/ - tempword = -inw (dev->base_addr + -FT1000_REG_SUP_IMASK ); -if (tempword ==0 ) { -/* This indicates that we can not communicate with the ASIC */ - info->DrvErrNum = -FIFO_FLUSH_BADCNT ; - }else { -/* Let's assume that we really flush the FIFO */ - pcmcia->PktIntfErr++; -return ; - } +/* This indicates that we can not communicate with the ASIC */ + info->DrvErrNum = +FIFO_FLUSH_BADCNT ; }else { - info->DrvErrNum =FIFO_FLUSH_MAXLIMIT ; +/* Let's assume that we really flush the FIFO */ + pcmcia->PktIntfErr++; +return ; } -return ; + }else { + info->DrvErrNum =FIFO_FLUSH_MAXLIMIT ; } - tempword =inw (dev->base_addr +FT1000_REG_SUP_STAT ); - }while ((tempword &0x03 ) !=0x03 ); -if (info->AsicID ==ELECTRABUZZ_ID ) { - i++; -pr_debug ("Flushing FIFO complete = %x\n" , tempword); -/* Flush last word in FIFO. */ - tempword =ft1000_read_reg (dev,FT1000_REG_DFIFO ); -/* Update FIFO counter for DSP */ - i = i *2 ; -pr_debug ("Flush Data byte count to dsp = %d\n" , i); - info->fifo_cnt += i; -ft1000_write_dpram (dev,FT1000_FIFO_LEN , - info->fifo_cnt); - }else { -pr_debug ("Flushing FIFO complete = %x\n" , tempword); -/* Flush last word in FIFO */ - templong =inl (dev->base_addr +FT1000_REG_MAG_DFR ); - tempword =inw (dev->base_addr +FT1000_REG_SUP_STAT ); -pr_debug ("FT1000_REG_SUP_STAT = 0x%x\n" , tempword); - tempword =inw (dev->base_addr +FT1000_REG_MAG_DFSR ); -pr_debug ("FT1000_REG_MAG_DFSR = 0x%x\n" , tempword); +return ; } -if (DrvErrNum) - pcmcia->PktIntfErr++; + tempword =inw (dev->base_addr +FT1000_REG_SUP_STAT ); + }while ((tempword &0x03 ) !=0x03 ); +if (info->AsicID ==ELECTRABUZZ_ID ) { + i++; +pr_debug ("Flushing FIFO complete = %x\n" , tempword); +/* Flush last word in FIFO. */ + tempword =ft1000_read_reg (dev,FT1000_REG_DFIFO ); +/* Update FIFO counter for DSP */ + i = i *2 ; +pr_debug ("Flush Data byte count to dsp = %d\n" , i); + info->fifo_cnt += i; +ft1000_write_dpram (dev,FT1000_FIFO_LEN , + info->fifo_cnt); + }else { +pr_debug ("Flushing FIFO complete = %x\n" , tempword); +/* Flush last word in FIFO */ + templong =inl (dev->base_addr +FT1000_REG_MAG_DFR ); + tempword =inw (dev->base_addr +FT1000_REG_SUP_STAT ); +pr_debug ("FT1000_REG_SUP_STAT = 0x%x\n" , tempword); + tempword =inw (dev->base_addr +FT1000_REG_MAG_DFSR ); +pr_debug ("FT1000_REG_MAG_DFSR = 0x%x\n" , tempword); } +if (DrvErrNum) + pcmcia->PktIntfErr++; }/*---------------------------------------------------------------------------
Signature · 1 line
1.9.1
PATCH 5/7 staging: ft1000: ft1000-pcmcia: Deleted unnecessary braces.
In reply to Gulsah KoseBrackets were removed from the expression that containing single line in the phrase "if else". Removed following checkpatch.pl warnings:
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
@@ -1945,11 +1945,10 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)ft1000_read_reg (dev,FT1000_REG_MAG_DFSR ); } -if (tempword &0x1f ) { +if (tempword &0x1f )ft1000_copy_up_pkt (dev); - }else { +else break ; - } cnt++; }while (cnt <MAX_RCV_LOOP );
Signature · 1 line
1.9.1
PATCH 6/7 staging: ft1000: ft1000-pcmcia: Removed unnecessary parentheses.
In reply to Gulsah KoseThis patch removes unnecessary parentheses from control expression. Removed following checkpatch.pl warning:
WARNING: Unnecessary parentheses
--- 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
@@ -910,7 +910,7 @@ static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer, tempword = *ppseudohdr++;for (i =1 ; i <7 ; i++) tempword ^= *ppseudohdr++; -if ((tempword != *ppseudohdr)) { +if (tempword != *ppseudohdr) {pr_debug ("Pseudo header checksum mismatch\n" );/* Drop this message */ return false;
Signature · 1 line
1.9.1
PATCH 7/7 staging: ft1000: ft1000-pcmcia: Added missing blank line.
In reply to Gulsah KoseAdded missing blank line after declaration. Removed following checkpatch.pl warning:
WARNING: Missing a blank line after declarations
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +1 -0
@@ -2004,6 +2004,7 @@ static void ft1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) {struct ft1000_info *ft_info; + ft_info =netdev_priv (dev);strlcpy (info->driver,"ft1000" ,sizeof (info->driver));
Signature · 1 line
1.9.1
Greg KH
maintainerRe: [Outreachy kernel] [PATCH 1/7] staging: arch: alpha: boot: Combined seperated strings.
In reply to Gulsah KoseQuoted 7 lines · Gulsah Kose
This patch fixes "quoted string split across lines" checkpatch.pl warning in
bootpz.cSigned-off-by Gulsah Kose <[email protected]>--- arch/alpha/boot/bootpz.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
I can't accept patches for stuff outside of drivers/staging/ sorry.
Greg KH
maintainerRe: [Outreachy kernel] [PATCH 2/7] staging: ft1000: ft1000-pcmcia: Used "linux" instead of "asm".
In reply to Gulsah KoseQuoted 13 lines · Gulsah Kose
Used "linux" instead of "asm" and removed following checkpatch.pl warning:
WARNING: Use #include <linux/io.h> instead of <asm/io.h>Signed-off-by Gulsah Kose <[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 line 34
Quoted 8 lines
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +1
-1@@ -28,7 +28,7 @@#include <linux/timer.h> #include <linux/interrupt.h> #include <linux/in.h> -#include <asm/io.h> +#include <linux/io.h> #include <asm/bitops.h> #include <linux/netdevice.h>
Please just fix both asm/ include file issues in the same patch, not in 2 different patches.
thanks,
greg k-h