From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473AbdFHLgF (ORCPT ); Thu, 8 Jun 2017 07:36:05 -0400 Received: from smtp113.ord1c.emailsrvr.com ([108.166.43.113]:42128 "EHLO smtp113.ord1c.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbdFHLgE (ORCPT ); Thu, 8 Jun 2017 07:36:04 -0400 X-Auth-ID: abbotti@mev.co.uk X-Sender-Id: abbotti@mev.co.uk Subject: Re: [PATCH v2] xen: avoid type warning in xchg_xen_ulong To: Arnd Bergmann , Stefano Stabellini References: <20170608085323.2209174-1-arnd@arndb.de> Cc: Russell King , xen-devel@lists.xenproject.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org From: Ian Abbott Message-ID: Date: Thu, 8 Jun 2017 12:36:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170608085323.2209174-1-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-06-08 09:53, Arnd Bergmann wrote: > The improved type-checking version of container_of() triggers a warning for > xchg_xen_ulong, pointing out that 'xen_ulong_t' is unsigned, but atomic64_t > contains a signed value: > > drivers/xen/events/events_2l.c: In function 'evtchn_2l_handle_events': > drivers/xen/events/events_2l.c:187:1020: error: call to '__compiletime_assert_187' declared with attribute error: pointer type mismatch in container_of() > > This adds a cast to work around the warning. > > Cc: Ian Abbott > Fixes: 85323a991d40 ("xen: arm: mandate EABI and use generic atomic operations.") > Fixes: daa2ac80834d ("kernel.h: handle pointers to arrays better in container_of()") > Signed-off-by: Arnd Bergmann > --- > v2: found the correct warning message and updated the changelog > --- > arch/arm/include/asm/xen/events.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/include/asm/xen/events.h b/arch/arm/include/asm/xen/events.h > index 71e473d05fcc..620dc75362e5 100644 > --- a/arch/arm/include/asm/xen/events.h > +++ b/arch/arm/include/asm/xen/events.h > @@ -16,7 +16,7 @@ static inline int xen_irqs_disabled(struct pt_regs *regs) > return raw_irqs_disabled_flags(regs->ARM_cpsr); > } > > -#define xchg_xen_ulong(ptr, val) atomic64_xchg(container_of((ptr), \ > +#define xchg_xen_ulong(ptr, val) atomic64_xchg(container_of((long long*)(ptr),\ > atomic64_t, \ > counter), (val)) > > Acked-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd. E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-