diff mbox

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

Message ID ada1ve8r832.fsf@roland-alpha.cisco.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Roland Dreier April 21, 2010, 6:09 p.m. UTC
Use the correct direction of byte-swapping function to fix a mistake
shown by sparse endianness checking -- c.fl0id is __be16.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
 drivers/net/cxgb4/sge.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Dimitris Michailidis April 21, 2010, 7:17 p.m. UTC | #1
On 04/21/2010 11:09 AM, Roland Dreier wrote:
> Use the correct direction of byte-swapping function to fix a mistake
> shown by sparse endianness checking -- c.fl0id is __be16.
>
> Signed-off-by: Roland Dreier<rolandd@cisco.com>

Yes, thanks.

Acked-by: Dimitris Michailidis <dm@chelsio.com>

> ---
>   drivers/net/cxgb4/sge.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
> index 14adc58..70bf2b2 100644
> --- a/drivers/net/cxgb4/sge.c
> +++ b/drivers/net/cxgb4/sge.c
> @@ -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;
>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller April 22, 2010, 6 a.m. UTC | #2
From: Dimitris Michailidis <dm@chelsio.com>
Date: Wed, 21 Apr 2010 12:17:43 -0700

> On 04/21/2010 11:09 AM, Roland Dreier wrote:
>> Use the correct direction of byte-swapping function to fix a mistake
>> shown by sparse endianness checking -- c.fl0id is __be16.
>>
>> Signed-off-by: Roland Dreier<rolandd@cisco.com>
> 
> Yes, thanks.
> 
> Acked-by: Dimitris Michailidis <dm@chelsio.com>

Applied to net-next-2.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
index 14adc58..70bf2b2 100644
--- a/drivers/net/cxgb4/sge.c
+++ b/drivers/net/cxgb4/sge.c
@@ -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;