Skip to contentSkip to conversation

RDMA/nes: Rewrite expression to avoid undefined semantics

PATCH/RFC Roland Dreier 2 participants 2 messages Jul 14, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

Change code like

	x = expr(++x)

that assigns to x twice without a sequence point in between to the intended (and well-defined)

	x = expr(x + 1)

---
I'll queue this for 2.6.36 unless someone objects.

 drivers/infiniband/hw/nes/nes_hw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/infiniband/hw/nes/nes_hw.c +1 -1
index 57874a1..f41d890 100644
@@ -1970,7 +1970,7 @@ void nes_destroy_nic_qp(struct nes_vnic *nesvnic)
 			dev_kfree_skb(
 				nesvnic->nic.tx_skb[nesvnic->nic.sq_tail]);
 
-		nesvnic->nic.sq_tail = (++nesvnic->nic.sq_tail)
+		nesvnic->nic.sq_tail = (nesvnic->nic.sq_tail + 1)
 					& (nesvnic->nic.sq_size - 1);
 	}
 
Signature · 10 lines
1.7.1.1


-- 
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): ada630hx0ut.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org

#2 lore raw
Quoted 12 lines

-----Original Message-----
From: Roland Dreier [mailto:[email protected]]
Sent: Wednesday, July 14, 2010 3:31 PM
To: Latif, Faisal; Tung, Chien Tin; [email protected]
Subject: [PATCH/RFC] RDMA/nes: Rewrite expression to avoid undefined semantics

Change code like

	x = expr(++x)
Quoted 8 lines

that assigns to x twice without a sequence point in between to the intended (and well-defined)

	x = expr(x + 1)

---
I'll queue this for 2.6.36 unless someone objects.

This is fine.

Thanks
Faisal
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html