b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types
@ 2018-06-14 10:12 Omer Efrat
  2018-06-14 10:40 ` Sven Eckelmann
  0 siblings, 1 reply; 6+ messages in thread
From: Omer Efrat @ 2018-06-14 10:12 UTC (permalink / raw)
  To: linux-wireless; +Cc: netdev, b.a.t.m.a.n, Omer Efrat

Since 'filled' member in station_info changed to u64, BIT_ULL macro
should be used with NL80211_STA_INFO_* attribute types instead of BIT.

The BIT macro uses unsigned long type which some architectures handle as 32bit
and this results in compilation warnings such as:

net/mac80211/sta_info.c:2223:2: warning: left shift count >= width of type
  sinfo->filled |= BIT(NL80211_STA_INFO_TID_STATS);
  ^

Signed-off-by: Omer Efrat <omer.efrat@tandemg.com>
---
 net/batman-adv/bat_v_elp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 71c20c1..71e6474 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -114,7 +114,7 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
 		}
 		if (ret)
 			goto default_throughput;
-		if (!(sinfo.filled & BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT)))
+		if (!(sinfo.filled & BIT_ULL(NL80211_STA_INFO_EXPECTED_THROUGHPUT)))
 			goto default_throughput;
 
 		return sinfo.expected_throughput / 100;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types
  2018-06-14 10:12 [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types Omer Efrat
@ 2018-06-14 10:40 ` Sven Eckelmann
  2018-06-14 10:53   ` Sven Eckelmann
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2018-06-14 10:40 UTC (permalink / raw)
  To: Omer Efrat; +Cc: linux-wireless, netdev, b.a.t.m.a.n

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

On Donnerstag, 14. Juni 2018 13:12:17 CEST Omer Efrat wrote:
> Since 'filled' member in station_info changed to u64, BIT_ULL macro
> should be used with NL80211_STA_INFO_* attribute types instead of BIT.
> 
> The BIT macro uses unsigned long type which some architectures handle as 32bit
> and this results in compilation warnings such as:
> 
> net/mac80211/sta_info.c:2223:2: warning: left shift count >= width of type
>   sinfo->filled |= BIT(NL80211_STA_INFO_TID_STATS);
>   ^
> 
> Signed-off-by: Omer Efrat <omer.efrat@tandemg.com>
> ---
>  net/batman-adv/bat_v_elp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

It is called "batman-adv" and not "batman". And when (as in commit) did it 
change to 64 bit?  Shouldn't there be a "Fixed: " line to know which kernels 
are affected (especially for the stable kernel developers).

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types
  2018-06-14 10:40 ` Sven Eckelmann
@ 2018-06-14 10:53   ` Sven Eckelmann
  2018-06-14 11:05     ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2018-06-14 10:53 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Omer Efrat, netdev, linux-wireless

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

Hi,

here are the infos which were missing and which should be included in the 
commit message

> > Since 'filled' member in station_info changed to u64

in commit 739960f128e5 ("cfg80211/nl80211: Add support for 
NL80211_STA_INFO_RX_DURATION")

[...]

Fixes: d62890885efb ("batman-adv: Accept only filled wifi station info")

> > Signed-off-by: Omer Efrat <omer.efrat@tandemg.com>


Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types
  2018-06-14 10:53   ` Sven Eckelmann
@ 2018-06-14 11:05     ` Johannes Berg
  2018-06-14 11:20       ` Sven Eckelmann
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2018-06-14 11:05 UTC (permalink / raw)
  To: Sven Eckelmann, b.a.t.m.a.n; +Cc: Omer Efrat, netdev, linux-wireless

On Thu, 2018-06-14 at 12:53 +0200, Sven Eckelmann wrote:
> Hi,
> 
> here are the infos which were missing and which should be included in the 
> commit message
> 
> > > Since 'filled' member in station_info changed to u64
> 
> in commit 739960f128e5 ("cfg80211/nl80211: Add support for 
> NL80211_STA_INFO_RX_DURATION")

Yeah, which actually means this patch isn't needed?

BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT) is fine since
NL80211_STA_INFO_EXPECTED_THROUGHPUT is actually == 27.

johannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types
  2018-06-14 11:05     ` Johannes Berg
@ 2018-06-14 11:20       ` Sven Eckelmann
  2018-06-14 12:50         ` Omer Efrat
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2018-06-14 11:20 UTC (permalink / raw)
  To: Johannes Berg; +Cc: b.a.t.m.a.n, Omer Efrat, netdev, linux-wireless

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

On Donnerstag, 14. Juni 2018 13:05:16 CEST Johannes Berg wrote:
[...]
> > in commit 739960f128e5 ("cfg80211/nl80211: Add support for 
> > NL80211_STA_INFO_RX_DURATION")
> 
> Yeah, which actually means this patch isn't needed?
> 
> BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT) is fine since
> NL80211_STA_INFO_EXPECTED_THROUGHPUT is actually == 27.

Hadn't verified this before but this would make sense. So no fixes here - just 
some "cleanup" patch to make these tests more consistent. Thanks for checking.

@Omer: If you want it as cleanup patch then make it clear in the patch that 
the warning you've showed here is not actually not something which you will 
see in in the modified code.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types
  2018-06-14 11:20       ` Sven Eckelmann
@ 2018-06-14 12:50         ` Omer Efrat
  0 siblings, 0 replies; 6+ messages in thread
From: Omer Efrat @ 2018-06-14 12:50 UTC (permalink / raw)
  To: Sven Eckelmann, Johannes Berg; +Cc: b.a.t.m.a.n, netdev, linux-wireless

Sven Eckelmann wrote:
>@Omer: If you want it as cleanup patch then make it clear in the patch that
>the warning you've showed here is not actually not something which you will
>see in in the modified code.

I will send v3 as clean up patch.

Omer Efrat.

________________________________________
From: Sven Eckelmann <sven@narfation.org>
Sent: Thursday, June 14, 2018 2:20:17 PM
To: Johannes Berg
Cc: b.a.t.m.a.n@lists.open-mesh.org; Omer Efrat; netdev@vger.kernel.org; linux-wireless@vger.kernel.org
Subject: Re: [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types

On Donnerstag, 14. Juni 2018 13:05:16 CEST Johannes Berg wrote:
[...]
> > in commit 739960f128e5 ("cfg80211/nl80211: Add support for
> > NL80211_STA_INFO_RX_DURATION")
>
> Yeah, which actually means this patch isn't needed?
>
> BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT) is fine since
> NL80211_STA_INFO_EXPECTED_THROUGHPUT is actually == 27.

Hadn't verified this before but this would make sense. So no fixes here - just
some "cleanup" patch to make these tests more consistent. Thanks for checking.

@Omer: If you want it as cleanup patch then make it clear in the patch that
the warning you've showed here is not actually not something which you will
see in in the modified code.

Kind regards,
        Sven

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-14 12:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 10:12 [B.A.T.M.A.N.] [PATCH v2 3/5] batman: use BIT_ULL for NL80211_STA_INFO_* attribute types Omer Efrat
2018-06-14 10:40 ` Sven Eckelmann
2018-06-14 10:53   ` Sven Eckelmann
2018-06-14 11:05     ` Johannes Berg
2018-06-14 11:20       ` Sven Eckelmann
2018-06-14 12:50         ` Omer Efrat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).