Re: [PATCH] altix: Add volatile qualifiers in places where it seems necessary

Andreas Schwab
2005-09-02T19:21:34Z

Mark Maule <maule@sgi.com> writes:

> Index: volatile/include/asm-ia64/sn/io.h
> =================================> --- volatile.orig/include/asm-ia64/sn/io.h 2005-09-02 09:13:20.730793919 -0500
> +++ volatile/include/asm-ia64/sn/io.h 2005-09-02 12:35:33.897375370 -0500
> @@ -36,6 +36,13 @@
> #define __sn_readq_relaxed ___sn_readq_relaxed
>
> /*
> + * Convenience macros for read/modify/write operations using above accessors
> + */
> +
> +#define __sn_rwq_relaxed(addr, op, val) \
> + {uint64_t r = __sn_readq_relaxed(addr); r op (val); writeq(r, addr);}

The local variable should be renamed to something less likely to clash
with names used in the arguments. The expansion should be surrounded by
do ... while(0) to make it a proper statement immune from the dangling
else problem.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."