staging: wilc1000: Enhance code formatting
PATCH 1/4 staging: wilc1000: Enhance code formatting
Trims line size at 80 characters wilc_wlan_cfg.c file by moving a part of the lines in a new line.
Fixed the checkpath.pl issue:
CHECK: line over 80 characters.
--- drivers/staging/wilc1000/wilc_wlan_cfg.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/staging/wilc1000/wilc_wlan_cfg.c +16 -7
@@ -217,7 +217,8 @@ static int wilc_wlan_cfg_set_word(u8 *frame, u32 offset, u16 id, u32 val32)return 7 ; } -static int wilc_wlan_cfg_set_str (u8 *frame,u32 offset,u16 id,u8 *str,u32 size) +static int wilc_wlan_cfg_set_str (u8 *frame,u32 offset,u16 id,u8 *str, +u32 size) {u8 *buf;
@@ -298,7 +299,8 @@ static void wilc_wlan_parse_response_frame(u8 *info, int size)break ;if (g_cfg_hword[i].id == wid) { - g_cfg_hword[i].val =cpu_to_le16 (info[3 ] | (info[4 ] <<8 )); + g_cfg_hword[i].val = +cpu_to_le16 (info[3 ] | (info[4 ] <<8 ));break ; } i++;
@@ -312,7 +314,10 @@ static void wilc_wlan_parse_response_frame(u8 *info, int size)break ;if (g_cfg_word[i].id == wid) { - g_cfg_word[i].val =cpu_to_le32 (info[3 ] | (info[4 ] <<8 ) | (info[5 ] <<16 ) | (info[6 ] <<24 )); + g_cfg_word[i].val =cpu_to_le32 (info[3 ] + | (info[4 ] <<8 ) + | (info[5 ] <<16 ) + | (info[6 ] <<24 ));break ; } i++;
@@ -332,7 +337,8 @@ static void wilc_wlan_parse_response_frame(u8 *info, int size) i += toggle; toggle ^=1 ; } -memcpy (g_cfg_str[i].str, &info[2 ], (info[2 ] +1 )); +memcpy (g_cfg_str[i].str, &info[2 ], + (info[2 ] +1 ));break ; } i++;
@@ -478,14 +484,16 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 buffer_size)u32 size = g_cfg_str[i].str[0 ];if (buffer_size >= size) { -if (g_cfg_str[i].id ==WID_SITE_SURVEY_RESULTS ) { +if (g_cfg_str[i].id == +WID_SITE_SURVEY_RESULTS ){static int toggle; i += toggle; toggle ^=1 ; } -memcpy (buffer, &g_cfg_str[i].str[1 ], size); +memcpy (buffer, &g_cfg_str[i].str[1 ], + size); ret = size; }break ;
@@ -510,7 +518,8 @@ int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size, size -=4 ;/** -* The valid types of response messages are 'R' (Response), 'I' (Information), and 'N' (Network Information) +* The valid types of response messages are 'R' (Response), +* 'I' (Information), and 'N' (Network Information) **/ switch (msg_type) {
Signature · 1 line
2.9.3
Quoted 1 line · Tamara Diaconita
Trims line size at 80 characters
wilc_wlan_cfg.cfile by moving a part of the lines in a new line.
The line above is too long. We want the log message line max of 72. (git log doesn't handle wrapping so it gets hard to read if lines are too long.)
Quoted 2 lines
Fixed the checkpath.pl issue:
spell->checkpatch.pl
Quoted 1 line
CHECK: line over 80 characters.
Update subject to say what what you did - wrap lines of code at 80 chars.
I suggest leaving out the last change....see why below... the others since it is comment change.
Quoted 73 lines
Signed-off-by Tamara Diaconita <[email protected]>--- drivers/staging/wilc1000/wilc_wlan_cfg.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)drivers/staging/wilc1000/wilc_wlan_cfg.c +14
-6@@ -217,7 +217,8 @@ static int wilc_wlan_cfg_set_word(u8 *frame, u32 offset, u16 id, u32 val32)return 7 ; } -static int wilc_wlan_cfg_set_str (u8 *frame,u32 offset,u16 id,u8 *str,u32 size) +static int wilc_wlan_cfg_set_str (u8 *frame,u32 offset,u16 id,u8 *str, +u32 size) {u8 *buf;@@ -298,7 +299,8 @@ static void wilc_wlan_parse_response_frame(u8 *info, int size)break ;if (g_cfg_hword[i].id == wid) { - g_cfg_hword[i].val =cpu_to_le16 (info[3 ] | (info[4 ] <<8 )); + g_cfg_hword[i].val = +cpu_to_le16 (info[3 ] | (info[4 ] <<8 ));break ; } i++;@@ -312,7 +314,10 @@ static void wilc_wlan_parse_response_frame(u8 *info, int size)break ;if (g_cfg_word[i].id == wid) { - g_cfg_word[i].val =cpu_to_le32 (info[3 ] | (info[4 ] <<8 ) | (info[5 ] <<16 ) | (info[6 ] <<24 )); + g_cfg_word[i].val =cpu_to_le32 (info[3 ] + | (info[4 ] <<8 ) + | (info[5 ] <<16 ) + | (info[6 ] <<24 ));break ; } i++;@@ -332,7 +337,8 @@ static void wilc_wlan_parse_response_frame(u8 *info, int size) i += toggle; toggle ^=1 ; } -memcpy (g_cfg_str[i].str, &info[2 ], (info[2 ] +1 )); +memcpy (g_cfg_str[i].str, &info[2 ], + (info[2 ] +1 ));break ; } i++;@@ -478,14 +484,16 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 buffer_size)u32 size = g_cfg_str[i].str[0 ];if (buffer_size >= size) { -if (g_cfg_str[i].id ==WID_SITE_SURVEY_RESULTS ) { +if (g_cfg_str[i].id == +WID_SITE_SURVEY_RESULTS ){static int toggle; i += toggle; toggle ^=1 ; } -memcpy (buffer, &g_cfg_str[i].str[1 ], size); +memcpy (buffer, &g_cfg_str[i].str[1 ], + size); ret = size; }break ;
drivers/staging/wilc1000/wilc_wlan_cfg.c int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size, · line 525
Quoted 9 lines
drivers/staging/wilc1000/wilc_wlan_cfg.c +2
-1@@ -510,7 +518,8 @@ int wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size, size -=4 ;/** -* The valid types of response messages are 'R' (Response), 'I' (Information), and 'N' (Network Information) +* The valid types of response messages are 'R' (Response), +* 'I' (Information), and 'N' (Network Information) **/ switch (msg_type) {
This last one is in a comment which right away, makes it different. It also draws the reviewers eye to the fact that the comment block is formatted incorrectly, which may lead to a "why don't you fix that too?" and the growth of your patch into a monster patch ;)
This file can use an overhaul of the commenting style. If, in the future, you want to do a clean sweep of the file with respect to the comments, that would be a single patch. For now, I suggest leaving this piece out of this patch set.
alisons
Quoted 9 lines
Signature · 8 lines
2.9.3 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170310165833.4033-1-diaconita.tamara%40gmail.com. For more options, visit https://groups.google.com/d/optout.