All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@meshcoding.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH 1/5] ath: add common function ath_is_mybeacon
Date: Wed, 15 Jan 2014 17:10:29 +0100	[thread overview]
Message-ID: <52D6B2F5.4070404@meshcoding.com> (raw)
In-Reply-To: <1389802038-6688-2-git-send-email-linux@rempel-privat.de>

On 15/01/14 17:07, Oleksij Rempel wrote:
> this function is used by most ath driver, so it can be moved here.
> 
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
>  drivers/net/wireless/ath/ath.h  |  2 ++
>  drivers/net/wireless/ath/main.c | 11 +++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
> index e0ba7cd..b59cfbe 100644
> --- a/drivers/net/wireless/ath/ath.h
> +++ b/drivers/net/wireless/ath/ath.h
> @@ -17,6 +17,7 @@
>  #ifndef ATH_H
>  #define ATH_H
>  
> +#include <linux/etherdevice.h>
>  #include <linux/skbuff.h>
>  #include <linux/if_ether.h>
>  #include <linux/spinlock.h>
> @@ -165,6 +166,7 @@ struct ath_common {
>  struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
>  				u32 len,
>  				gfp_t gfp_mask);
> +bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr);
>  
>  void ath_hw_setbssidmask(struct ath_common *common);
>  void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key);
> diff --git a/drivers/net/wireless/ath/main.c b/drivers/net/wireless/ath/main.c
> index 8e99540..9cb15d9 100644
> --- a/drivers/net/wireless/ath/main.c
> +++ b/drivers/net/wireless/ath/main.c
> @@ -59,6 +59,17 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
>  }
>  EXPORT_SYMBOL(ath_rxbuf_alloc);
>  
> +bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr)
> +{
> +	if (ieee80211_is_beacon(hdr->frame_control) &&
> +			!is_zero_ether_addr(common->curbssid) &&
> +			ether_addr_equal_64bits(hdr->addr3, common->curbssid))
> +		return true;
> +

Apart from the fact that the expression in the if guard is badly
indented, couldn't you just return the value of that expression and
remove the if at all?

Cheers,

> +	return false;
> +}
> +EXPORT_SYMBOL(ath_is_mybeacon);
> +
>  void ath_printk(const char *level, const struct ath_common* common,
>  		const char *fmt, ...)
>  {
> 


-- 
Antonio Quartulli

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140115/a9b04d4a/attachment-0001.pgp 

WARNING: multiple messages have this Message-ID (diff)
From: Antonio Quartulli <antonio@meshcoding.com>
To: Oleksij Rempel <linux@rempel-privat.de>,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
	ath5k-devel@lists.ath5k.org
Subject: Re: [PATCH 1/5] ath: add common function ath_is_mybeacon
Date: Wed, 15 Jan 2014 17:10:29 +0100	[thread overview]
Message-ID: <52D6B2F5.4070404@meshcoding.com> (raw)
In-Reply-To: <1389802038-6688-2-git-send-email-linux@rempel-privat.de>

[-- Attachment #1: Type: text/plain, Size: 2053 bytes --]

On 15/01/14 17:07, Oleksij Rempel wrote:
> this function is used by most ath driver, so it can be moved here.
> 
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
>  drivers/net/wireless/ath/ath.h  |  2 ++
>  drivers/net/wireless/ath/main.c | 11 +++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
> index e0ba7cd..b59cfbe 100644
> --- a/drivers/net/wireless/ath/ath.h
> +++ b/drivers/net/wireless/ath/ath.h
> @@ -17,6 +17,7 @@
>  #ifndef ATH_H
>  #define ATH_H
>  
> +#include <linux/etherdevice.h>
>  #include <linux/skbuff.h>
>  #include <linux/if_ether.h>
>  #include <linux/spinlock.h>
> @@ -165,6 +166,7 @@ struct ath_common {
>  struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
>  				u32 len,
>  				gfp_t gfp_mask);
> +bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr);
>  
>  void ath_hw_setbssidmask(struct ath_common *common);
>  void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key);
> diff --git a/drivers/net/wireless/ath/main.c b/drivers/net/wireless/ath/main.c
> index 8e99540..9cb15d9 100644
> --- a/drivers/net/wireless/ath/main.c
> +++ b/drivers/net/wireless/ath/main.c
> @@ -59,6 +59,17 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
>  }
>  EXPORT_SYMBOL(ath_rxbuf_alloc);
>  
> +bool ath_is_mybeacon(struct ath_common *common, struct ieee80211_hdr *hdr)
> +{
> +	if (ieee80211_is_beacon(hdr->frame_control) &&
> +			!is_zero_ether_addr(common->curbssid) &&
> +			ether_addr_equal_64bits(hdr->addr3, common->curbssid))
> +		return true;
> +

Apart from the fact that the expression in the if guard is badly
indented, couldn't you just return the value of that expression and
remove the if at all?

Cheers,

> +	return false;
> +}
> +EXPORT_SYMBOL(ath_is_mybeacon);
> +
>  void ath_printk(const char *level, const struct ath_common* common,
>  		const char *fmt, ...)
>  {
> 


-- 
Antonio Quartulli


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-01-15 16:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 16:07 [ath9k-devel] [PATCH 0/5] use one common ath_is_mybeacon Oleksij Rempel
2014-01-15 16:07 ` Oleksij Rempel
2014-01-15 16:07 ` [ath9k-devel] [PATCH 1/5] ath: add common function ath_is_mybeacon Oleksij Rempel
2014-01-15 16:07   ` Oleksij Rempel
2014-01-15 16:10   ` Antonio Quartulli [this message]
2014-01-15 16:10     ` Antonio Quartulli
2014-01-15 16:16     ` [ath9k-devel] " Oleksij Rempel
2014-01-15 16:16       ` Oleksij Rempel
2014-01-16 15:44   ` [ath9k-devel] " Kalle Valo
2014-01-16 15:44     ` Kalle Valo
2014-01-17 23:27   ` [ath9k-devel] [PATCH v3 " Oleksij Rempel
2014-01-17 23:27     ` Oleksij Rempel
2014-01-17 23:30     ` [ath9k-devel] " Oleksij Rempel
2014-01-17 23:30       ` Oleksij Rempel
2014-01-15 16:07 ` [ath9k-devel] [PATCH 2/5] ath9k: use ath_is_mybeacon Oleksij Rempel
2014-01-15 16:07   ` Oleksij Rempel
2014-01-15 16:07 ` [ath9k-devel] [PATCH 3/5] ath9k_htc: " Oleksij Rempel
2014-01-15 16:07   ` Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52D6B2F5.4070404@meshcoding.com \
    --to=antonio@meshcoding.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.