public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] RDMA/nes: Rewrite expression to avoid undefined semantics
@ 2010-07-14 20:30 Roland Dreier
       [not found] ` <ada630hx0ut.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Dreier @ 2010-07-14 20:30 UTC (permalink / raw)
  To: Faisal Latif, Chien Tung, linux-rdma-u79uwXL29TY76Z2rM5mHXA

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)

Signed-off-by: Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
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(-)

diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 57874a1..f41d890 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -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);
 	}
 
-- 
1.7.1.1


-- 
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH/RFC] RDMA/nes: Rewrite expression to avoid undefined semantics
       [not found] ` <ada630hx0ut.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
@ 2010-07-14 20:51   ` Latif, Faisal
  0 siblings, 0 replies; 2+ messages in thread
From: Latif, Faisal @ 2010-07-14 20:51 UTC (permalink / raw)
  To: Roland Dreier, Tung, Chien Tin,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org


> -----Original Message-----
> From: Roland Dreier [mailto:rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org]
> Sent: Wednesday, July 14, 2010 3:31 PM
> To: Latif, Faisal; Tung, Chien Tin; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: [PATCH/RFC] RDMA/nes: Rewrite expression to avoid undefined
> semantics
> 
> 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)
> 
> Signed-off-by: Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> ---
> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-14 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-14 20:30 [PATCH/RFC] RDMA/nes: Rewrite expression to avoid undefined semantics Roland Dreier
     [not found] ` <ada630hx0ut.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
2010-07-14 20:51   ` Latif, Faisal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox