Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings
@ 2009-01-07 15:40 Christian Lamparter
  2009-01-07 15:43 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Lamparter @ 2009-01-07 15:40 UTC (permalink / raw)
  To: wireless; +Cc: John W Linville, Johannes Berg

This patch addresses all recent comments from Johannes Berg:

1st: (reference http://marc.info/?l=linux-wireless&m=123124685019631 )
>First off: all those should return NETDEV_TX_OK/BUSY.
>iwl-agn: returns 0 (== NETDEV_TX_OK, but still should be changed) 
>[...]
>p54: same (some paths)

2nd:
> due to your PS patch ("p54: power save management"), please run sparse:
> make C=2 CF=-D__CHECK_ENDIAN__ M=...
> +drivers/net/wireless/p54/p54common.c:1753:8: warning: incorrect type in assignment (different base types)
> +drivers/net/wireless/p54/p54common.c:1769:29: warning: incorrect type in assignment (different base types)
The cpu_to_le16 ended up in the wrong line... Sorry!

Signed-off-by: Christian Lamparter <chunkeey@web.de>
---
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index c4ad148..1702eac 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -1508,7 +1508,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
 	queue_delayed_work(dev->workqueue, &priv->work,
 			   msecs_to_jiffies(P54_TX_FRAME_LIFETIME));
 
-	return 0;
+	return NETDEV_TX_OK;
 
  err:
 	skb_pull(skb, sizeof(*hdr) + sizeof(*txhdr) + padding);
@@ -1750,7 +1750,7 @@ static int p54_set_ps(struct ieee80211_hw *dev)
 	int i;
 
 	if (dev->conf.flags & IEEE80211_CONF_PS)
-		mode = cpu_to_le16(P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC);
+		mode = P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC;
 	else
 		mode = P54_PSM_CAM;
 
@@ -1766,7 +1766,7 @@ static int p54_set_ps(struct ieee80211_hw *dev)
 	for (i = 0; i < ARRAY_SIZE(psm->intervals); i++) {
 		psm->intervals[i].interval =
 			cpu_to_le16(dev->conf.listen_interval);
-		psm->intervals[i].periods = 1;
+		psm->intervals[i].periods = cpu_to_le16(1);
 	}
 
 	psm->beacon_rssi_skip_max = 60;

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

* Re: [PATCH] p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings
  2009-01-07 15:40 [PATCH] p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings Christian Lamparter
@ 2009-01-07 15:43 ` Johannes Berg
  2009-01-07 15:46   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2009-01-07 15:43 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: wireless, John W Linville

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

On Wed, 2009-01-07 at 16:40 +0100, Christian Lamparter wrote:
> This patch addresses all recent comments from Johannes Berg:
> 
> 1st: (reference http://marc.info/?l=linux-wireless&m=123124685019631 )
> >First off: all those should return NETDEV_TX_OK/BUSY.
> >iwl-agn: returns 0 (== NETDEV_TX_OK, but still should be changed) 
> >[...]
> >p54: same (some paths)
> 
> 2nd:
> > due to your PS patch ("p54: power save management"), please run sparse:
> > make C=2 CF=-D__CHECK_ENDIAN__ M=...
> > +drivers/net/wireless/p54/p54common.c:1753:8: warning: incorrect type in assignment (different base types)
> > +drivers/net/wireless/p54/p54common.c:1769:29: warning: incorrect type in assignment (different base types)
> The cpu_to_le16 ended up in the wrong line... Sorry!
> 
> Signed-off-by: Christian Lamparter <chunkeey@web.de>
> ---
> diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
> index c4ad148..1702eac 100644
> --- a/drivers/net/wireless/p54/p54common.c
> +++ b/drivers/net/wireless/p54/p54common.c
> @@ -1508,7 +1508,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
>  	queue_delayed_work(dev->workqueue, &priv->work,
>  			   msecs_to_jiffies(P54_TX_FRAME_LIFETIME));
>  
> -	return 0;
> +	return NETDEV_TX_OK;
>  
>   err:
>  	skb_pull(skb, sizeof(*hdr) + sizeof(*txhdr) + padding);
> @@ -1750,7 +1750,7 @@ static int p54_set_ps(struct ieee80211_hw *dev)
>  	int i;
>  
>  	if (dev->conf.flags & IEEE80211_CONF_PS)
> -		mode = cpu_to_le16(P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC);
> +		mode = P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC;

you also have to declare mode as u16, no?


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

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

* Re: [PATCH] p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings
  2009-01-07 15:43 ` Johannes Berg
@ 2009-01-07 15:46   ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2009-01-07 15:46 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: wireless, John W Linville

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

On Wed, 2009-01-07 at 16:43 +0100, Johannes Berg wrote:

> > @@ -1750,7 +1750,7 @@ static int p54_set_ps(struct ieee80211_hw *dev)
> >  	int i;
> >  
> >  	if (dev->conf.flags & IEEE80211_CONF_PS)
> > -		mode = cpu_to_le16(P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC);
> > +		mode = P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC;
> 
> you also have to declare mode as u16, no?

Sorry, you do, I got confused.

johannes

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

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 15:40 [PATCH] p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings Christian Lamparter
2009-01-07 15:43 ` Johannes Berg
2009-01-07 15:46   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox