Skip to contentSkip to conversation

cxgb4: Fix issues caught by sparse in dcb patchset

PATCH In review Anish Bhatt 3 participants 4 messages Jun 24, 2014

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

PATCH 1/1 cxgb4: Fix issues caught by sparse in dcb patchset

Hi,
This patch fixes warnings generated by sparse as pointed out by kbuild test robot, please appy to net-next. Applies on top of commit 79631c89ed70643fd0579a65834b227795b251ee
Thanks,
Anish

--
Anish Bhatt (1):
cxgb4: Fix endian bug introduced in

    76bcb31efc0685574fb123f7aaa92f8a50c14fd9
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.0.0
#1 lore raw

PATCH 1/1 cxgb4: Fix endian bug introduced in 76bcb31efc0685574fb123f7aaa92f8a50c14fd9

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c +4 -4
index 39b4a85..a8b1073 100644
@@ -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)
Signature · 1 line
2.0.0
#2 lore raw

Re: [PATCH] cxgb4: Fix endian bug introduced in 76bcb31efc0685574fb123f7aaa92f8a50c14fd9

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.

Quoted 12 lines
---
  drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c +0 -0
index 39b4a85..a8b1073 100644
@@ -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);
 

drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c static void cxgb4_setpfccfg(struct net_device *dev, int priority, u8 pfccfg) · line 496

Quoted 10 lines
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c +3 -3
  	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

maintainer
#3 lore raw
In reply to Anish Bhatt

From: Anish Bhatt <[email protected]>
Date: Mon, 23 Jun 2014 17:27:28 -0700

Quoted 6 lines

Hi,
This patch fixes warnings generated by sparse as pointed out by kbuild test robot, please appy to net-next. Applies on top of commit 79631c89ed70643fd0579a65834b227795b251ee
Thanks,
Anish

Please resubmit this properly.

First of all, the subject in the patch is not the place to mention the SHA1 ID of the commit that added the problem.

Instead you should mention it in the commit message body and you cannot provide just the SHA1 ID, you must also provide the header line text of the commit right afterwards inside of parenthesis and double quotes, for example like this:

	$(SHA1_ID) ("cxgb4: blah blah blah")

Since this is a one patch series, this header posting is not really necessary, put that material into the patch commit message itself and just post that.