Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1604180 > unrolled thread

linux-next: build warnings after merge of the akpm-current tree

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2017-03-20 06:30 +0100
Last post2017-03-20 18:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: build warnings after merge of the akpm-current tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-03-20 06:30 +0100
    Re: linux-next: build warnings after merge of the akpm-current tree Dmitry Vyukov <dvyukov@google.com> - 2017-03-20 10:40 +0100
    Re: linux-next: build warnings after merge of the akpm-current tree "Challa, Mahipal" <Mahipal.Challa@cavium.com> - 2017-03-20 18:10 +0100

#1604180 — linux-next: build warnings after merge of the akpm-current tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-03-20 06:30 +0100
Subjectlinux-next: build warnings after merge of the akpm-current tree
Message-ID<tmY3f-8tO-5@gated-at.bofh.it>
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.

-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1604281

FromDmitry Vyukov <dvyukov@google.com>
Date2017-03-20 10:40 +0100
Message-ID<tn1Xc-2Jd-13@gated-at.bofh.it>
In reply to#1604180
On Mon, Mar 20, 2017 at 6:22 AM, Stephen Rothwell <sfr@canb.auug.org.au> 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.

[toc] | [prev] | [next] | [standalone]


#1604806

From"Challa, Mahipal" <Mahipal.Challa@cavium.com>
Date2017-03-20 18:10 +0100
Message-ID<tn8YF-7Pz-13@gated-at.bofh.it>
In reply to#1604180

From: Jan Glauber
Sent: Monday, March 20, 2017 6:00 PM
To: Dmitry Vyukov
Cc: Stephen Rothwell; Andrew Morton; Herbert Xu; linux-next@vger.kernel.org; LKML; Challa, Mahipal
Subject: Re: linux-next: build warnings after merge of the akpm-current tree
    
On Mon, Mar 20, 2017 at 10:05:54AM +0100, Dmitry Vyukov wrote:
> On Mon, Mar 20, 2017 at 6:22 AM, Stephen Rothwell <sfr@canb.auug.org.au> 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.

>The driver depends on 64BIT (HW is 64 bit only).

>> So I think we need to fix zip_main.c.

>I'm not entirely sure, all drivers that are available for x86_64 and
>arm64 and use atomic64_read will show such warnings.

>One possible solution would be to disable COMPILE_TEST for the zip
>driver, but that would just hide the issue.

We found a decent solution to this issue and sent the patch to Herbert.
Solution:
Changing the format specifiers to %llu and adding a cast to u64 solves the
problem on all the architectures.

Thanks,
Mahipal


     

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web