Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753759AbdCTJir (ORCPT ); Mon, 20 Mar 2017 05:38:47 -0400 Received: from mail-vk0-f42.google.com ([209.85.213.42]:33509 "EHLO mail-vk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753382AbdCTJhh (ORCPT ); Mon, 20 Mar 2017 05:37:37 -0400 MIME-Version: 1.0 In-Reply-To: <20170320162226.47c6e3ed@canb.auug.org.au> References: <20170320162226.47c6e3ed@canb.auug.org.au> From: Dmitry Vyukov Date: Mon, 20 Mar 2017 10:05:54 +0100 Message-ID: Subject: Re: linux-next: build warnings after merge of the akpm-current tree To: Stephen Rothwell Cc: Andrew Morton , Herbert Xu , linux-next@vger.kernel.org, LKML , Mahipal Challa , Jan Glauber Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2797 Lines: 44 On Mon, Mar 20, 2017 at 6:22 AM, Stephen Rothwell wrote: > Hi Andrew, > > After merging the akpm-current tree, today's linux-next build (x86_64 > allmodconfig) produced these warnings: > > drivers/crypto/cavium/zip/zip_main.c: In function 'zip_show_stats': > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'long long int' [-Wformat=] > seq_printf(s, " ZIP Device %d Stats\n" > ^ > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 10 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 11 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 12 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 13 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 14 has type 'long long int' [-Wformat=] > drivers/crypto/cavium/zip/zip_main.c:489:18: warning: format '%ld' expects argument of type 'long int', but argument 15 has type 'long long int' [-Wformat=] > > Introduced by commit > > 09ae5d37e093 ("crypto: zip - Add Compression/Decompression statistics") > > from the crypto tree interacting with commit > > 3f4ca3d25e1a ("asm-generic, x86: wrap atomic operations") > > from the akpm-current tree. > > This latter commit changed atomic64read() from "long" to "long long" > on x86_64. Hi, Previously atomic operations returned different types on 32/64 bits. I think that was pretty unfortunate and could actually lead to lots of such warnings (as there were no single format specifier that one could use portably), and was difficult to wrap. So I used "unsigned long long" for all operations. I actually suspect that the new zip_main.c code would cause a similar warning on 32 bits even without my change, because atomic ops already returned unsigned long long there. So I think we need to fix zip_main.c.