[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 9 Sep 2013 11:36:18 +0200
From: Jan Kara <jack@...e.cz>
To: Chris Metcalf <cmetcalf@...era.com>
Cc: kbuild test robot <fengguang.wu@...el.com>,
Christoph Hellwig <hch@...radead.org>, Jan Kara <jack@...e.cz>,
Al Viro <viro@...iv.linux.org.uk>, kbuild-all@...org,
Paul Gortmaker <paul.gortmaker@...driver.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tile: rework <asm/cmpxchg.h>
On Fri 06-09-13 08:56:45, Chris Metcalf wrote:
> The macrology in cmpxchg.h was designed to allow arbitrary pointer
> and integer values to be passed through the routines. To support
> cmpxchg() on 64-bit values on the 32-bit tilepro architecture, we
> used the idiom "(typeof(val))(typeof(val-val))". This way, in the
> "size 8" branch of the switch, when the underlying cmpxchg routine
> returns a 64-bit quantity, we cast it first to a typeof(val-val)
> quantity (i.e. size_t if "val" is a pointer) with no warnings about
> casting between pointers and integers of different sizes, then cast
> onwards to typeof(val), again with no warnings. If val is not a
> pointer type, the additional cast is a no-op. We can't replace the
> typeof(val-val) cast with (for example) unsigned long, since then if
> "val" is really a 64-bit type, we cast away the high bits.
Ah, I see. Thanks for explanation.
Honza
--
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists