linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix moredata flag endianness in cabq tx
@ 2015-07-09 10:27 Michal Kazior
  2015-07-21 15:01 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Kazior @ 2015-07-09 10:27 UTC (permalink / raw)
  To: ath9k-devel; +Cc: linux-wireless, Michal Kazior

While compiling ath9k with some extra flags I've
found that:

 ath9k/xmit.c +2473 ## 16: warning: restricted __le16 degrades to integer
 ath9k/xmit.c +2474 ## 36: warning: invalid assignment: &=
 ath9k/xmit.c +2474 ## 36:    left side has type restricted __le16
 ath9k/xmit.c +2474 ## 36:    right side has type int

There's no way for frame ftype/stype to be
mistreated as the offending 'moredata' flag when
considering cab queue.

This could've however theoretically led sometimes
to increased power consumption on connected
stations as they would keep their Rx active
waiting for frames that would never come.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 3ad79bb4f2c2..d8cc45106f85 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2470,8 +2470,8 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	bf = list_first_entry(&bf_q, struct ath_buf, list);
 	hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
 
-	if (hdr->frame_control & IEEE80211_FCTL_MOREDATA) {
-		hdr->frame_control &= ~IEEE80211_FCTL_MOREDATA;
+	if (hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) {
+		hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_MOREDATA);
 		dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
 			sizeof(*hdr), DMA_TO_DEVICE);
 	}
-- 
2.1.4


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

* Re: ath9k: fix moredata flag endianness in cabq tx
  2015-07-09 10:27 [PATCH] ath9k: fix moredata flag endianness in cabq tx Michal Kazior
@ 2015-07-21 15:01 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-07-21 15:01 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath9k-devel, linux-wireless, Michal Kazior


> While compiling ath9k with some extra flags I've
> found that:
> 
>  ath9k/xmit.c +2473 ## 16: warning: restricted __le16 degrades to integer
>  ath9k/xmit.c +2474 ## 36: warning: invalid assignment: &=
>  ath9k/xmit.c +2474 ## 36:    left side has type restricted __le16
>  ath9k/xmit.c +2474 ## 36:    right side has type int
> 
> There's no way for frame ftype/stype to be
> mistreated as the offending 'moredata' flag when
> considering cab queue.
> 
> This could've however theoretically led sometimes
> to increased power consumption on connected
> stations as they would keep their Rx active
> waiting for frames that would never come.
> 
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

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

end of thread, other threads:[~2015-07-21 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09 10:27 [PATCH] ath9k: fix moredata flag endianness in cabq tx Michal Kazior
2015-07-21 15:01 ` Kalle Valo

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).