Skip to contentSkip to conversation

p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings

PATCH In review Christian Lamparter 2 participants 3 messages Jan 7, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 p54: return NETDEV_TX_OK in p54_tx and fix sparse warnings

This patch addresses all recent comments from Johannes Berg:

1st: (reference http://marc.info/?l=linux-wireless&m=123124685019631 )

Quoted 4 lines

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:

Review

Quoted 4 lines

due to your PS patch ("p54: power save management"), please run sparse:
make C=2 CF=-D__CHECK_ENDIAN__ M=...

(quoted diff) +2 -0
+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!

---

drivers/net/wireless/p54/p54common.c +3 -3
index c4ad148..1702eac 100644
@@ -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;
maintainer
#1 lore raw
Quoted 31 lines · Christian Lamparter

This patch addresses all recent comments from Johannes Berg:

1st: (reference http://marc.info/?l=linux-wireless&m=123124685019631 )

Quoted 4 lines

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:

Review

Quoted 4 lines

due to your PS patch ("p54: power save management"), please run sparse:
make C=2 CF=-D__CHECK_ENDIAN__ M=...

(quoted diff) +2 -0
+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!

---

drivers/net/wireless/p54/p54common.c +1 -1
index c4ad148..1702eac 100644
@@ -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);

drivers/net/wireless/p54/p54common.c static int p54_set_ps(struct ieee80211_hw *dev) · line 1753

Quoted 5 lines
drivers/net/wireless/p54/p54common.c +1 -1
@@ -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?

maintainer
#2 lore raw
Quoted 8 lines · Johannes Berg

drivers/net/wireless/p54/p54common.c static int p54_set_ps(struct ieee80211_hw *dev) · line 1753

Quoted 6 lines
drivers/net/wireless/p54/p54common.c +1 -1
@@ -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