staging: wlan-ng: Add tabstop preceding the statement
PATCH 1/1 staging: wlan-ng: Add tabstop preceding the statement
This patch fixes the checkpatch.pl warning:
WARNING: Statements should start on a tabstop
--- drivers/staging/wlan-ng/prism2mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wlan-ng/prism2mgmt.c +1 -1
@@ -1308,7 +1308,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) hw->sniffhdr =0 ; wlandev->netdev->type =ARPHRD_IEEE80211_PRISM ; }else -if ((msg->wlanheader.status == +if ((msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr =1 ;
Signature · 1 line
2.1.4
Greg Kroah-Hartman
maintainerQuoted 14 lines · Maksymilian Piechota
This patch fixes the checkpatch.pl warning:
WARNING: Statements should start on a tabstop
Signed-off-by Maksymilian Piechota <[email protected]>--- drivers/staging/wlan-ng/prism2mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/wlan-ng/prism2mgmt.c +0
-0
drivers/staging/wlan-ng/prism2mgmt.c int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) · line 1314
Quoted 8 lines
drivers/staging/wlan-ng/prism2mgmt.c +1
-1@@ -1308,7 +1308,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) hw->sniffhdr =0 ; wlandev->netdev->type =ARPHRD_IEEE80211_PRISM ; }else -if ((msg->wlanheader.status == +if ((msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr =1 ;
Hm, this all doesn't look correct now, does it? Please fix up the whole if statement here.
thanks,
greg k-h
Quoted 10 lines · Greg Kroah-Hartman
Quoted 9 lines · Maksymilian Piechota
This patch fixes the checkpatch.pl warning:
WARNING: Statements should start on a tabstop
Signed-off-by Maksymilian Piechota <[email protected]>--- drivers/staging/wlan-ng/prism2mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
drivers/staging/wlan-ng/prism2mgmt.c int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) · line 1314
Quoted 13 lines
drivers/staging/wlan-ng/prism2mgmt.c +1
-1@@ -1308,7 +1308,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) hw->sniffhdr =0 ; wlandev->netdev->type =ARPHRD_IEEE80211_PRISM ; }else -if ((msg->wlanheader.status == +if ((msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr =1 ;Hm, this all doesn't look correct now, does it? Please fix up the whole if statement here.
Ideally, it'd look something like:
/* Set the driver state */
/* Do we want the prism2 header? */
if (msg->prismheader.status == P80211ENUM_msgitem_status_data_ok &&
msg->prismheader.data == P80211ENUM_truth_true) {
hw->sniffhdr = 0;
wlandev->netdev->type = ARPHRD_IEEE80211_PRISM;
} else if (msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok &&
msg->wlanheader.data == P80211ENUM_truth_true) {
hw->sniffhdr = 1;
wlandev->netdev->type = ARPHRD_IEEE80211_PRISM;
} else {
wlandev->netdev->type = ARPHRD_IEEE80211;
}with the unnecessary parentheses removed,
the logical continuations at the end-of-line,
and the else if on a single line.
Quoted 44 lines · Joe Perches
Quoted 10 lines · Greg Kroah-Hartman
Quoted 9 lines · Maksymilian Piechota
This patch fixes the checkpatch.pl warning:
WARNING: Statements should start on a tabstop
Signed-off-by Maksymilian Piechota <[email protected]>--- drivers/staging/wlan-ng/prism2mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 16 lines
drivers/staging/wlan-ng/prism2mgmt.c int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) · line 1314
Quoted 13 lines
drivers/staging/wlan-ng/prism2mgmt.c +1
-1@@ -1308,7 +1308,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) hw->sniffhdr =0 ; wlandev->netdev->type =ARPHRD_IEEE80211_PRISM ; }else -if ((msg->wlanheader.status == +if ((msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr =1 ;Hm, this all doesn't look correct now, does it? Please fix up the whole if statement here.
Ideally, it'd look something like:
/* Set the driver state */ /* Do we want the prism2 header? */ if (msg->prismheader.status == P80211ENUM_msgitem_status_data_ok && msg->prismheader.data == P80211ENUM_truth_true) { hw->sniffhdr = 0; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else if (msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok && msg->wlanheader.data == P80211ENUM_truth_true) { hw->sniffhdr = 1; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else { wlandev->netdev->type = ARPHRD_IEEE80211; }
Quoted 4 lines
with the unnecessary parentheses removed,
the logical continuations at the end-of-line,
and the else if on a single line.
I must admit it looks better, but this way we get 2 warnings instead of 1 (before my changes). What is the policy? Can we ignore more warnings in order to get cleaner code?
Quoted 45 lines · Maksymilian Piechota
Quoted 44 lines · Joe Perches
Quoted 10 lines · Greg Kroah-Hartman
Quoted 9 lines · Maksymilian Piechota
This patch fixes the checkpatch.pl warning:
WARNING: Statements should start on a tabstop
Signed-off-by Maksymilian Piechota <[email protected]>--- drivers/staging/wlan-ng/prism2mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 16 lines
drivers/staging/wlan-ng/prism2mgmt.c int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) · line 1314
Quoted 13 lines
drivers/staging/wlan-ng/prism2mgmt.c +1
-1@@ -1308,7 +1308,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) hw->sniffhdr =0 ; wlandev->netdev->type =ARPHRD_IEEE80211_PRISM ; }else -if ((msg->wlanheader.status == +if ((msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr =1 ;Hm, this all doesn't look correct now, does it? Please fix up the whole if statement here.
Ideally, it'd look something like:
/* Set the driver state */ /* Do we want the prism2 header? */ if (msg->prismheader.status == P80211ENUM_msgitem_status_data_ok && msg->prismheader.data == P80211ENUM_truth_true) { hw->sniffhdr = 0; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else if (msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok && msg->wlanheader.data == P80211ENUM_truth_true) { hw->sniffhdr = 1; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else { wlandev->netdev->type = ARPHRD_IEEE80211; }
Quoted 8 lines
Quoted 4 lines
with the unnecessary parentheses removed,
the logical continuations at the end-of-line,
and the else if on a single line.I must admit it looks better, but this way we get 2 warnings instead of 1 (before my changes). What is the policy? Can we ignore more warnings in order to get cleaner code?
Yes please.
checkpatch is just a guide, it's brainless.
The reason these lines are > 80 columns is
overly long/verbose identifiers.
If you really want to clean up the code here,
the P90211ENUM_ prefixes are a bit misleading
as they all are #define and not enums at all.
Quoted 57 lines · Joe Perches
Quoted 45 lines · Maksymilian Piechota
Quoted 44 lines · Joe Perches
Quoted 10 lines · Greg Kroah-Hartman
Quoted 9 lines · Maksymilian Piechota
This patch fixes the checkpatch.pl warning:
WARNING: Statements should start on a tabstop
Signed-off-by Maksymilian Piechota <[email protected]>--- drivers/staging/wlan-ng/prism2mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 16 lines
drivers/staging/wlan-ng/prism2mgmt.c int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) · line 1314
Quoted 13 lines
drivers/staging/wlan-ng/prism2mgmt.c +1
-1@@ -1308,7 +1308,7 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) hw->sniffhdr =0 ; wlandev->netdev->type =ARPHRD_IEEE80211_PRISM ; }else -if ((msg->wlanheader.status == +if ((msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok) && (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr =1 ;Hm, this all doesn't look correct now, does it? Please fix up the whole if statement here.
Ideally, it'd look something like:
/* Set the driver state */ /* Do we want the prism2 header? */ if (msg->prismheader.status == P80211ENUM_msgitem_status_data_ok && msg->prismheader.data == P80211ENUM_truth_true) { hw->sniffhdr = 0; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else if (msg->wlanheader.status == P80211ENUM_msgitem_status_data_ok && msg->wlanheader.data == P80211ENUM_truth_true) { hw->sniffhdr = 1; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else { wlandev->netdev->type = ARPHRD_IEEE80211; }Quoted 8 lines
Quoted 4 lines
with the unnecessary parentheses removed,
the logical continuations at the end-of-line,
and the else if on a single line.I must admit it looks better, but this way we get 2 warnings instead of 1 (before my changes). What is the policy? Can we ignore more warnings in order to get cleaner code?
Yes please.
Quoted 9 lines
checkpatch is just a guide, it's brainless.
The reason these lines are > 80 columns is
overly long/verbose identifiers.If you really want to clean up the code here,
theP90211ENUM_prefixes are a bit misleading
as they all are #define and not enums at all.
But would you like me to remove this prefixes for all of the enums from p80211types.h? Are you sure it won't cause any symbol conflicts?
Quoted 6 lines · Maksymilian Piechota
Quoted 5 lines · Joe Perches
checkpatch is just a guide, it's brainless.
The reason these lines are > 80 columns is
overly long/verbose identifiers.
Quoted 6 lines
Quoted 4 lines
If you really want to clean up the code here,
theP90211ENUM_prefixes are a bit misleading
as they all are #define and not enums at all.But would you like me to remove this prefixes for all of the enums from
p80211types.h? Are you sure it won't cause any symbol conflicts?
No, I don't want that, I'd prefer you think about it.
Also, a useful effort would be to (from the README)
TODO:
[]
- move to use the in-kernel wireless stack
where most all of the P80211 code would be removed.
Anyway, sure, use checkpatch as a tool to help when learning the process of how to submit patches properly. Then move on to more thoroughly understand a block of code in the kernel that can be improved with cleaner style and logic and bug fixes you could submit.
That's be much more appreciated than random 80 column fixups and strict checkpatch compliance done without a thorough understanding of the code.
In any case, welcome, hope you stick around.
Quoted 30 lines · Joe Perches
Quoted 6 lines · Maksymilian Piechota
Quoted 5 lines · Joe Perches
checkpatch is just a guide, it's brainless.
The reason these lines are > 80 columns is
overly long/verbose identifiers.Quoted 6 lines
Quoted 4 lines
If you really want to clean up the code here,
theP90211ENUM_prefixes are a bit misleading
as they all are #define and not enums at all.But would you like me to remove this prefixes for all of the enums from
p80211types.h? Are you sure it won't cause any symbol conflicts?No, I don't want that, I'd prefer you think about it.
Also, a useful effort would be to (from the README)
TODO:
[]- move to use the in-kernel wireless stack
where most all of the P80211 code would be removed.
Anyway, sure, use checkpatch as a tool to help when learning the process of how to submit patches properly. Then move on to more thoroughly understand a block of code in the kernel that can be improved with cleaner style and logic and bug fixes you could submit.
Quoted 5 lines
That's be much more appreciated than random 80 column fixups and strict checkpatch compliance done without a thorough understanding of the code.
In any case, welcome, hope you stick around.
It's clear that there are a lot more usefull patches than 80 column fix, but as you said, I learn how to submit patches and there is is constraint to submit only one checkpatch warning fix.
Many thanks for advice how to proceed. I will take a look at it when I finish Greg's tutorial.
Thank you, I hope to have a significant contribution to Linux Community.