Skip to contentSkip to conversation

atm: he: Fix undefined sequence points.

PATCH In review David Miller 1 participant 1 message Apr 18, 2011

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 2/42 atm: he: Fix undefined sequence points.

GCC complains in these queue index operations because we perform operations of the form:

	x = some_operation(++x);

which is undefined. Replace with:

	x = some_operation(x + 1);

which is well defined and provides the intended operation.

---
 drivers/atm/he.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/atm/he.c +2 -2
index 6cf59bf..9a51df4 100644
@@ -1801,7 +1801,7 @@ return_host_buffers:
 next_rbrq_entry:
 		he_dev->rbrq_head = (struct he_rbrq *)
 				((unsigned long) he_dev->rbrq_base |
-					RBRQ_MASK(++he_dev->rbrq_head));
+					RBRQ_MASK(he_dev->rbrq_head + 1));
 
 	}
 	read_unlock(&vcc_sklist_lock);
@@ -1884,7 +1884,7 @@ next_tbrq_entry:
 			pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status));
 		he_dev->tbrq_head = (struct he_tbrq *)
 				((unsigned long) he_dev->tbrq_base |
-					TBRQ_MASK(++he_dev->tbrq_head));
+					TBRQ_MASK(he_dev->tbrq_head + 1));
 	}
 
 	if (updated) {
Signature · 1 line
1.7.4.3