From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] drm/virtio: use %llu format string form atomic64_t Date: Mon, 19 Oct 2015 12:11 +0200 Message-ID: <4345582.jiHe94XBb3@wuerfel> References: <5082760.FgB9zHNfte@wuerfel> <5152101.mD2bWzUJ2V@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: linux-arm-kernel@lists.infradead.org Cc: Linux MIPS Mailing List , Russell King - ARM Linux , "linux-kernel@vger.kernel.org" , DRI Development , virtualization@lists.linux-foundation.org, Geert Uytterhoeven , Ralf Baechle , Dave Airlie List-Id: virtualization@lists.linuxfoundation.org On Monday 19 October 2015 09:34:15 Geert Uytterhoeven wrote: > On Wed, Oct 7, 2015 at 1:23 PM, Arnd Bergmann wrote: > > static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) > > > > which truncates the result to 32 bit. > > Woops. > > See also my unanswered question in "atomic64 on 32-bit vs 64-bit (was: > Re: Add virtio gpu driver.)", which is still valid: > https://lkml.org/lkml/2015/6/28/18 > Regarding your question of > Instead of sprinkling casts, is there any good reason why atomic64_read() > and atomic64_t aren't "long long" everywhere, cfr. u64? I assume the answer is that some (all?) 64-bit architectures intentionally return 'long' here, in order for atomic_long_read() to return 'long' on all architectures, given the definitions from include/asm-generic/atomic-long.h We would have to either change those, or we have to pick between atomic_long_* or atomic64_* to have a consistent return type. Arnd