All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gong <wgong@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 2/2] mac80211: do intersection with he mcs and nss set of peer and own
Date: Wed, 29 Sep 2021 11:20:01 +0800	[thread overview]
Message-ID: <facd18458a7ecfc0afbfd06c8a57d849@codeaurora.org> (raw)
In-Reply-To: <b6c96c4ecdf9ec175d7f89e8600fb53768287cc2.camel@sipsolutions.net>

On 2021-09-28 21:02, Johannes Berg wrote:
> Hi,
> 
> 
> I had done a bunch of fixups to this patch, but the zero-day build 
> robot
> correctly reports that:
> 
>> +	ieee80211_he_mcs_intersection(&own_he_cap.he_mcs_nss_supp.rx_mcs_80,
>> +				      &he_cap->he_mcs_nss_supp.rx_mcs_80,
>> +				      &own_he_cap.he_mcs_nss_supp.tx_mcs_80,
>> +				      &he_cap->he_mcs_nss_supp.tx_mcs_80);
> 
> the &own_he_cap... parts here will take an __le16 pointer to a possibly
> unaligned variable - any thoughts how we could fix that?
> 
Hi Johannes,

Add "__packed" before the "__le16 *" should solve this warning by my 
understand like this:

diff --git a/net/mac80211/he.c b/net/mac80211/he.c
index c05af7018f79..960fea9646b0 100644
--- a/net/mac80211/he.c
+++ b/net/mac80211/he.c
@@ -52,7 +52,7 @@ ieee80211_update_from_he_6ghz_capa(const struct 
ieee80211_he_6ghz_capa *he_6ghz_
         sta->sta.he_6ghz_capa = *he_6ghz_capa;
  }

-static void ieee80211_he_mcs_disable(__le16 *he_mcs)
+static void ieee80211_he_mcs_disable(__packed __le16 *he_mcs)
  {
         u32 i;

@@ -60,8 +60,8 @@ static void ieee80211_he_mcs_disable(__le16 *he_mcs)
                 *he_mcs |= cpu_to_le16(IEEE80211_HE_MCS_NOT_SUPPORTED << 
i * 2);
  }

-static void ieee80211_he_mcs_intersection(__le16 *he_own_rx, __le16 
*he_peer_rx,
-                                         __le16 *he_own_tx, __le16 
*he_peer_tx)
+static void ieee80211_he_mcs_intersection(__packed __le16 *he_own_rx, 
__packed __le16 *he_peer_rx,
+                                         __packed __le16 *he_own_tx, 
__packed __le16 *he_peer_tx)
  {
         u32 i;
         u16 own_rx, own_tx, peer_rx, peer_tx;



net/mac80211/he.c:158:33: warning: taking address of packed member 
'rx_mcs_80' of class or structure 'ieee80211_he_mcs_nss_supp' may result 
in an unaligned pointer value [-Waddress-of-packed-member]

> johannes

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

WARNING: multiple messages have this Message-ID (diff)
From: Wen Gong <wgong@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 2/2] mac80211: do intersection with he mcs and nss set of peer and own
Date: Wed, 29 Sep 2021 11:20:01 +0800	[thread overview]
Message-ID: <facd18458a7ecfc0afbfd06c8a57d849@codeaurora.org> (raw)
In-Reply-To: <b6c96c4ecdf9ec175d7f89e8600fb53768287cc2.camel@sipsolutions.net>

On 2021-09-28 21:02, Johannes Berg wrote:
> Hi,
> 
> 
> I had done a bunch of fixups to this patch, but the zero-day build 
> robot
> correctly reports that:
> 
>> +	ieee80211_he_mcs_intersection(&own_he_cap.he_mcs_nss_supp.rx_mcs_80,
>> +				      &he_cap->he_mcs_nss_supp.rx_mcs_80,
>> +				      &own_he_cap.he_mcs_nss_supp.tx_mcs_80,
>> +				      &he_cap->he_mcs_nss_supp.tx_mcs_80);
> 
> the &own_he_cap... parts here will take an __le16 pointer to a possibly
> unaligned variable - any thoughts how we could fix that?
> 
Hi Johannes,

Add "__packed" before the "__le16 *" should solve this warning by my 
understand like this:

diff --git a/net/mac80211/he.c b/net/mac80211/he.c
index c05af7018f79..960fea9646b0 100644
--- a/net/mac80211/he.c
+++ b/net/mac80211/he.c
@@ -52,7 +52,7 @@ ieee80211_update_from_he_6ghz_capa(const struct 
ieee80211_he_6ghz_capa *he_6ghz_
         sta->sta.he_6ghz_capa = *he_6ghz_capa;
  }

-static void ieee80211_he_mcs_disable(__le16 *he_mcs)
+static void ieee80211_he_mcs_disable(__packed __le16 *he_mcs)
  {
         u32 i;

@@ -60,8 +60,8 @@ static void ieee80211_he_mcs_disable(__le16 *he_mcs)
                 *he_mcs |= cpu_to_le16(IEEE80211_HE_MCS_NOT_SUPPORTED << 
i * 2);
  }

-static void ieee80211_he_mcs_intersection(__le16 *he_own_rx, __le16 
*he_peer_rx,
-                                         __le16 *he_own_tx, __le16 
*he_peer_tx)
+static void ieee80211_he_mcs_intersection(__packed __le16 *he_own_rx, 
__packed __le16 *he_peer_rx,
+                                         __packed __le16 *he_own_tx, 
__packed __le16 *he_peer_tx)
  {
         u32 i;
         u16 own_rx, own_tx, peer_rx, peer_tx;



net/mac80211/he.c:158:33: warning: taking address of packed member 
'rx_mcs_80' of class or structure 'ieee80211_he_mcs_nss_supp' may result 
in an unaligned pointer value [-Waddress-of-packed-member]

> johannes

  reply	other threads:[~2021-09-29  3:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05  3:08 [PATCH v3 0/2] mac80211: set NSS correct for supported HE-MCS and NSS set Wen Gong
2021-01-05  3:08 ` Wen Gong
2021-01-05  3:08 ` [PATCH v3 1/2] mac80211: remove NSS number of 160MHz if not support 160MHz for HE Wen Gong
2021-01-05  3:08   ` Wen Gong
2021-01-05  3:08 ` [PATCH v3 2/2] mac80211: do intersection with he mcs and nss set of peer and own Wen Gong
2021-01-05  3:08   ` Wen Gong
2021-09-28 13:02   ` Johannes Berg
2021-09-28 13:02     ` Johannes Berg
2021-09-29  3:20     ` Wen Gong [this message]
2021-09-29  3:20       ` Wen Gong
2021-10-01  6:32       ` Kalle Valo
2021-10-01  6:32         ` Kalle Valo
2021-10-01  7:01         ` Johannes Berg
2021-10-01  7:01           ` Johannes Berg

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=facd18458a7ecfc0afbfd06c8a57d849@codeaurora.org \
    --to=wgong@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.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.