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

From: Andreas Schwab <schwab_at_suse.de>
Date: 2005-09-03 05:21:34
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."
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Sep 03 05:22:21 2005

This archive was generated by hypermail 2.1.8 : 2005-09-03 05:22:28 EST