From: "Jan Beulich" Subject: Re: [PATCH] x86: simplify a few macros / inline functions Date: Fri, 08 May 2015 09:29:18 +0100 Message-ID: <554C8FFE020000780007801B@mail.emea.novell.com> References: <554C76FE0200007800077F45@mail.emea.novell.com> <554C72F3.8060501@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yqdep-0005KR-31 for xen-devel@lists.xenproject.org; Fri, 08 May 2015 08:29:19 +0000 In-Reply-To: <554C72F3.8060501@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 08.05.15 at 10:25, wrote: > On 08/05/15 07:42, Jan Beulich wrote: >> @@ -30,29 +29,28 @@ build_write_atomic(write_u64_atomic, "q" >> >> void __bad_atomic_size(void); >> >> -#define read_atomic(p) ({ \ >> - unsigned long x_; \ >> - switch ( sizeof(*(p)) ) { \ >> - case 1: x_ = read_u8_atomic((uint8_t *)(p)); break; \ >> - case 2: x_ = read_u16_atomic((uint16_t *)(p)); break; \ >> - case 4: x_ = read_u32_atomic((uint32_t *)(p)); break; \ >> - case 8: x_ = read_u64_atomic((uint64_t *)(p)); break; \ >> - default: x_ = 0; __bad_atomic_size(); break; \ >> - } \ >> - (typeof(*(p)))x_; \ >> +#define read_atomic(p) ({ \ >> + unsigned long x_; \ >> + switch ( sizeof(*(p)) ) { \ >> + case 1: x_ = read_u8_atomic((uint8_t *)(p)); break; \ >> + case 2: x_ = read_u16_atomic((uint16_t *)(p)); break; \ >> + case 4: x_ = read_u32_atomic((uint32_t *)(p)); break; \ >> + case 8: x_ = read_u64_atomic((uint64_t *)(p)); break; \ >> + default: x_ = 0; __bad_atomic_size(); break; \ >> + } \ >> + (typeof(*(p)))x_; \ >> }) > > I cant spot a change in read_atomic(), other than the alignment of the > \'s. I just want to double check that I haven't missed something. That's correct - I just wanted them to align with the write_atomic() ones again without needlessly padding the now shorter lines there. Jan