diff mbox

cxgb4: Fix endian bug introduced in 76bcb31efc0685574fb123f7aaa92f8a50c14fd9

Message ID 1403569649-22649-2-git-send-email-anish@chelsio.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Anish Bhatt June 24, 2014, 12:27 a.m. UTC
Signed-off-by: Anish Bhatt <anish@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Sergei Shtylyov June 24, 2014, 1:55 p.m. UTC | #1
Hello.

On 06/24/2014 04:27 AM, Anish Bhatt wrote:

    Please move the "introduced by <SHA1>" part of the subject into the 
changelog and add to <SHA1> the summary line of that commit in enclosed in 
parens. You can also add:

Fixes: <12-digit SHA1> ("<commit summary>")

before your signoff.

> Signed-off-by: Anish Bhatt <anish@chelsio.com>
> ---
>   drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
> index 39b4a85..a8b1073 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
> @@ -488,12 +488,12 @@ static void cxgb4_setpfccfg(struct net_device *dev, int priority, u8 pfccfg)
>   		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
>
>   	pcmd.u.dcb.pfc.type = FW_PORT_DCB_TYPE_PFC;
> -	pcmd.u.dcb.pfc.pfcen = cpu_to_be16(pi->dcb.pfcen);
> +	pcmd.u.dcb.pfc.pfcen = pi->dcb.pfcen;
>
>   	if (pfccfg)
> -		pcmd.u.dcb.pfc.pfcen |= cpu_to_be16(1 << priority);
> +		pcmd.u.dcb.pfc.pfcen |= (1 << priority);
>   	else
> -		pcmd.u.dcb.pfc.pfcen &= cpu_to_be16(~(1 << priority));
> +		pcmd.u.dcb.pfc.pfcen &= (~(1 << priority));

    Outer () not needed here and above.

WBR, Sergei

--
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/ethernet/chelsio/cxgb4/cxgb4_dcb.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
index 39b4a85..a8b1073 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c
@@ -488,12 +488,12 @@  static void cxgb4_setpfccfg(struct net_device *dev, int priority, u8 pfccfg)
 		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
 
 	pcmd.u.dcb.pfc.type = FW_PORT_DCB_TYPE_PFC;
-	pcmd.u.dcb.pfc.pfcen = cpu_to_be16(pi->dcb.pfcen);
+	pcmd.u.dcb.pfc.pfcen = pi->dcb.pfcen;
 
 	if (pfccfg)
-		pcmd.u.dcb.pfc.pfcen |= cpu_to_be16(1 << priority);
+		pcmd.u.dcb.pfc.pfcen |= (1 << priority);
 	else
-		pcmd.u.dcb.pfc.pfcen &= cpu_to_be16(~(1 << priority));
+		pcmd.u.dcb.pfc.pfcen &= (~(1 << priority));
 
 	err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd);
 	if (err != FW_PORT_DCB_CFG_SUCCESS) {
@@ -501,7 +501,7 @@  static void cxgb4_setpfccfg(struct net_device *dev, int priority, u8 pfccfg)
 		return;
 	}
 
-	pi->dcb.pfcen = be16_to_cpu(pcmd.u.dcb.pfc.pfcen);
+	pi->dcb.pfcen = pcmd.u.dcb.pfc.pfcen;
 }
 
 static u8 cxgb4_setall(struct net_device *dev)