staging: wlan-ng: line over 80 character limit
PATCH 1/1 staging: wlan-ng: line over 80 character limit
Align Macro and function to prevent them from going over the 80 character a line limit for readability.
WARNING: line over 80 characters
--- drivers/staging/wlan-ng/hfa384x.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wlan-ng/hfa384x.h +3 -3
@@ -517,7 +517,7 @@ struct hfa384x_tx_frame { HFA384x_TXSTATUS_DISCON | HFA384x_TXSTATUS_AGEDERR | \ HFA384x_TXSTATUS_RETRYERR)) -#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) +#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m)))#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \
@@ -1369,8 +1369,8 @@ struct hfa384x {void hfa384x_create (struct hfa384x *hw,struct usb_device *usb);void hfa384x_destroy (struct hfa384x *hw); -int -hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime,int genesis); +int hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime, +int genesis);int hfa384x_drvr_disable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_enable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_flashdl_enable (struct hfa384x *hw);
Signature · 1 line
2.17.1
Quoted 3 lines · Branden Bonaby
Align Macro and function to prevent them from going over the 80 character a line limit for readability.
WARNING: line over 80 characters
I'm not sure why the word macro is capitalized.
It looks like the #define still goes over 80 characters. I think that a lot of whitespace could be dropped. Usually #define and the macro name are right next to each other, for example.
julia
Quoted 40 lines
Signed-off-by Branden Bonaby <[email protected]>--- drivers/staging/wlan-ng/hfa384x.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/wlan-ng/hfa384x.h +3
-4@@ -517,7 +517,7 @@ struct hfa384x_tx_frame { HFA384x_TXSTATUS_DISCON | HFA384x_TXSTATUS_AGEDERR | \ HFA384x_TXSTATUS_RETRYERR)) -#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) +#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m)))#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8)#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \@@ -1369,8 +1369,8 @@ struct hfa384x {void hfa384x_create (struct hfa384x *hw,struct usb_device *usb);void hfa384x_destroy (struct hfa384x *hw); -int -hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime,int genesis); +int hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime, +int genesis);int hfa384x_drvr_disable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_enable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_flashdl_enable (struct hfa384x *hw); --2.17.1
--
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/20190313214825.7089-1-brandonbonaby94%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
PATCH v2 1/1 staging: wlan-ng: line over 80 character limit
In reply to Branden BonabyAlign macros and function to prevent them from going over the 80 character a line limit for readability. There should not be tabspace between #define and the name.
WARNING: line over 80 characters
---
Changes in v2:
changed tab space to just one space between #define, the name and the parameters so the line does not go over the 80 character a line limit.
drivers/staging/wlan-ng/hfa384x.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/wlan-ng/hfa384x.h +7 -7
@@ -517,13 +517,13 @@ struct hfa384x_tx_frame { HFA384x_TXSTATUS_DISCON | HFA384x_TXSTATUS_AGEDERR | \ HFA384x_TXSTATUS_RETRYERR)) -#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) +#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) -#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) -#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \ +#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) +#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \ HFA384x_TX_STRUCTYPE, 3) -#define HFA384x_TX_TXEX_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) -#define HFA384x_TX_TXOK_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) +#define HFA384x_TX_TXEX_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) +#define HFA384x_TX_TXOK_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)/*-------------------------------------------------------------------- * Communication Frames: Receive Frames *--------------------------------------------------------------------
@@ -1369,8 +1369,8 @@ struct hfa384x {void hfa384x_create (struct hfa384x *hw,struct usb_device *usb);void hfa384x_destroy (struct hfa384x *hw); -int -hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime,int genesis); +int hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime, +int genesis);int hfa384x_drvr_disable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_enable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_flashdl_enable (struct hfa384x *hw);
Signature · 1 line
2.17.1
Greg KH
maintainerQuoted 4 lines · Branden Bonaby
Align macros and function to prevent them from going over the 80 character a line limit for readability. There should not be tabspace between #define and the name.
WARNING: line over 80 characters
That is a lot of different things happening in the same patch. This should be probably just 2 patches, one for the macro alignment and one for the function prototype changing.
thanks,
greg k-h
v3 cover staging: wlan-ng: realign function and macros
In reply to Branden BonabyThis patch set does the following:
1) Removes tabspaces in macro definition
2) Aligns function to prevent it from
going over 80 character limit.
3) splits previous patch into 2 patches.
Branden Bonaby (2):
staging: wlan-ng: Tabspaces in macro definition
staging: wlan-ng: line over 80 character limit
drivers/staging/wlan-ng/hfa384x.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
Signature · 1 line
2.17.1
PATCH v3 1/2 staging: wlan-ng: Tabspaces in macro definition
Remove tabspace in macro definition to conform to Linux kernel coding style. Replaced each tabspace with a single white space.
--- drivers/staging/wlan-ng/hfa384x.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/staging/wlan-ng/hfa384x.h +6 -7
@@ -517,13 +517,12 @@ struct hfa384x_tx_frame { HFA384x_TXSTATUS_DISCON | HFA384x_TXSTATUS_AGEDERR | \ HFA384x_TXSTATUS_RETRYERR)) -#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) - -#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) -#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \ - HFA384x_TX_STRUCTYPE, 3) -#define HFA384x_TX_TXEX_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) -#define HFA384x_TX_TXOK_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) +#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) +#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) +#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \ + HFA384x_TX_STRUCTYPE, 3) +#define HFA384x_TX_TXEX_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) +#define HFA384x_TX_TXOK_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1)/*-------------------------------------------------------------------- * Communication Frames: Receive Frames *--------------------------------------------------------------------
Signature · 1 line
2.17.1
PATCH v3 2/2 staging: wlan-ng: line over 80 character limit
Align function to prevent it from going over
the 80 character a line limit for readability.
WARNING: line over 80 characters
--- drivers/staging/wlan-ng/hfa384x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wlan-ng/hfa384x.h +2 -2
@@ -1368,8 +1368,8 @@ struct hfa384x {void hfa384x_create (struct hfa384x *hw,struct usb_device *usb);void hfa384x_destroy (struct hfa384x *hw); -int -hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime,int genesis); +int hfa384x_corereset (struct hfa384x *hw,int holdtime,int settletime, +int genesis);int hfa384x_drvr_disable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_enable (struct hfa384x *hw,u16 macport);int hfa384x_drvr_flashdl_enable (struct hfa384x *hw);
Signature · 1 line
2.17.1
Greg KH
maintainerRe: [PATCH v3 1/2] staging: wlan-ng: Tabspaces in macro definition
In reply to Branden BonabyQuoted 17 lines · Branden Bonaby
Remove tabspace in macro definition to conform to Linux kernel coding style. Replaced each tabspace with a single white space.
Signed-off-by Branden Bonaby <[email protected]>--- drivers/staging/wlan-ng/hfa384x.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/staging/wlan-ng/hfa384x.h +0
-1@@ -517,13 +517,12 @@ struct hfa384x_tx_frame { HFA384x_TXSTATUS_DISCON | HFA384x_TXSTATUS_AGEDERR | \ HFA384x_TXSTATUS_RETRYERR)) -#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m)))
drivers/staging/wlan-ng/hfa384x.h struct hfa384x_tx_frame { · line 523
Quoted 10 lines
drivers/staging/wlan-ng/hfa384x.h +4
-6- -#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) -#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \ - HFA384x_TX_STRUCTYPE, 3) -#define HFA384x_TX_TXEX_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) -#define HFA384x_TX_TXOK_SET (v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) +#define HFA384x_TX_SET (v, m, s) ((((u16)(v)) << ((u16)(s))) & ((u16)(m))) +#define HFA384x_TX_MACPORT_SET (v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) +#define HFA384x_TX_STRUCTYPE_SET (v) HFA384x_TX_SET(v, \ + HFA384x_TX_STRUCTYPE, 3)
That's a lot harder to understand now, right?
The original code here should be fine.
thanks,
greg k-h