Remove checkpatch.pl errors from drivers/staging/ft1000
cover Remove checkpatch.pl errors from drivers/staging/ft1000
This patches remove following code style errors from drivers/staging/ft1000:
ERROR: do not initialise statics to 0 or NULL
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: space required after that ',' (ctx:VxV)
ERROR: else should follow close brace '}'
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'
ERROR: space prohibited after that '&' (ctx:WxW)
ERROR: "(foo*)" should be "(foo *)"
ERROR: "foo * bar" should be "foo *bar"
Chen Weixiang (7):
staging: ft1000: do not initialise statics to 0 or NULL
staging: ft1000: spaces required around that '=', '<' and '=='
staging: ft1000: space required after that ','
staging: ft1000: else should follow close brace '}'
staging: ft1000: space prohibited after '(' and '&', before ')'
staging: ft1000: "(foo*)" should be "(foo *)"
staging: ft1000: "foo * bar" should be "foo *bar"
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 55 +++++++++++------------- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 50 ++++++++++----------- 2 files changed, 50 insertions(+), 55 deletions(-)
Signature · 1 line
2.1.1
PATCH 1/7 staging: ft1000: do not initialise statics to 0 or NULL
Remove following checkpatch.pl error from ft1000/ft1000-usb/ft1000_debug.c
ERROR: do not initialise statics to 0 or NULL
--- 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
@@ -38,7 +38,7 @@#include <linux/debugfs.h> #include "ft1000_usb.h" -static int ft1000_flarion_cnt =0 ; +static int ft1000_flarion_cnt;static int ft1000_open (struct inode *inode,struct file *file);static unsigned int ft1000_poll_dev (struct file *file,poll_table *wait);
Signature · 1 line
2.1.1
PATCH 2/7 staging: ft1000: spaces required around that '=', '<' and '=='
In reply to Chen WeixiangRemove code style errors from ft1000/ft1000-usb/ft1000_debug.c and ft1000/ft1000-pcmcia/ft1000_hw.c:
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 6 ++--- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 28 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +3 -3
@@ -812,11 +812,11 @@ static void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size,/* Make sure SLOWQ doorbell is clear */ tempword =ft1000_read_reg (dev,FT1000_REG_DOORBELL ); - i=0 ; + i =0 ;while (tempword &FT1000_DB_DPRAM_TX ) {mdelay (10 ); i++; -if (i==10 ) { +if (i ==10 ) {spin_unlock_irqrestore (&info->dpram_lock, flags);return ; }
@@ -1221,7 +1221,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev) ppseudo_hdr->portsrc =0 ;/* Calculate new checksum */ ppseudo_hdr->checksum = *pmsg++; -for (i=1 ; i<7 ; i++) { +for (i =1 ; i <7 ; i++) { ppseudo_hdr->checksum ^= *pmsg++; } pmsg = (u16 *) & tempbuffer[16 ];
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +14 -14
@@ -193,7 +193,7 @@ int ft1000_create_dev(struct ft1000_usb *dev)/* initialize application information */ dev->appcnt =0 ; -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) { dev->app_info[i].nTxMsg =0 ; dev->app_info[i].nRxMsg =0 ; dev->app_info[i].nTxMsgReject =0 ;
@@ -260,7 +260,7 @@ void ft1000_destroy_dev(struct net_device *netdev) dev->DeviceName);/* Make sure we free any memory reserve for slow Queue */ -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) {while (list_empty (&dev->app_info[i].app_sqlist) ==0 ) { pdpram_blk = list_entry(dev->app_info[i].app_sqlist.next, struct dpram_blk, list);list_del (&pdpram_blk->list);
@@ -318,7 +318,7 @@ static int ft1000_open(struct inode *inode, struct file *file) }/* Search for available application info block */ -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) {if ((dev->app_info[i].fileobject ==NULL )) {break ; }
@@ -369,7 +369,7 @@ static unsigned int ft1000_poll_dev(struct file *file, poll_table *wait) }/* Search for matching file object */ -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) {if (dev->app_info[i].fileobject == &file->f_owner) {/* DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", dev->app_info[i].app_id); */ break ;
@@ -411,7 +411,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,void __user *argp = (void __user *)argument;struct ft1000_info *info;struct ft1000_usb *ft1000dev; -int result=0 ; +int result =0 ;int cmd;int i;u16 tempword;
@@ -426,8 +426,8 @@ static long ft1000_ioctl(struct file *file, unsigned int command,0x00 ,0x00 ,0x02 ,0x37 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x01 ,0x7f ,0x00 , 0x00,0x01,0x00,0x00}; -unsigned short ledStat=0 ; -unsigned short conStat=0 ; +unsigned short ledStat =0 ; +unsigned short conStat =0 ;/* DEBUG("ft1000_ioctl called\n"); */
@@ -454,7 +454,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, }if (tempword ==DSPBCMSGID ) {/* Search for matching file object */ -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) {if (ft1000dev->app_info[i].fileobject == &file->f_owner) { ft1000dev->app_info[i].DspBCMsgFlag =1 ;DEBUG ("FT1000:ft1000_ioctl:Registered for broadcast messages\n" );
@@ -581,12 +581,12 @@ static long ft1000_ioctl(struct file *file, unsigned int command, result = -EFAULT ; }else {/* Check if this message came from a registered application */ -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) {if (ft1000dev->app_info[i].fileobject == &file->f_owner) {break ; } } -if (i==MAX_NUM_APP ) { +if (i ==MAX_NUM_APP ) {DEBUG ("FT1000:No matching application fileobject\n" ); result = -EINVAL ;kfree (dpram_data);
@@ -646,7 +646,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,/* Calculate new checksum */ ppseudo_hdr->checksum = *pmsg++;/* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */ -for (i=1 ; i<7 ; i++) { +for (i =1 ; i <7 ; i++) { ppseudo_hdr->checksum ^= *pmsg++;/* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */ }
@@ -682,7 +682,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, }/* Search for matching file object */ -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) {if (ft1000dev->app_info[i].fileobject == &file->f_owner) {/*DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */ break ;
@@ -766,14 +766,14 @@ static int ft1000_release(struct inode *inode, struct file *file) }/* Search for matching file object */ -for (i=0 ; i<MAX_NUM_APP ; i++) { +for (i =0 ; i <MAX_NUM_APP ; i++) {if (ft1000dev->app_info[i].fileobject == &file->f_owner) {/* DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */ break ; } } -if (i==MAX_NUM_APP ) +if (i ==MAX_NUM_APP )return 0 ;while (list_empty (&ft1000dev->app_info[i].app_sqlist) ==0 ) {
Signature · 1 line
2.1.1
PATCH 3/7 staging: ft1000: space required after that ','
In reply to Chen WeixiangRemove code style error from ft1000/ft1000-usb/ft1000_debug.c:
ERROR: space required after that ',' (ctx:VxV)
--- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +9 -9
@@ -301,7 +301,7 @@ static int ft1000_open(struct inode *inode, struct file *file) {struct ft1000_info *info;struct ft1000_usb *dev = (struct ft1000_usb *)inode->i_private; -int i,num; +int i, num;DEBUG ("%s called\n" , __func__); num = (MINOR (inode->i_rdev) &0xf );
@@ -419,12 +419,12 @@ static long ft1000_ioctl(struct file *file, unsigned int command,struct timeval tv;struct IOCTL_GET_VER get_ver_data;struct IOCTL_GET_DSP_STAT get_stat_data; -u8 ConnectionMsg[] = {0x00 ,0x44 ,0x10 ,0x20 ,0x80 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x93 ,0x64 , -0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x0a , -0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x12 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x02 ,0x37 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x01 ,0x7f ,0x00 , -0x00 ,0x01 ,0x00 ,0x00 }; +u8 ConnectionMsg[] = {0x00 ,0x44 ,0x10 ,0x20 ,0x80 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x93 ,0x64 , +0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x0a , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x12 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x02 ,0x37 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x01 ,0x7f ,0x00 , +0x00 ,0x01 ,0x00 ,0x00 };unsigned short ledStat =0 ;unsigned short conStat =0 ;
@@ -475,7 +475,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,break ; } -DEBUG ("FT1000:ft1000_ioctl:driver version = 0x%x\n" ,(unsigned int )get_ver_data.drv_ver); +DEBUG ("FT1000:ft1000_ioctl:driver version = 0x%x\n" , (unsigned int )get_ver_data.drv_ver);break ;case IOCTL_CONNECT :
@@ -652,7 +652,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, } pmsg++; ppseudo_hdr = (struct pseudo_hdr *)pmsg; - result =card_send_command (ft1000dev,(unsigned short *)dpram_data,total_len+2 ); + result =card_send_command (ft1000dev, (unsigned short *)dpram_data, total_len+2 ); ft1000dev->app_info[app_index].nTxMsg++;
Signature · 1 line
2.1.1
Re: [PATCH 3/7] staging: ft1000: space required after that ','
Quoted 27 lines · Chen Weixiang
Remove code style error from
ft1000/ft1000-usb/ft1000_debug.c:
ERROR: space required after that ',' (ctx:VxV)Signed-off-by Chen Weixiang <[email protected]>--- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +1
-3@@ -301,7 +301,7 @@ static int ft1000_open(struct inode *inode, struct file *file) {struct ft1000_info *info;struct ft1000_usb *dev = (struct ft1000_usb *)inode->i_private; -int i,num; +int i, num;DEBUG ("%s called\n" , __func__); num = (MINOR (inode->i_rdev) &0xf );@@ -419,12 +419,12 @@ static long ft1000_ioctl(struct file *file, unsigned int command,struct timeval tv;struct IOCTL_GET_VER get_ver_data;struct IOCTL_GET_DSP_STAT get_stat_data; -u8 ConnectionMsg[] = {0x00 ,0x44 ,0x10 ,0x20 ,0x80 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x93 ,0x64 , -0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x0a ,
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c static long ft1000_ioctl(struct file *file, unsigned int command, · line 427
Quoted 10 lines
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +6
-4-0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x12 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x02 ,0x37 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x01 ,0x7f ,0x00 , - 0x00,0x01,0x00,0x00}; +u8 ConnectionMsg[] = {0x00 ,0x44 ,0x10 ,0x20 ,0x80 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x93 ,0x64 , +0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x0a , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x12 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x02 ,0x37 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x01 ,0x7f ,0x00 , +0x00 ,0x01 ,0x00 ,0x00 };
Nice, however it still violates the 80 characters a line rule. Please redo this patch.
You can use the checkpatch to validate each patch befor sending and generally you should aim towards sending patches with 0 checkpatch warnings/errors. There is also the --strict option to the checkpatch which is also worth uisng as some kernel subsystems use it as a default.
Thanks,
Konrad
Quoted 27 lines
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +2
-2unsigned short ledStat =0 ;unsigned short conStat =0 ;@@ -475,7 +475,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,break ; } -DEBUG ("FT1000:ft1000_ioctl:driver version = 0x%x\n" ,(unsigned int )get_ver_data.drv_ver); +DEBUG ("FT1000:ft1000_ioctl:driver version = 0x%x\n" , (unsigned int )get_ver_data.drv_ver);break ;case IOCTL_CONNECT :@@ -652,7 +652,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, } pmsg++; ppseudo_hdr = (struct pseudo_hdr *)pmsg; - result =card_send_command (ft1000dev,(unsigned short *)dpram_data,total_len+2 ); + result =card_send_command (ft1000dev, (unsigned short *)dpram_data, total_len+2 ); ft1000dev->app_info[app_index].nTxMsg++;Signature · 6 lines
2.1.1 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/7] staging: ft1000: space required after that ','
Quoted 14 lines · Konrad Zapalowicz
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c static long ft1000_ioctl(struct file *file, unsigned int command, · line 427
Quoted 12 lines · Chen Weixiang
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +6
-6-u8 ConnectionMsg[] = {0x00 ,0x44 ,0x10 ,0x20 ,0x80 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x93 ,0x64 , -0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x0a , -0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x12 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x00 ,0x00 ,0x02 ,0x37 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x01 ,0x7f ,0x00 , -0x00 ,0x01 ,0x00 ,0x00 }; +u8 ConnectionMsg[] = {0x00 ,0x44 ,0x10 ,0x20 ,0x80 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x93 ,0x64 , +0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x0a , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x12 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x02 ,0x37 ,0x00 ,0x00 ,0x00 ,0x08 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x01 ,0x7f ,0x00 , +0x00 ,0x01 ,0x00 ,0x00 };
Quoted 5 lines
Nice, however it still violates the 80 characters a line rule. Please redo this patch.
Thanks,
Konrad
OK, I'll re-organize the array ConnectionMsg[], check the patches with checkpatch and send the patches again. Thank you, Konrad.
Signature · 2 lines
Best regards, Chen Weixiang (Alex)
PATCH 4/7 staging: ft1000: else should follow close brace '}'
In reply to Chen WeixiangRemove code style error from ft1000/ft1000-pcmcia/ft1000_hw.c:
ERROR: else should follow close brace '}'
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +5 -10
@@ -595,8 +595,7 @@ static void ft1000_hbchk(u_long data)if (tempword != ho) {if (info->AsicID ==ELECTRABUZZ_ID ) { tempword =ft1000_read_dpram (dev,FT1000_HI_HO ); - } -else { + }else { tempword =ntohs (ft1000_read_dpram_mag_16 (dev,FT1000_MAG_HI_HO ,FT1000_MAG_HI_HO_INDX )); } }
@@ -715,15 +714,13 @@ static void ft1000_hbchk(u_long data)if (tempword != hi) {if (info->AsicID ==ELECTRABUZZ_ID ) {ft1000_write_dpram (dev,FT1000_HI_HO , hi); - } -else { + }else {ft1000_write_dpram_mag_16 (dev,FT1000_MAG_HI_HO , hi_mag,FT1000_MAG_HI_HO_INDX ); }if (info->AsicID ==ELECTRABUZZ_ID ) { tempword =ft1000_read_dpram (dev,FT1000_HI_HO ); - } -else { + }else { tempword =ntohs (ft1000_read_dpram_mag_16 (dev,FT1000_MAG_HI_HO ,FT1000_MAG_HI_HO_INDX )); }
@@ -994,8 +991,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev)if (info->AsicID ==ELECTRABUZZ_ID ) { tempword =FT1000_DPRAM_RX_BASE +2 ; - } -else { + }else { tempword =FT1000_DPRAM_MAG_RX_BASE ; }if (ft1000_receive_cmd (dev, &cmdbuffer[0 ],MAX_CMD_SQSIZE , &tempword) ) {
@@ -1075,8 +1071,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev) info->ConTm =0 ; } } - } -else { + }else {DEBUG (1 ,"Media is down\n" );if (info->mediastate ==1 ) { info->mediastate =0 ;
Signature · 1 line
2.1.1
PATCH 5/7 staging: ft1000: space prohibited after '(' and '&', before ')'
In reply to Chen WeixiangRemove code style error from ft1000/ft1000-pcmcia/ft1000_hw.c:
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'
ERROR: space prohibited after that '&' (ctx:WxW)
--- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +16 -16
@@ -885,7 +885,7 @@ static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer,unsigned long flags;if (info->AsicID ==ELECTRABUZZ_ID ) { - size = (ft1000_read_dpram (dev, *pnxtph) ) +sizeof (struct pseudo_hdr ); + size = (ft1000_read_dpram (dev, *pnxtph)) +sizeof (struct pseudo_hdr ); }else { size = ntohs(ft1000_read_dpram_mag_16
@@ -994,10 +994,10 @@ static void ft1000_proc_drvmsg(struct net_device *dev) }else { tempword =FT1000_DPRAM_MAG_RX_BASE ; } -if (ft1000_receive_cmd (dev, &cmdbuffer[0 ],MAX_CMD_SQSIZE , &tempword) ) { +if (ft1000_receive_cmd (dev, &cmdbuffer[0 ],MAX_CMD_SQSIZE , &tempword)) {/* Get the message type which is total_len + PSEUDO header + msgtype + message body */ - pdrvmsg = (struct drv_msg *) & cmdbuffer[0 ]; + pdrvmsg = (struct drv_msg *) &cmdbuffer[0 ]; msgtype =ntohs (pdrvmsg->type);DEBUG (1 ,"Command message type = 0x%x\n" , msgtype);switch (msgtype) {
@@ -1051,7 +1051,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev) info->CardReady =1 ;break ;case MEDIA_STATE : - pmediamsg = (struct media_msg *) & cmdbuffer[0 ]; + pmediamsg = (struct media_msg *) &cmdbuffer[0 ];if (info->ProgConStat !=0xFF ) {if (pmediamsg->state) {DEBUG (1 ,"Media is up\n" );
@@ -1082,7 +1082,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev) }break ;case DSP_INIT_MSG : - pdspinitmsg = (struct dsp_init_msg *) & cmdbuffer[0 ]; + pdspinitmsg = (struct dsp_init_msg *) &cmdbuffer[0 ];memcpy (info->DspVer, pdspinitmsg->DspVer,DSPVERSZ ); DEBUG(1, "DSPVER = 0x%2x 0x%2x 0x%2x 0x%2x\n", info->DspVer[0], info->DspVer[1], info->DspVer[2],
@@ -1116,7 +1116,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev) tempword =ntohs (pdrvmsg->length); info->DSPInfoBlklen = tempword;if (tempword < (MAX_DSP_SESS_REC -4 )) { - pmsg = (u16 *) & pdrvmsg->data[0 ]; + pmsg = (u16 *) &pdrvmsg->data[0 ];for (i =0 ; i < ((tempword +1 ) /2 ); i++) { DEBUG(1, "FT1000:drivermsg:dsp info data = 0x%x\n",
@@ -1198,7 +1198,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev)* Put message into Slow Queue * Form Pseudo header */ - pmsg = (u16 *) & tempbuffer[0 ]; + pmsg = (u16 *) &tempbuffer[0 ]; ppseudo_hdr = (struct pseudo_hdr *) pmsg; ppseudo_hdr->length =htons (0x0012 ); ppseudo_hdr->source =0x10 ;
@@ -1219,7 +1219,7 @@ static void ft1000_proc_drvmsg(struct net_device *dev)for (i =1 ; i <7 ; i++) { ppseudo_hdr->checksum ^= *pmsg++; } - pmsg = (u16 *) & tempbuffer[16 ]; + pmsg = (u16 *) &tempbuffer[16 ]; *pmsg++ =htons (RSP_DRV_ERR_RPT_MSG ); *pmsg++ =htons (0x000e ); *pmsg++ =htons (info->DSP_TIME[0 ]);
@@ -1875,22 +1875,22 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) i + 8, htons(*packet)); } }else { -outl (*(u32 *) & pseudo.buff[0 ], +outl (*(u32 *) &pseudo.buff[0 ], dev->base_addr +FT1000_REG_MAG_UFDR );DEBUG (1 ,"ft1000_copy_down_pkt: Pseudo = 0x%8x\n" , - *(u32 *) & pseudo.buff[0 ]); -outl (*(u32 *) & pseudo.buff[2 ], + *(u32 *) &pseudo.buff[0 ]); +outl (*(u32 *) &pseudo.buff[2 ], dev->base_addr +FT1000_REG_MAG_UFDR );DEBUG (1 ,"ft1000_copy_down_pkt: Pseudo = 0x%8x\n" , - *(u32 *) & pseudo.buff[2 ]); -outl (*(u32 *) & pseudo.buff[4 ], + *(u32 *) &pseudo.buff[2 ]); +outl (*(u32 *) &pseudo.buff[4 ], dev->base_addr +FT1000_REG_MAG_UFDR );DEBUG (1 ,"ft1000_copy_down_pkt: Pseudo = 0x%8x\n" , - *(u32 *) & pseudo.buff[4 ]); -outl (*(u32 *) & pseudo.buff[6 ], + *(u32 *) &pseudo.buff[4 ]); +outl (*(u32 *) &pseudo.buff[6 ], dev->base_addr +FT1000_REG_MAG_UFDR );DEBUG (1 ,"ft1000_copy_down_pkt: Pseudo = 0x%8x\n" , - *(u32 *) & pseudo.buff[6 ]); + *(u32 *) &pseudo.buff[6 ]); plong = (u32 *) packet;/* Write PPP type + IP Packet into Downlink FIFO */
Signature · 1 line
2.1.1
PATCH 6/7 staging: ft1000: "(foo*)" should be "(foo *)"
In reply to Chen WeixiangRemove code style error from ft1000/ft1000-usb/ft1000_debug.c:
ERROR: "(foo*)" should be "(foo *)"
--- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +2 -2
@@ -447,7 +447,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,switch (cmd) {case IOCTL_REGISTER_CMD :DEBUG ("FT1000:ft1000_ioctl: IOCTL_FT1000_REGISTER called\n" ); - result =get_user (tempword, (__u16 __user *)argp); + result =get_user (tempword, (__u16 __user *)argp);if (result) {DEBUG ("result = %d failed to get_user\n" , result);break ;
@@ -652,7 +652,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, } pmsg++; ppseudo_hdr = (struct pseudo_hdr *)pmsg; - result =card_send_command (ft1000dev, (unsigned short *)dpram_data, total_len+2 ); + result =card_send_command (ft1000dev, (unsigned short *)dpram_data, total_len+2 ); ft1000dev->app_info[app_index].nTxMsg++;
Signature · 1 line
2.1.1
PATCH 7/7 staging: ft1000: "foo * bar" should be "foo *bar"
In reply to Chen WeixiangRemove code style error form ft1000/ft1000-pcmcia/ft1000_hw.c:
ERROR: "foo * bar" should be "foo *bar"
--- 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
@@ -1753,7 +1753,7 @@ static int ft1000_copy_up_pkt(struct net_device *dev)SUCCESS -------------------------------------------------------------------------*/ -static int ft1000_copy_down_pkt (struct net_device *dev,u16 * packet,u16 len) +static int ft1000_copy_down_pkt (struct net_device *dev,u16 *packet,u16 len) {struct ft1000_info *info =netdev_priv (dev);struct ft1000_pcmcia *pcmcia = info->priv;
Signature · 1 line
2.1.1