2014-03-09 06:57:07

by Kalle Valo

[permalink] [raw]
Subject: [PATCH 0/6] ath6kl: fixing new checkpatch warnings

Hi,

this patchset fixes new checkpatch warnings which have appeared during the last
year or so.

---

Kalle Valo (6):
ath6kl: fix blank lines before and after braces
ath6kl: use braces on both arms of if statement
ath6kl: remove spaces before semicolon
ath6kl: remove unnecessary line continuations
ath6kl: remove a warning on a macro
ath6kl: update Kconfig descriptions


drivers/net/wireless/ath/ath6kl/Kconfig | 30 +++++++++++++++++++++------
drivers/net/wireless/ath/ath6kl/cfg80211.c | 9 ++++----
drivers/net/wireless/ath/ath6kl/core.c | 5 +++--
drivers/net/wireless/ath/ath6kl/debug.c | 14 ++++---------
drivers/net/wireless/ath/ath6kl/debug.h | 2 +-
drivers/net/wireless/ath/ath6kl/hif.c | 3 ---
drivers/net/wireless/ath/ath6kl/htc_mbox.c | 23 +++++----------------
drivers/net/wireless/ath/ath6kl/htc_pipe.c | 10 +--------
drivers/net/wireless/ath/ath6kl/init.c | 1 -
drivers/net/wireless/ath/ath6kl/main.c | 10 ++++-----
drivers/net/wireless/ath/ath6kl/sdio.c | 15 +++++---------
drivers/net/wireless/ath/ath6kl/target.h | 2 +-
drivers/net/wireless/ath/ath6kl/txrx.c | 31 ++++++++++++++++------------
drivers/net/wireless/ath/ath6kl/usb.c | 2 --
drivers/net/wireless/ath/ath6kl/wmi.c | 19 +++++++----------
drivers/net/wireless/ath/ath6kl/wmi.h | 1 -
16 files changed, 79 insertions(+), 98 deletions(-)



2014-03-09 06:57:29

by Kalle Valo

[permalink] [raw]
Subject: [PATCH 4/6] ath6kl: remove unnecessary line continuations

Fixes checkpatch warning:

WARNING: Avoid unnecessary line continuations

Signed-off-by: Kalle Valo <[email protected]>
---
drivers/net/wireless/ath/ath6kl/core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 4b46adb..e64e4c9 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -45,8 +45,9 @@ module_param(testmode, uint, 0644);
module_param(recovery_enable, uint, 0644);
module_param(heart_beat_poll, uint, 0644);
MODULE_PARM_DESC(recovery_enable, "Enable recovery from firmware error");
-MODULE_PARM_DESC(heart_beat_poll, "Enable fw error detection periodic" \
- "polling. This also specifies the polling interval in" \
+MODULE_PARM_DESC(heart_beat_poll,
+ "Enable fw error detection periodic"
+ "polling. This also specifies the polling interval in"
"msecs. Set reocvery_enable for this to be effective");

void ath6kl_core_tx_complete(struct ath6kl *ar, struct sk_buff *skb)


2014-03-09 06:57:39

by Kalle Valo

[permalink] [raw]
Subject: [PATCH 5/6] ath6kl: remove a warning on a macro

Fixes checkpatch warning:

WARNING: Single statement macros should not use a do {} while (0) loop

Signed-off-by: Kalle Valo <[email protected]>
---
drivers/net/wireless/ath/ath6kl/debug.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index 55c4064..10a89cf 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -798,12 +798,10 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
return -ENOMEM;

#define EPSTAT(name) \
- do { \
- len = print_endpoint_stat(target, buf, buf_len, len, \
- offsetof(struct htc_endpoint_stats, \
- name), \
- #name); \
- } while (0)
+ (len = print_endpoint_stat(target, buf, buf_len, len, \
+ offsetof(struct htc_endpoint_stats, \
+ name), \
+ #name))

EPSTAT(cred_low_indicate);
EPSTAT(tx_issued);


2014-03-12 08:47:36

by Jones Desougi

[permalink] [raw]
Subject: Re: [PATCH 2/6] ath6kl: use braces on both arms of if statement

That inverts the meaning of the condition though.


On 03/09/2014 10:42 PM, Joe Perches wrote:
...
> - if (bss == NULL) {
...
> - } else
> + if (!bss) {

if (bss) {

> ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "cfg80211 already has a bss\n");
> + return NULL;
> + }
...


2014-03-10 20:03:33

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 5/6] ath6kl: remove a warning on a macro

On Mon, 2014-03-10 at 19:29 +0200, Kalle Valo wrote:
> Joe Perches <[email protected]> writes:
> > On Sun, 2014-03-09 at 09:10 +0200, Kalle Valo wrote:
> >> I would need help with this checkpatch warning:
> > No idea what the warning is.
>
> Hmm, maybe I'll just disable the warning in my check script.
>
> >> > --- a/drivers/net/wireless/ath/ath6kl/debug.c
> >> > +++ b/drivers/net/wireless/ath/ath6kl/debug.c
> >> > @@ -798,12 +798,10 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
> >> > return -ENOMEM;
> >> >
> >> > #define EPSTAT(name) \
> >> > - do { \
> >> > - len = print_endpoint_stat(target, buf, buf_len, len, \
> >> > - offsetof(struct htc_endpoint_stats, \
> >> > - name), \
> >> > - #name); \
> >> > - } while (0)
> >> > + (len = print_endpoint_stat(target, buf, buf_len, len, \
> >> > + offsetof(struct htc_endpoint_stats, \
> >> > + name), \
> >> > + #name))
> >>
> >> I wasn't quite able to figure out what is the preferred style here. I
> >> don't see how the () style is any better, but checkpatch didn't complain
> >> at least.
> >
> > No idea what the preferred style is, but
> > I'd probably change the #define to
> >
> > #define EPSTAT(name) \
> > print_endpoint_stat(target, buf, buf_len, len, \
> > offsetof(struct htc_endpoint_stats, name), \
> > #name)
> >
> > and the uses to
> >
> > len = EPSTAT(whatever);
>
> The problem with this is that using of len as an argument is hidden but
> storing the result is visible. Maybe it's better that I just disable the
> warning for me and not worry about this.

Hey, it's your code, do what you think sensible.

But, I don't think that's the right thing to do.

It _is_ a single line macro and doesn't need
a do {} while (0) wrapper. It also doesn't
need extra parentheses either.

If you don't like the macro, you could always
expand it in-place or change the macro to avoid
passing len and only using the return value as
a +=.



2014-03-09 21:42:32

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/6] ath6kl: use braces on both arms of if statement

On Sun, 2014-03-09 at 08:57 +0200, Kalle Valo wrote:
> Fixes checkpatch warning:

Maybe better to check the bss value and return
early to save an indent level like:

---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 51 +++++++++++++++---------------
1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index c2c6f46..4c136e0 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -700,32 +700,33 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
bss = cfg80211_get_bss(ar->wiphy, chan, bssid,
vif->ssid, vif->ssid_len,
cap_mask, cap_val);
- if (bss == NULL) {
- /*
- * Since cfg80211 may not yet know about the BSS,
- * generate a partial entry until the first BSS info
- * event becomes available.
- *
- * Prepend SSID element since it is not included in the Beacon
- * IEs from the target.
- */
- ie = kmalloc(2 + vif->ssid_len + beacon_ie_len, GFP_KERNEL);
- if (ie == NULL)
- return NULL;
- ie[0] = WLAN_EID_SSID;
- ie[1] = vif->ssid_len;
- memcpy(ie + 2, vif->ssid, vif->ssid_len);
- memcpy(ie + 2 + vif->ssid_len, beacon_ie, beacon_ie_len);
- bss = cfg80211_inform_bss(ar->wiphy, chan,
- bssid, 0, cap_val, 100,
- ie, 2 + vif->ssid_len + beacon_ie_len,
- 0, GFP_KERNEL);
- if (bss)
- ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
- "added bss %pM to cfg80211\n", bssid);
- kfree(ie);
- } else
+ if (!bss) {
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "cfg80211 already has a bss\n");
+ return NULL;
+ }
+
+ /* Since cfg80211 may not yet know about the BSS, generate a
+ * partial entry until the first BSS info event becomes available.
+ *
+ * Prepend SSID element since it is not included in the Beacon
+ * IEs from the target.
+ */
+ ie = kmalloc(2 + vif->ssid_len + beacon_ie_len, GFP_KERNEL);
+ if (!ie)
+ return NULL;
+
+ ie[0] = WLAN_EID_SSID;
+ ie[1] = vif->ssid_len;
+ memcpy(ie + 2, vif->ssid, vif->ssid_len);
+ memcpy(ie + 2 + vif->ssid_len, beacon_ie, beacon_ie_len);
+ bss = cfg80211_inform_bss(ar->wiphy, chan, bssid, 0, cap_val, 100,
+ ie, 2 + vif->ssid_len + beacon_ie_len,
+ 0, GFP_KERNEL);
+ if (bss)
+ ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "added bss %pM to cfg80211\n",
+ bssid);
+
+ kfree(ie);

return bss;
}



2014-03-12 14:11:28

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/6] ath6kl: use braces on both arms of if statement

On Wed, 2014-03-12 at 10:52 +0200, Kalle Valo wrote:
> Jones Desougi <[email protected]> writes:
> > That inverts the meaning of the condition though.
> > On 03/09/2014 10:42 PM, Joe Perches wrote:
> > ...
> >> - if (bss == NULL) {
> > ...
> >> - } else
> >> + if (!bss) {
> > if (bss) {
> Yeah, that was buggy. Thanks for pointing it out.

Yes, I stuffed that one up.
And Jones, thanks for noticing.



2014-03-09 07:20:12

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 5/6] ath6kl: remove a warning on a macro

On Sun, 2014-03-09 at 09:10 +0200, Kalle Valo wrote:
> Hi Joe,

Hi Kalle.

> I would need help with this checkpatch warning:

No idea what the warning is.

> > --- a/drivers/net/wireless/ath/ath6kl/debug.c
> > +++ b/drivers/net/wireless/ath/ath6kl/debug.c
> > @@ -798,12 +798,10 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
> > return -ENOMEM;
> >
> > #define EPSTAT(name) \
> > - do { \
> > - len = print_endpoint_stat(target, buf, buf_len, len, \
> > - offsetof(struct htc_endpoint_stats, \
> > - name), \
> > - #name); \
> > - } while (0)
> > + (len = print_endpoint_stat(target, buf, buf_len, len, \
> > + offsetof(struct htc_endpoint_stats, \
> > + name), \
> > + #name))
>
> I wasn't quite able to figure out what is the preferred style here. I
> don't see how the () style is any better, but checkpatch didn't complain
> at least.

No idea what the preferred style is, but
I'd probably change the #define to

#define EPSTAT(name) \
print_endpoint_stat(target, buf, buf_len, len, \
offsetof(struct htc_endpoint_stats, name), \
#name)

and the uses to

len = EPSTAT(whatever);



2014-03-09 21:15:37

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 4/6] ath6kl: remove unnecessary line continuations

On Sun, 2014-03-09 at 08:57 +0200, Kalle Valo wrote:
> Fixes checkpatch warning:
> WARNING: Avoid unnecessary line continuations
> Signed-off-by: Kalle Valo <[email protected]>
[]
> diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
[]
> @@ -45,8 +45,9 @@ module_param(testmode, uint, 0644);
> module_param(recovery_enable, uint, 0644);
> module_param(heart_beat_poll, uint, 0644);
> MODULE_PARM_DESC(recovery_enable, "Enable recovery from firmware error");
> -MODULE_PARM_DESC(heart_beat_poll, "Enable fw error detection periodic" \
> - "polling. This also specifies the polling interval in" \
> +MODULE_PARM_DESC(heart_beat_poll,
> + "Enable fw error detection periodic"
> + "polling. This also specifies the polling interval in"
> "msecs. Set reocvery_enable for this to be effective");

Couple things:

o There's a missing space between periodic and polling
o There's a typo of recovery

My suggestion would be to use:

MODULE_PARM_DESC(heart_beat_poll,
"Enable fw error detection periodic polling in msecs - Also set recovery_enable for this to be effective");



2014-03-10 17:23:07

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 2/6] ath6kl: use braces on both arms of if statement

Joe Perches <[email protected]> writes:

> On Sun, 2014-03-09 at 08:57 +0200, Kalle Valo wrote:
>> Fixes checkpatch warning:
>
> Maybe better to check the bss value and return
> early to save an indent level like:

Yeah, this is better. I'll send a patch to do that.

--
Kalle Valo

2014-03-09 06:57:24

by Kalle Valo

[permalink] [raw]
Subject: [PATCH 3/6] ath6kl: remove spaces before semicolon

Fixes checkpatch warning:

CHECK: space prohibited before semicolon

Signed-off-by: Kalle Valo <[email protected]>
---
drivers/net/wireless/ath/ath6kl/target.h | 2 +-
drivers/net/wireless/ath/ath6kl/txrx.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h
index a580a62..d5eeeae 100644
--- a/drivers/net/wireless/ath/ath6kl/target.h
+++ b/drivers/net/wireless/ath/ath6kl/target.h
@@ -289,7 +289,7 @@ struct host_interest {
u32 hi_hp_rx_traffic_ratio; /* 0xd8 */

/* test applications flags */
- u32 hi_test_apps_related ; /* 0xdc */
+ u32 hi_test_apps_related; /* 0xdc */
/* location of test script */
u32 hi_ota_testscript; /* 0xe0 */
/* location of CAL data */
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index e9c28a7..40432fe 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -361,7 +361,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
struct ath6kl_vif *vif = netdev_priv(dev);
u32 map_no = 0;
u16 htc_tag = ATH6KL_DATA_PKT_TAG;
- u8 ac = 99 ; /* initialize to unmapped ac */
+ u8 ac = 99; /* initialize to unmapped ac */
bool chk_adhoc_ps_mapping = false;
int ret;
struct wmi_tx_meta_v2 meta_v2;
@@ -1214,7 +1214,7 @@ static bool aggr_process_recv_frm(struct aggr_info_conn *agg_conn, u8 tid,
return is_queued;

spin_lock_bh(&rxtid->lock);
- for (idx = 0 ; idx < rxtid->hold_q_sz; idx++) {
+ for (idx = 0; idx < rxtid->hold_q_sz; idx++) {
if (rxtid->hold_q[idx].skb) {
/*
* There is a frame in the queue and no


2014-03-09 07:10:56

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 5/6] ath6kl: remove a warning on a macro

Hi Joe,

Kalle Valo <[email protected]> writes:

> Fixes checkpatch warning:
>
> WARNING: Single statement macros should not use a do {} while (0) loop

I would need help with this checkpatch warning:

> --- a/drivers/net/wireless/ath/ath6kl/debug.c
> +++ b/drivers/net/wireless/ath/ath6kl/debug.c
> @@ -798,12 +798,10 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
> return -ENOMEM;
>
> #define EPSTAT(name) \
> - do { \
> - len = print_endpoint_stat(target, buf, buf_len, len, \
> - offsetof(struct htc_endpoint_stats, \
> - name), \
> - #name); \
> - } while (0)
> + (len = print_endpoint_stat(target, buf, buf_len, len, \
> + offsetof(struct htc_endpoint_stats, \
> + name), \
> + #name))

I wasn't quite able to figure out what is the preferred style here. I
don't see how the () style is any better, but checkpatch didn't complain
at least.

--
Kalle Valo

2014-03-10 17:29:47

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 5/6] ath6kl: remove a warning on a macro

Joe Perches <[email protected]> writes:

> On Sun, 2014-03-09 at 09:10 +0200, Kalle Valo wrote:
>
>> I would need help with this checkpatch warning:
>
> No idea what the warning is.

Hmm, maybe I'll just disable the warning in my check script.

>> > --- a/drivers/net/wireless/ath/ath6kl/debug.c
>> > +++ b/drivers/net/wireless/ath/ath6kl/debug.c
>> > @@ -798,12 +798,10 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
>> > return -ENOMEM;
>> >
>> > #define EPSTAT(name) \
>> > - do { \
>> > - len = print_endpoint_stat(target, buf, buf_len, len, \
>> > - offsetof(struct htc_endpoint_stats, \
>> > - name), \
>> > - #name); \
>> > - } while (0)
>> > + (len = print_endpoint_stat(target, buf, buf_len, len, \
>> > + offsetof(struct htc_endpoint_stats, \
>> > + name), \
>> > + #name))
>>
>> I wasn't quite able to figure out what is the preferred style here. I
>> don't see how the () style is any better, but checkpatch didn't complain
>> at least.
>
> No idea what the preferred style is, but
> I'd probably change the #define to
>
> #define EPSTAT(name) \
> print_endpoint_stat(target, buf, buf_len, len, \
> offsetof(struct htc_endpoint_stats, name), \
> #name)
>
> and the uses to
>
> len = EPSTAT(whatever);

The problem with this is that using of len as an argument is hidden but
storing the result is visible. Maybe it's better that I just disable the
warning for me and not worry about this.

--
Kalle Valo

2014-03-10 17:27:43

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 4/6] ath6kl: remove unnecessary line continuations

Joe Perches <[email protected]> writes:

> On Sun, 2014-03-09 at 08:57 +0200, Kalle Valo wrote:
>> Fixes checkpatch warning:
>> WARNING: Avoid unnecessary line continuations
>> Signed-off-by: Kalle Valo <[email protected]>
> []
>> diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
> []
>> @@ -45,8 +45,9 @@ module_param(testmode, uint, 0644);
>> module_param(recovery_enable, uint, 0644);
>> module_param(heart_beat_poll, uint, 0644);
>> MODULE_PARM_DESC(recovery_enable, "Enable recovery from firmware error");
>> -MODULE_PARM_DESC(heart_beat_poll, "Enable fw error detection periodic" \
>> - "polling. This also specifies the polling interval in" \
>> +MODULE_PARM_DESC(heart_beat_poll,
>> + "Enable fw error detection periodic"
>> + "polling. This also specifies the polling interval in"
>> "msecs. Set reocvery_enable for this to be effective");
>
> Couple things:
>
> o There's a missing space between periodic and polling
> o There's a typo of recovery
>
> My suggestion would be to use:
>
> MODULE_PARM_DESC(heart_beat_poll,
> "Enable fw error detection periodic polling in msecs - Also set recovery_enable for this to be effective");

Thanks, I changed it to that.

--
Kalle Valo

2014-03-09 07:44:27

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 5/6] ath6kl: remove a warning on a macro

On Sat, 2014-03-08 at 23:20 -0800, Joe Perches wrote:
> On Sun, 2014-03-09 at 09:10 +0200, Kalle Valo wrote:
> > Hi Joe,
>
> Hi Kalle.
>
> > I would need help with this checkpatch warning:
>
> No idea what the warning is.
>
> > > --- a/drivers/net/wireless/ath/ath6kl/debug.c
> > > +++ b/drivers/net/wireless/ath/ath6kl/debug.c
> > > @@ -798,12 +798,10 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
> > > return -ENOMEM;
> > >
> > > #define EPSTAT(name) \
> > > - do { \
> > > - len = print_endpoint_stat(target, buf, buf_len, len, \
> > > - offsetof(struct htc_endpoint_stats, \
> > > - name), \
> > > - #name); \
> > > - } while (0)
> > > + (len = print_endpoint_stat(target, buf, buf_len, len, \
> > > + offsetof(struct htc_endpoint_stats, \
> > > + name), \
> > > + #name))
> >
> > I wasn't quite able to figure out what is the preferred style here. I
> > don't see how the () style is any better, but checkpatch didn't complain
> > at least.
>
> No idea what the preferred style is, but
> I'd probably change the #define to
>
> #define EPSTAT(name) \
> print_endpoint_stat(target, buf, buf_len, len, \
> offsetof(struct htc_endpoint_stats, name), \
> #name)
>
> and the uses to
>
> len = EPSTAT(whatever);

Or maybe this:

drivers/net/wireless/ath/ath6kl/debug.c | 62 ++++++++++++++++-----------------
1 file changed, 30 insertions(+), 32 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index dbfd17d..7a6b476 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -771,16 +771,17 @@ static unsigned int print_endpoint_stat(struct htc_target *target, char *buf,
int i;
struct htc_endpoint_stats *ep_st;
u32 *counter;
+ unsigned int nlen = len;

- len += scnprintf(buf + len, buf_len - len, "%s:", name);
+ nlen += scnprintf(buf + nlen, buf_len - nlen, "%s:", name);
for (i = 0; i < ENDPOINT_MAX; i++) {
ep_st = &target->endpoint[i].ep_st;
counter = ((u32 *) ep_st) + (offset / 4);
- len += scnprintf(buf + len, buf_len - len, " %u", *counter);
+ nlen += scnprintf(buf + nlen, buf_len - nlen, " %u", *counter);
}
- len += scnprintf(buf + len, buf_len - len, "\n");
+ nlen += scnprintf(buf + nlen, buf_len - nlen, "\n");

- return len;
+ return nlen - len;
}

static ssize_t ath6kl_endpoint_stats_read(struct file *file,
@@ -800,34 +801,31 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
return -ENOMEM;

#define EPSTAT(name) \
- do { \
- len = print_endpoint_stat(target, buf, buf_len, len, \
- offsetof(struct htc_endpoint_stats, \
- name), \
- #name); \
- } while (0)
-
- EPSTAT(cred_low_indicate);
- EPSTAT(tx_issued);
- EPSTAT(tx_pkt_bundled);
- EPSTAT(tx_bundles);
- EPSTAT(tx_dropped);
- EPSTAT(tx_cred_rpt);
- EPSTAT(cred_rpt_from_rx);
- EPSTAT(cred_rpt_from_other);
- EPSTAT(cred_rpt_ep0);
- EPSTAT(cred_from_rx);
- EPSTAT(cred_from_other);
- EPSTAT(cred_from_ep0);
- EPSTAT(cred_cosumd);
- EPSTAT(cred_retnd);
- EPSTAT(rx_pkts);
- EPSTAT(rx_lkahds);
- EPSTAT(rx_bundl);
- EPSTAT(rx_bundle_lkahd);
- EPSTAT(rx_bundle_from_hdr);
- EPSTAT(rx_alloc_thresh_hit);
- EPSTAT(rxalloc_thresh_byte);
+ print_endpoint_stat(target, buf, buf_len, len, \
+ offsetof(struct htc_endpoint_stats, name), \
+ #name)
+
+ len += EPSTAT(cred_low_indicate);
+ len += EPSTAT(tx_issued);
+ len += EPSTAT(tx_pkt_bundled);
+ len += EPSTAT(tx_bundles);
+ len += EPSTAT(tx_dropped);
+ len += EPSTAT(tx_cred_rpt);
+ len += EPSTAT(cred_rpt_from_rx);
+ len += EPSTAT(cred_rpt_from_other);
+ len += EPSTAT(cred_rpt_ep0);
+ len += EPSTAT(cred_from_rx);
+ len += EPSTAT(cred_from_other);
+ len += EPSTAT(cred_from_ep0);
+ len += EPSTAT(cred_cosumd);
+ len += EPSTAT(cred_retnd);
+ len += EPSTAT(rx_pkts);
+ len += EPSTAT(rx_lkahds);
+ len += EPSTAT(rx_bundl);
+ len += EPSTAT(rx_bundle_lkahd);
+ len += EPSTAT(rx_bundle_from_hdr);
+ len += EPSTAT(rx_alloc_thresh_hit);
+ len += EPSTAT(rxalloc_thresh_byte);
#undef EPSTAT

if (len > buf_len)



2014-03-09 06:57:18

by Kalle Valo

[permalink] [raw]
Subject: [PATCH 2/6] ath6kl: use braces on both arms of if statement

Fixes checkpatch warning:

CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Kalle Valo <[email protected]>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 ++++--
drivers/net/wireless/ath/ath6kl/htc_mbox.c | 11 ++++++-----
drivers/net/wireless/ath/ath6kl/main.c | 6 ++++--
drivers/net/wireless/ath/ath6kl/sdio.c | 11 ++++++-----
drivers/net/wireless/ath/ath6kl/txrx.c | 24 ++++++++++++++++--------
drivers/net/wireless/ath/ath6kl/wmi.c | 13 ++++++++-----
6 files changed, 44 insertions(+), 27 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 9e3af81..0928508 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -724,8 +724,9 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
"added bss %pM to cfg80211\n", bssid);
kfree(ie);
- } else
+ } else {
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "cfg80211 already has a bss\n");
+ }

return bss;
}
@@ -2848,8 +2849,9 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
if (p.prwise_crypto_type == 0) {
p.prwise_crypto_type = NONE_CRYPT;
ath6kl_set_cipher(vif, 0, true);
- } else if (info->crypto.n_ciphers_pairwise == 1)
+ } else if (info->crypto.n_ciphers_pairwise == 1) {
ath6kl_set_cipher(vif, info->crypto.ciphers_pairwise[0], true);
+ }

switch (info->crypto.cipher_group) {
case WLAN_CIPHER_SUITE_WEP40:
diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
index 1d713dc..e481f14 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
@@ -112,9 +112,9 @@ static void ath6kl_credit_init(struct ath6kl_htc_credit_info *cred_info,
if (cur_ep_dist->endpoint == ENDPOINT_0)
continue;

- if (cur_ep_dist->svc_id == WMI_CONTROL_SVC)
+ if (cur_ep_dist->svc_id == WMI_CONTROL_SVC) {
cur_ep_dist->cred_norm = cur_ep_dist->cred_per_msg;
- else {
+ } else {
/*
* For the remaining data endpoints, we assume that
* each cred_per_msg are the same. We use a simple
@@ -1418,9 +1418,9 @@ static int ath6kl_htc_rx_setup(struct htc_target *target,
}
}

- if (list_empty(&ep->rx_bufq))
+ if (list_empty(&ep->rx_bufq)) {
packet = NULL;
- else {
+ } else {
packet = list_first_entry(&ep->rx_bufq,
struct htc_packet, list);
list_del(&packet->list);
@@ -2813,8 +2813,9 @@ static int ath6kl_htc_reset(struct htc_target *target)
packet->buf = packet->buf_start;
packet->endpoint = ENDPOINT_0;
list_add_tail(&packet->list, &target->free_ctrl_rxbuf);
- } else
+ } else {
list_add_tail(&packet->list, &target->free_ctrl_txbuf);
+ }
}

return 0;
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index fcaab0f..d565546 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -690,8 +690,9 @@ void ath6kl_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid, bool ismcast)
cfg80211_michael_mic_failure(vif->ndev, sta->mac,
NL80211_KEYTYPE_PAIRWISE, keyid,
tsc, GFP_KERNEL);
- } else
+ } else {
ath6kl_cfg80211_tkip_micerr_event(vif, keyid, ismcast);
+ }
}

static void ath6kl_update_target_stats(struct ath6kl_vif *vif, u8 *ptr, u32 len)
@@ -1090,8 +1091,9 @@ static int ath6kl_open(struct net_device *dev)
if (test_bit(CONNECTED, &vif->flags)) {
netif_carrier_on(dev);
netif_wake_queue(dev);
- } else
+ } else {
netif_carrier_off(dev);
+ }

return 0;
}
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 9c73b62..a3bca39 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -425,8 +425,9 @@ static int ath6kl_sdio_read_write_sync(struct ath6kl *ar, u32 addr, u8 *buf,
memcpy(tbuf, buf, len);

bounced = true;
- } else
+ } else {
tbuf = buf;
+ }

ret = ath6kl_sdio_io(ar_sdio->func, request, addr, tbuf, len);
if ((request & HIF_READ) && bounced)
@@ -441,9 +442,9 @@ static int ath6kl_sdio_read_write_sync(struct ath6kl *ar, u32 addr, u8 *buf,
static void __ath6kl_sdio_write_async(struct ath6kl_sdio *ar_sdio,
struct bus_request *req)
{
- if (req->scat_req)
+ if (req->scat_req) {
ath6kl_sdio_scat_rw(ar_sdio, req);
- else {
+ } else {
void *context;
int status;

@@ -673,9 +674,9 @@ static int ath6kl_sdio_async_rw_scatter(struct ath6kl *ar,
"hif-scatter: total len: %d scatter entries: %d\n",
scat_req->len, scat_req->scat_entries);

- if (request & HIF_SYNCHRONOUS)
+ if (request & HIF_SYNCHRONOUS) {
status = ath6kl_sdio_scat_rw(ar_sdio, scat_req->busrequest);
- else {
+ } else {
spin_lock_bh(&ar_sdio->wr_async_lock);
list_add_tail(&scat_req->busrequest->list, &ar_sdio->wr_asyncq);
spin_unlock_bh(&ar_sdio->wr_async_lock);
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index cf27a71..e9c28a7 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -125,8 +125,9 @@ static bool ath6kl_process_uapsdq(struct ath6kl_sta *conn,
*flags |= WMI_DATA_HDR_FLAGS_UAPSD;
spin_unlock_bh(&conn->psq_lock);
return false;
- } else if (!conn->apsd_info)
+ } else if (!conn->apsd_info) {
return false;
+ }

if (test_bit(WMM_ENABLED, &vif->flags)) {
ether_type = be16_to_cpu(datap->h_proto);
@@ -316,8 +317,9 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb,
cookie = NULL;
ath6kl_err("wmi ctrl ep full, dropping pkt : 0x%p, len:%d\n",
skb, skb->len);
- } else
+ } else {
cookie = ath6kl_alloc_cookie(ar);
+ }

if (cookie == NULL) {
spin_unlock_bh(&ar->lock);
@@ -449,8 +451,9 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
if (ret)
goto fail_tx;
}
- } else
+ } else {
goto fail_tx;
+ }

spin_lock_bh(&ar->lock);

@@ -1088,8 +1091,9 @@ static void aggr_deque_frms(struct aggr_info_conn *agg_conn, u8 tid,
else
skb_queue_tail(&rxtid->q, node->skb);
node->skb = NULL;
- } else
+ } else {
stats->num_hole++;
+ }

rxtid->seq_next = ATH6KL_NEXT_SEQ_NO(rxtid->seq_next);
idx = AGGR_WIN_IDX(rxtid->seq_next, rxtid->hold_q_sz);
@@ -1604,16 +1608,18 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
if (!conn)
return;
aggr_conn = conn->aggr_conn;
- } else
+ } else {
aggr_conn = vif->aggr_cntxt->aggr_conn;
+ }

if (aggr_process_recv_frm(aggr_conn, tid, seq_no,
is_amsdu, skb)) {
/* aggregation code will handle the skb */
return;
}
- } else if (!is_broadcast_ether_addr(datap->h_dest))
+ } else if (!is_broadcast_ether_addr(datap->h_dest)) {
vif->net_stats.multicast++;
+ }

ath6kl_deliver_frames_to_nw_stack(vif->ndev, skb);
}
@@ -1708,8 +1714,9 @@ void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid_mux, u16 seq_no,
sta = ath6kl_find_sta_by_aid(vif->ar, aid);
if (sta)
aggr_conn = sta->aggr_conn;
- } else
+ } else {
aggr_conn = vif->aggr_cntxt->aggr_conn;
+ }

if (!aggr_conn)
return;
@@ -1803,8 +1810,9 @@ void aggr_recv_delba_req_evt(struct ath6kl_vif *vif, u8 tid_mux)
sta = ath6kl_find_sta_by_aid(vif->ar, aid);
if (sta)
aggr_conn = sta->aggr_conn;
- } else
+ } else {
aggr_conn = vif->aggr_cntxt->aggr_conn;
+ }

if (!aggr_conn)
return;
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 34c4954..0c0e1e3 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -289,8 +289,9 @@ int ath6kl_wmi_implicit_create_pstream(struct wmi *wmi, u8 if_idx,
ath6kl_wmi_determine_user_priority(((u8 *) llc_hdr) +
sizeof(struct ath6kl_llc_snap_hdr),
layer2_priority);
- } else
+ } else {
usr_pri = layer2_priority & 0x7;
+ }

/*
* Queue the EAPOL frames in the same WMM_AC_VO queue
@@ -359,8 +360,9 @@ int ath6kl_wmi_dot11_hdr_remove(struct wmi *wmi, struct sk_buff *skb)
hdr_size = roundup(sizeof(struct ieee80211_qos_hdr),
sizeof(u32));
skb_pull(skb, hdr_size);
- } else if (sub_type == cpu_to_le16(IEEE80211_STYPE_DATA))
+ } else if (sub_type == cpu_to_le16(IEEE80211_STYPE_DATA)) {
skb_pull(skb, sizeof(struct ieee80211_hdr_3addr));
+ }

datap = skb->data;
llc_hdr = (struct ath6kl_llc_snap_hdr *)(datap);
@@ -945,9 +947,9 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
ev = (struct ath6kl_wmi_regdomain *) datap;
reg_code = le32_to_cpu(ev->reg_code);

- if ((reg_code >> ATH6KL_COUNTRY_RD_SHIFT) & COUNTRY_ERD_FLAG)
+ if ((reg_code >> ATH6KL_COUNTRY_RD_SHIFT) & COUNTRY_ERD_FLAG) {
country = ath6kl_regd_find_country((u16) reg_code);
- else if (!(((u16) reg_code & WORLD_SKU_MASK) == WORLD_SKU_PREFIX)) {
+ } else if (!(((u16) reg_code & WORLD_SKU_MASK) == WORLD_SKU_PREFIX)) {
regpair = ath6kl_get_regpair((u16) reg_code);
country = ath6kl_regd_find_country_by_rd((u16) reg_code);
if (regpair)
@@ -2864,8 +2866,9 @@ int ath6kl_wmi_set_host_sleep_mode_cmd(struct wmi *wmi, u8 if_idx,
if (host_mode == ATH6KL_HOST_MODE_ASLEEP) {
ath6kl_wmi_relinquish_implicit_pstream_credits(wmi);
cmd->asleep = cpu_to_le32(1);
- } else
+ } else {
cmd->awake = cpu_to_le32(1);
+ }

ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb,
WMI_SET_HOST_SLEEP_MODE_CMDID,


2014-03-12 08:52:20

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 2/6] ath6kl: use braces on both arms of if statement

Jones Desougi <[email protected]> writes:

> That inverts the meaning of the condition though.
>
>
> On 03/09/2014 10:42 PM, Joe Perches wrote:
> ...
>> - if (bss == NULL) {
> ...
>> - } else
>> + if (!bss) {
>
> if (bss) {

Yeah, that was buggy. Thanks for pointing it out.

--
Kalle Valo

2014-03-09 06:57:46

by Kalle Valo

[permalink] [raw]
Subject: [PATCH 6/6] ath6kl: update Kconfig descriptions

The help text were either out of date, too small or didn't exist at all. Also
move cfg80211 dependency to ath6kl_core module as it has all the calls to
cfg80211.

Fixes checkpatch warning:

WARNING: please write a paragraph that describes the config symbol fully

Signed-off-by: Kalle Valo <[email protected]>
---
drivers/net/wireless/ath/ath6kl/Kconfig | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/Kconfig b/drivers/net/wireless/ath/ath6kl/Kconfig
index e39e586..9c125ff 100644
--- a/drivers/net/wireless/ath/ath6kl/Kconfig
+++ b/drivers/net/wireless/ath/ath6kl/Kconfig
@@ -1,11 +1,19 @@
config ATH6KL
tristate "Atheros mobile chipsets support"
+ depends on CFG80211
+ ---help---
+ This module adds core support for wireless adapters based on
+ Atheros AR6003 and AR6004 chipsets. You still need separate
+ bus drivers for USB and SDIO to be able to use real devices.
+
+ If you choose to build it as a module, it will be called
+ ath6kl_core. Please note that AR6002 and AR6001 are not
+ supported by this driver.

config ATH6KL_SDIO
tristate "Atheros ath6kl SDIO support"
depends on ATH6KL
depends on MMC
- depends on CFG80211
---help---
This module adds support for wireless adapters based on
Atheros AR6003 and AR6004 chipsets running over SDIO. If you
@@ -17,25 +25,31 @@ config ATH6KL_USB
tristate "Atheros ath6kl USB support"
depends on ATH6KL
depends on USB
- depends on CFG80211
---help---
This module adds support for wireless adapters based on
- Atheros AR6004 chipset running over USB. This is still under
- implementation and it isn't functional. If you choose to
- build it as a module, it will be called ath6kl_usb.
+ Atheros AR6004 chipset and chipsets based on it running over
+ USB. If you choose to build it as a module, it will be
+ called ath6kl_usb.

config ATH6KL_DEBUG
bool "Atheros ath6kl debugging"
depends on ATH6KL
---help---
- Enables debug support
+ Enables ath6kl debug support, including debug messages
+ enabled with debug_mask module parameter and debugfs
+ interface.
+
+ If unsure, say Y to make it easier to debug problems.

config ATH6KL_TRACING
bool "Atheros ath6kl tracing support"
depends on ATH6KL
depends on EVENT_TRACING
---help---
- Select this to ath6kl use tracing infrastructure.
+ Select this to ath6kl use tracing infrastructure which, for
+ example, can be enabled with help of trace-cmd. All debug
+ messages and commands are delivered to using individually
+ enablable trace points.

If unsure, say Y to make it easier to debug problems.

@@ -47,3 +61,5 @@ config ATH6KL_REGDOMAIN
Enabling this makes it possible to change the regdomain in
the firmware. This can be only enabled if regulatory requirements
are taken into account.
+
+ If unsure, say N.


2014-03-09 06:57:13

by Kalle Valo

[permalink] [raw]
Subject: [PATCH 1/6] ath6kl: fix blank lines before and after braces

Fixes checkpatch warnings:

CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Kalle Valo <[email protected]>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 ---
drivers/net/wireless/ath/ath6kl/debug.c | 4 ----
drivers/net/wireless/ath/ath6kl/debug.h | 2 +-
drivers/net/wireless/ath/ath6kl/hif.c | 3 ---
drivers/net/wireless/ath/ath6kl/htc_mbox.c | 12 ------------
drivers/net/wireless/ath/ath6kl/htc_pipe.c | 10 +---------
drivers/net/wireless/ath/ath6kl/init.c | 1 -
drivers/net/wireless/ath/ath6kl/main.c | 4 ----
drivers/net/wireless/ath/ath6kl/sdio.c | 4 ----
drivers/net/wireless/ath/ath6kl/txrx.c | 3 ---
drivers/net/wireless/ath/ath6kl/usb.c | 2 --
drivers/net/wireless/ath/ath6kl/wmi.c | 6 ------
drivers/net/wireless/ath/ath6kl/wmi.h | 1 -
13 files changed, 2 insertions(+), 53 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index c2c6f46..9e3af81 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -970,7 +970,6 @@ static int ath6kl_set_probed_ssids(struct ath6kl *ar,
ssid_list[i].flag,
ssid_list[i].ssid.ssid_len,
ssid_list[i].ssid.ssid);
-
}

/* Make sure no old entries are left behind */
@@ -1897,7 +1896,6 @@ static int ath6kl_wow_usr(struct ath6kl *ar, struct ath6kl_vif *vif,

/* Configure the patterns that we received from the user. */
for (i = 0; i < wow->n_patterns; i++) {
-
/*
* Convert given nl80211 specific mask value to equivalent
* driver specific mask value and send it to the chip along
@@ -2897,7 +2895,6 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
}

if (info->inactivity_timeout) {
-
inactivity_timeout = info->inactivity_timeout;

if (ar->hw.flags & ATH6KL_HW_AP_INACTIVITY_MINS)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index dbfd17d..55c4064 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -172,7 +172,6 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
struct ath6kl_irq_proc_registers *irq_proc_reg,
struct ath6kl_irq_enable_reg *irq_enable_reg)
{
-
ath6kl_dbg(ATH6KL_DBG_IRQ, ("<------- Register Table -------->\n"));

if (irq_proc_reg != NULL) {
@@ -219,7 +218,6 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
"GMBOX lookahead alias 1: 0x%x\n",
irq_proc_reg->rx_gmbox_lkahd_alias[1]);
}
-
}

if (irq_enable_reg != NULL) {
@@ -1396,7 +1394,6 @@ static ssize_t ath6kl_create_qos_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
-
struct ath6kl *ar = file->private_data;
struct ath6kl_vif *vif;
char buf[200];
@@ -1575,7 +1572,6 @@ static ssize_t ath6kl_delete_qos_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
-
struct ath6kl *ar = file->private_data;
struct ath6kl_vif *vif;
char buf[100];
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index ca9ba00..e194c10d 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -97,8 +97,8 @@ static inline void ath6kl_dump_registers(struct ath6kl_device *dev,
struct ath6kl_irq_proc_registers *irq_proc_reg,
struct ath6kl_irq_enable_reg *irq_en_reg)
{
-
}
+
static inline void dump_cred_dist_stats(struct htc_target *target)
{
}
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index fea7709..18c0708 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -37,7 +37,6 @@ static int ath6kl_hif_cp_scat_dma_buf(struct hif_scatter_req *req,
buf = req->virt_dma_buf;

for (i = 0; i < req->scat_entries; i++) {
-
if (from_dma)
memcpy(req->scat_list[i].buf, buf,
req->scat_list[i].len);
@@ -116,7 +115,6 @@ static void ath6kl_hif_dump_fw_crash(struct ath6kl *ar)
le32_to_cpu(regdump_val[i + 2]),
le32_to_cpu(regdump_val[i + 3]));
}
-
}

static int ath6kl_hif_proc_dbg_intr(struct ath6kl_device *dev)
@@ -701,5 +699,4 @@ int ath6kl_hif_setup(struct ath6kl_device *dev)

fail_setup:
return status;
-
}
diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
index 65e5b71..1d713dc 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
@@ -129,7 +129,6 @@ static void ath6kl_credit_init(struct ath6kl_htc_credit_info *cred_info,
count = (count * 3) >> 2;
count = max(count, cur_ep_dist->cred_per_msg);
cur_ep_dist->cred_norm = count;
-
}

ath6kl_dbg(ATH6KL_DBG_CREDIT,
@@ -549,7 +548,6 @@ static int htc_check_credits(struct htc_target *target,
enum htc_endpoint_id eid, unsigned int len,
int *req_cred)
{
-
*req_cred = (len > target->tgt_cred_sz) ?
DIV_ROUND_UP(len, target->tgt_cred_sz) : 1;

@@ -608,7 +606,6 @@ static void ath6kl_htc_tx_pkts_get(struct htc_target *target,
unsigned int len;

while (true) {
-
flags = 0;

if (list_empty(&endpoint->txq))
@@ -889,7 +886,6 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
ac = target->dev->ar->ep2ac_map[endpoint->eid];

while (true) {
-
if (list_empty(&endpoint->txq))
break;

@@ -1190,7 +1186,6 @@ static void ath6kl_htc_mbox_flush_txep(struct htc_target *target,
list_add_tail(&packet->list, &container);
htc_tx_complete(endpoint, &container);
}
-
}

static void ath6kl_htc_flush_txep_all(struct htc_target *target)
@@ -1394,7 +1389,6 @@ static int ath6kl_htc_rx_setup(struct htc_target *target,

ep_cb = ep->ep_cb;
for (j = 0; j < n_msg; j++) {
-
/*
* Reset flag, any packets allocated using the
* rx_alloc() API cannot be recycled on
@@ -1487,7 +1481,6 @@ static int ath6kl_htc_rx_alloc(struct htc_target *target,
spin_lock_bh(&target->rx_lock);

for (i = 0; i < msg; i++) {
-
htc_hdr = (struct htc_frame_hdr *)&lk_ahds[i];

if (htc_hdr->eid >= ENDPOINT_MAX) {
@@ -1708,7 +1701,6 @@ static int htc_parse_trailer(struct htc_target *target,
lk_ahd = (struct htc_lookahead_report *) record_buf;
if ((lk_ahd->pre_valid == ((~lk_ahd->post_valid) & 0xFF)) &&
next_lk_ahds) {
-
ath6kl_dbg(ATH6KL_DBG_HTC,
"htc rx lk_ahd found pre_valid 0x%x post_valid 0x%x\n",
lk_ahd->pre_valid, lk_ahd->post_valid);
@@ -1755,7 +1747,6 @@ static int htc_parse_trailer(struct htc_target *target,
}

return 0;
-
}

static int htc_proc_trailer(struct htc_target *target,
@@ -1776,7 +1767,6 @@ static int htc_proc_trailer(struct htc_target *target,
status = 0;

while (len > 0) {
-
if (len < sizeof(struct htc_record_hdr)) {
status = -ENOMEM;
break;
@@ -2098,7 +2088,6 @@ static int ath6kl_htc_rx_fetch(struct htc_target *target,
}

if (!fetched_pkts) {
-
packet = list_first_entry(rx_pktq, struct htc_packet,
list);

@@ -2173,7 +2162,6 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target,
look_aheads[0] = msg_look_ahead;

while (true) {
-
/*
* First lookahead sets the expected endpoint IDs for all
* packets in a bundle.
diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
index 67aa924..756fe52 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c
@@ -137,7 +137,6 @@ static void get_htc_packet_credit_based(struct htc_target *target,
credits_required = 0;

} else {
-
if (ep->cred_dist.credits < credits_required)
break;

@@ -169,7 +168,6 @@ static void get_htc_packet_credit_based(struct htc_target *target,
/* queue this packet into the caller's queue */
list_add_tail(&packet->list, queue);
}
-
}

static void get_htc_packet(struct htc_target *target,
@@ -279,7 +277,6 @@ static int htc_issue_packets(struct htc_target *target,
list_add(&packet->list, pkt_queue);
break;
}
-
}

if (status != 0) {
@@ -385,7 +382,6 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target,
*/
list_for_each_entry_safe(packet, tmp_pkt,
txq, list) {
-
ath6kl_dbg(ATH6KL_DBG_HTC,
"%s: Indicat overflowed TX pkts: %p\n",
__func__, packet);
@@ -403,7 +399,6 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target,
list_move_tail(&packet->list,
&send_queue);
}
-
}

if (list_empty(&send_queue)) {
@@ -454,7 +449,6 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target,
* enough transmit resources.
*/
while (true) {
-
if (get_queue_depth(&ep->txq) == 0)
break;

@@ -495,8 +489,8 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target,
}

spin_lock_bh(&target->tx_lock);
-
}
+
/* done with this endpoint, we can clear the count */
ep->tx_proc_cnt = 0;
spin_unlock_bh(&target->tx_lock);
@@ -1106,7 +1100,6 @@ free_skb:
dev_kfree_skb(skb);

return status;
-
}

static void htc_flush_rx_queue(struct htc_target *target,
@@ -1258,7 +1251,6 @@ static int ath6kl_htc_pipe_conn_service(struct htc_target *target,
tx_alloc = 0;

} else {
-
tx_alloc = htc_get_credit_alloc(target, conn_req->svc_id);
if (tx_alloc == 0) {
status = -ENOMEM;
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 4f316bd..d5ef211 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1192,7 +1192,6 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)

if (board_ext_address &&
ar->fw_board_len == (board_data_size + board_ext_data_size)) {
-
/* write extended board data */
ath6kl_dbg(ATH6KL_DBG_BOOT,
"writing extended board data to 0x%x (%d B)\n",
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 5839fc2..fcaab0f 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -571,7 +571,6 @@ void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)

static int ath6kl_commit_ch_switch(struct ath6kl_vif *vif, u16 channel)
{
-
struct ath6kl *ar = vif->ar;

vif->profile.ch = cpu_to_le16(channel);
@@ -600,7 +599,6 @@ static int ath6kl_commit_ch_switch(struct ath6kl_vif *vif, u16 channel)

static void ath6kl_check_ch_switch(struct ath6kl *ar, u16 channel)
{
-
struct ath6kl_vif *vif;
int res = 0;

@@ -694,7 +692,6 @@ void ath6kl_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid, bool ismcast)
tsc, GFP_KERNEL);
} else
ath6kl_cfg80211_tkip_micerr_event(vif, keyid, ismcast);
-
}

static void ath6kl_update_target_stats(struct ath6kl_vif *vif, u8 *ptr, u32 len)
@@ -1146,7 +1143,6 @@ static int ath6kl_set_features(struct net_device *dev,
dev->features = features | NETIF_F_RXCSUM;
return err;
}
-
}

return err;
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 7126bdd..9c73b62 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -656,7 +656,6 @@ static void ath6kl_sdio_scatter_req_add(struct ath6kl *ar,
list_add_tail(&s_req->list, &ar_sdio->scat_req);

spin_unlock_bh(&ar_sdio->scat_lock);
-
}

/* scatter gather read write request */
@@ -856,7 +855,6 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow)

if (ar->suspend_mode == WLAN_POWER_STATE_WOW ||
(!ar->suspend_mode && wow)) {
-
ret = ath6kl_set_sdio_pm_caps(ar);
if (ret)
goto cut_pwr;
@@ -878,7 +876,6 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow)

if (ar->suspend_mode == WLAN_POWER_STATE_DEEP_SLEEP ||
!ar->suspend_mode || try_deepsleep) {
-
flags = sdio_get_host_pm_caps(func);
if (!(flags & MMC_PM_KEEP_POWER))
goto cut_pwr;
@@ -1061,7 +1058,6 @@ static int ath6kl_sdio_bmi_credits(struct ath6kl *ar)

timeout = jiffies + msecs_to_jiffies(BMI_COMMUNICATION_TIMEOUT);
while (time_before(jiffies, timeout) && !ar->bmi.cmd_credits) {
-
/*
* Hit the credit counter with a 4-byte access, the first byte
* read will hit the counter and cause a decrement, while the
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index ebb2404..cf27a71 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -702,7 +702,6 @@ void ath6kl_tx_complete(struct htc_target *target,

/* reap completed packets */
while (!list_empty(packet_queue)) {
-
packet = list_first_entry(packet_queue, struct htc_packet,
list);
list_del(&packet->list);
@@ -1265,7 +1264,6 @@ static void ath6kl_uapsd_trigger_frame_rx(struct ath6kl_vif *vif,
is_apsdq_empty_at_start = is_apsdq_empty;

while ((!is_apsdq_empty) && (num_frames_to_deliver)) {
-
spin_lock_bh(&conn->psq_lock);
skb = skb_dequeue(&conn->apsdq);
is_apsdq_empty = skb_queue_empty(&conn->apsdq);
@@ -1766,7 +1764,6 @@ void aggr_conn_init(struct ath6kl_vif *vif, struct aggr_info *aggr_info,
skb_queue_head_init(&rxtid->q);
spin_lock_init(&rxtid->lock);
}
-
}

struct aggr_info *aggr_init(struct ath6kl_vif *vif)
diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index 56c3fd5..3afc5a4 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -236,7 +236,6 @@ static void ath6kl_usb_free_pipe_resources(struct ath6kl_usb_pipe *pipe)
break;
kfree(urb_context);
}
-
}

static void ath6kl_usb_cleanup_pipe_resources(struct ath6kl_usb *ar_usb)
@@ -245,7 +244,6 @@ static void ath6kl_usb_cleanup_pipe_resources(struct ath6kl_usb *ar_usb)

for (i = 0; i < ATH6KL_USB_PIPE_MAX; i++)
ath6kl_usb_free_pipe_resources(&ar_usb->pipes[i]);
-
}

static u8 ath6kl_usb_get_logical_pipe_num(struct ath6kl_usb *ar_usb,
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 8b4ce28..34c4954 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -936,7 +936,6 @@ ath6kl_regd_find_country_by_rd(u16 regdmn)

static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
{
-
struct ath6kl_wmi_regdomain *ev;
struct country_code_to_enum_rd *country = NULL;
struct reg_dmn_pair_mapping *regpair = NULL;
@@ -949,7 +948,6 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
if ((reg_code >> ATH6KL_COUNTRY_RD_SHIFT) & COUNTRY_ERD_FLAG)
country = ath6kl_regd_find_country((u16) reg_code);
else if (!(((u16) reg_code & WORLD_SKU_MASK) == WORLD_SKU_PREFIX)) {
-
regpair = ath6kl_get_regpair((u16) reg_code);
country = ath6kl_regd_find_country_by_rd((u16) reg_code);
if (regpair)
@@ -1499,7 +1497,6 @@ static int ath6kl_wmi_cac_event_rx(struct wmi *wmi, u8 *datap, int len,

if ((reply->cac_indication == CAC_INDICATION_ADMISSION_RESP) &&
(reply->status_code != IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED)) {
-
ts = (struct ieee80211_tspec_ie *) &(reply->tspec_suggestion);
tsinfo = le16_to_cpu(ts->tsinfo);
tsid = (tsinfo >> IEEE80211_WMM_IE_TSPEC_TID_SHIFT) &
@@ -1530,7 +1527,6 @@ static int ath6kl_wmi_cac_event_rx(struct wmi *wmi, u8 *datap, int len,
* for delete qos stream from AP
*/
else if (reply->cac_indication == CAC_INDICATION_DELETE) {
-
ts = (struct ieee80211_tspec_ie *) &(reply->tspec_suggestion);
tsinfo = le16_to_cpu(ts->tsinfo);
ts_id = ((tsinfo >> IEEE80211_WMM_IE_TSPEC_TID_SHIFT) &
@@ -2479,7 +2475,6 @@ static int ath6kl_wmi_sync_point(struct wmi *wmi, u8 if_idx)
goto free_data_skb;

for (index = 0; index < num_pri_streams; index++) {
-
if (WARN_ON(!data_sync_bufs[index].skb))
goto free_data_skb;

@@ -2704,7 +2699,6 @@ static void ath6kl_wmi_relinquish_implicit_pstream_credits(struct wmi *wmi)

for (i = 0; i < WMM_NUM_AC; i++) {
if (stream_exist & (1 << i)) {
-
/*
* FIXME: Is this lock & unlock inside
* for loop correct? may need rework.
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index b5f2265..1f05ecd 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -898,7 +898,6 @@ struct wmi_start_scan_cmd {
* flags here
*/
enum wmi_scan_ctrl_flags_bits {
-
/* set if can scan in the connect cmd */
CONNECT_SCAN_CTRL_FLAGS = 0x01,



2014-03-13 05:48:53

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 0/6] ath6kl: fixing new checkpatch warnings

Kalle Valo <[email protected]> writes:

> this patchset fixes new checkpatch warnings which have appeared during the last
> year or so.
>
> ---
>
> Kalle Valo (6):
> ath6kl: fix blank lines before and after braces
> ath6kl: use braces on both arms of if statement
> ath6kl: remove spaces before semicolon
> ath6kl: remove unnecessary line continuations
> ath6kl: update Kconfig descriptions

These five patches applied.

> ath6kl: remove a warning on a macro

This patch dropped for now. Need to find a better solution.

--
Kalle Valo