Skip to contentSkip to conversation

cxgb4: Use ntohs() on __be16 value instead of htons()

PATCH Applied Roland Dreier 3 participants 3 messages Apr 21, 2010 – Apr 22, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Use the correct direction of byte-swapping function to fix a mistake shown by sparse endianness checking -- c.fl0id is __be16.

---
 drivers/net/cxgb4/sge.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/cxgb4/sge.c +1 -1
index 14adc58..70bf2b2 100644
@@ -2047,7 +2047,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
 	adap->sge.ingr_map[iq->cntxt_id] = iq;
 
 	if (fl) {
-		fl->cntxt_id = htons(c.fl0id);
+		fl->cntxt_id = ntohs(c.fl0id);
 		fl->avail = fl->pend_cred = 0;
 		fl->pidx = fl->cidx = 0;
 		fl->alloc_failed = fl->large_alloc_failed = fl->starving = 0;
Signature · 2 lines
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
#1 lore raw
Quoted 4 lines · Roland Dreier

Use the correct direction of byte-swapping function to fix a mistake shown by sparse endianness checking -- c.fl0id is __be16.

Yes, thanks.

Quoted 18 lines
---
  drivers/net/cxgb4/sge.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/cxgb4/sge.c +1 -1
index 14adc58..70bf2b2 100644
@@ -2047,7 +2047,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
  	adap->sge.ingr_map[iq->cntxt_id] = iq;
 
  	if (fl) {
-		fl->cntxt_id = htons(c.fl0id);
+		fl->cntxt_id = ntohs(c.fl0id);
  		fl->avail = fl->pend_cred = 0;
  		fl->pidx = fl->cidx = 0;
  		fl->alloc_failed = fl->large_alloc_failed = fl->starving = 0;