linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Many unexpected warnings with current sparse
@ 2019-10-01 16:28 Steve French
  2019-10-01 23:10 ` Luc Van Oostenryck
  0 siblings, 1 reply; 6+ messages in thread
From: Steve French @ 2019-10-01 16:28 UTC (permalink / raw)
  To: LKML; +Cc: sparse

Updated sparse to get rid of some unneeded kernel sparse check
warnings but now get many more

I get 100s of warnings similar to

./include/linux/quota.h:114:17: error: Expected ( after asm
./include/linux/quota.h:114:17: error: got __inline

but that is simply
        default:
                BUG();

Any idea a way to quiet those - there are too many sparse warnings now
to find any real warnings that are introduced by kernel changes?
-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Many unexpected warnings with current sparse
  2019-10-01 16:28 Many unexpected warnings with current sparse Steve French
@ 2019-10-01 23:10 ` Luc Van Oostenryck
  2019-10-01 23:14   ` Steve French
  0 siblings, 1 reply; 6+ messages in thread
From: Luc Van Oostenryck @ 2019-10-01 23:10 UTC (permalink / raw)
  To: Steve French; +Cc: LKML, sparse, linux-sparse

On Tue, Oct 01, 2019 at 11:28:16AM -0500, Steve French wrote:
> Updated sparse to get rid of some unneeded kernel sparse check
> warnings but now get many more
> 
> I get 100s of warnings similar to
> 
> ./include/linux/quota.h:114:17: error: Expected ( after asm
> ./include/linux/quota.h:114:17: error: got __inline
> 
> but that is simply
>         default:
>                 BUG();

Hi,

I don't see this on v5.4-rc1 with defconfig or allyesconfig and
sparse's current version. Any sparse's version since roughly
mid-December should give the same result.

If you're using an older version of sparse, please upgrade.
Otherwise, please send me your config so that I can take a look at it.


Best regards,
-- Luc Van Oostenryck

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Many unexpected warnings with current sparse
  2019-10-01 23:10 ` Luc Van Oostenryck
@ 2019-10-01 23:14   ` Steve French
  2019-10-02  0:19     ` Luc Van Oostenryck
  0 siblings, 1 reply; 6+ messages in thread
From: Steve French @ 2019-10-01 23:14 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: LKML, sparse, linux-sparse

It may be related to the following sparse make warning:

No rule to make target
'/usr/include/x86_64-linux-gnu/bits/huge_val.h', needed by
'sparse-llvm.o'

I don't see huge_val.h in the Ubuntu 19 version of libc6-dev

Will send you the kernel config - but I am using the default one from
the Ubuntu mainline download of 5.4-rc1

On Tue, Oct 1, 2019 at 6:10 PM Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
>
> On Tue, Oct 01, 2019 at 11:28:16AM -0500, Steve French wrote:
> > Updated sparse to get rid of some unneeded kernel sparse check
> > warnings but now get many more
> >
> > I get 100s of warnings similar to
> >
> > ./include/linux/quota.h:114:17: error: Expected ( after asm
> > ./include/linux/quota.h:114:17: error: got __inline
> >
> > but that is simply
> >         default:
> >                 BUG();
>
> Hi,
>
> I don't see this on v5.4-rc1 with defconfig or allyesconfig and
> sparse's current version. Any sparse's version since roughly
> mid-December should give the same result.
>
> If you're using an older version of sparse, please upgrade.
> Otherwise, please send me your config so that I can take a look at it.
>
>
> Best regards,
> -- Luc Van Oostenryck



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Many unexpected warnings with current sparse
  2019-10-01 23:14   ` Steve French
@ 2019-10-02  0:19     ` Luc Van Oostenryck
  2019-10-02  1:24       ` Steve French
  0 siblings, 1 reply; 6+ messages in thread
From: Luc Van Oostenryck @ 2019-10-02  0:19 UTC (permalink / raw)
  To: Steve French; +Cc: LKML, linux-sparse

On Tue, Oct 01, 2019 at 06:14:23PM -0500, Steve French wrote:
> It may be related to the following sparse make warning:
> 
> No rule to make target
> '/usr/include/x86_64-linux-gnu/bits/huge_val.h', needed by
> 'sparse-llvm.o'
> 
> I don't see huge_val.h in the Ubuntu 19 version of libc6-dev

Yes, I've been bitten myself by this. It's fixed since a little while.
So, just doing a clean build or removing all the deps (.*.d)
should allow you to build sparse.
 
I've verified the problem with asm and __inline in quota.h:
it's autodetected by kconfig (CC_HAS_ASM_INLINE) so the exact config
doesn't matter (only gcc's version does) but in all cases recent
versions of sparse don't have a problem with it (an upstream version
of `sparse --version` should return "v0.6.1-rc1-37-gd466a0281").

Best regards,
-- Luc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Many unexpected warnings with current sparse
  2019-10-02  0:19     ` Luc Van Oostenryck
@ 2019-10-02  1:24       ` Steve French
  2019-10-02  1:35         ` Luc Van Oostenryck
  0 siblings, 1 reply; 6+ messages in thread
From: Steve French @ 2019-10-02  1:24 UTC (permalink / raw)
  To: Luc Van Oostenryck, Paulo Alcantara, David Howells
  Cc: LKML, linux-sparse, CIFS

On Tue, Oct 1, 2019 at 7:19 PM Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
>
> On Tue, Oct 01, 2019 at 06:14:23PM -0500, Steve French wrote:
> > It may be related to the following sparse make warning:
> >
> > No rule to make target
> > '/usr/include/x86_64-linux-gnu/bits/huge_val.h', needed by
> > 'sparse-llvm.o'
> >
> > I don't see huge_val.h in the Ubuntu 19 version of libc6-dev
>
> Yes, I've been bitten myself by this. It's fixed since a little while.
> So, just doing a clean build or removing all the deps (.*.d)
> should allow you to build sparse.
>
> I've verified the problem with asm and __inline in quota.h:
> it's autodetected by kconfig (CC_HAS_ASM_INLINE) so the exact config
> doesn't matter (only gcc's version does) but in all cases recent
> versions of sparse don't have a problem with it

Removed the dependencies and rebuilt as you suggested and it worked ...
and even better ... with the noise removed I now see two real bugs
(endian conversion missing on two lines) and only one possible problem
with sparse/gcc itself

Sparse now flags this line from one of Paulo's DFS features merged last year:

      struct smb_vol fake_vol = {0};

with

      "warning: Using plain integer as NULL pointer"

What is the recommended way to initialize a struct to avoid the sparse warning?


And what about the "namespace" warnings from the fscache (cache.o)
code that now show up?  I hadn't seen those before.
Any easy way to remove them?

"WARNING: module cifs uses symbol sigprocmask from namespace
fs/cifs/cache.o: $(deps_/home/sfrench/cifs-2.6/fs/cifs/cache.o), but
does not import it."
-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Many unexpected warnings with current sparse
  2019-10-02  1:24       ` Steve French
@ 2019-10-02  1:35         ` Luc Van Oostenryck
  0 siblings, 0 replies; 6+ messages in thread
From: Luc Van Oostenryck @ 2019-10-02  1:35 UTC (permalink / raw)
  To: Steve French; +Cc: Paulo Alcantara, David Howells, LKML, linux-sparse, CIFS

On Tue, Oct 01, 2019 at 08:24:45PM -0500, Steve French wrote:
> On Tue, Oct 1, 2019 at 7:19 PM Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
> >
> > On Tue, Oct 01, 2019 at 06:14:23PM -0500, Steve French wrote:
> > > It may be related to the following sparse make warning:
> > >
> > > No rule to make target
> > > '/usr/include/x86_64-linux-gnu/bits/huge_val.h', needed by
> > > 'sparse-llvm.o'
> > >
> > > I don't see huge_val.h in the Ubuntu 19 version of libc6-dev
> >
> > Yes, I've been bitten myself by this. It's fixed since a little while.
> > So, just doing a clean build or removing all the deps (.*.d)
> > should allow you to build sparse.
> >
> > I've verified the problem with asm and __inline in quota.h:
> > it's autodetected by kconfig (CC_HAS_ASM_INLINE) so the exact config
> > doesn't matter (only gcc's version does) but in all cases recent
> > versions of sparse don't have a problem with it
> 
> Removed the dependencies and rebuilt as you suggested and it worked ...
> and even better ... with the noise removed I now see two real bugs

Ahh, good!

> (endian conversion missing on two lines) and only one possible problem
> with sparse/gcc itself
> 
> Sparse now flags this line from one of Paulo's DFS features merged last year:
> 
>       struct smb_vol fake_vol = {0};
> 
> with
> 
>       "warning: Using plain integer as NULL pointer"
> 
> What is the recommended way to initialize a struct to avoid the sparse warning?

Well, personally, I simply use '{}'. GCC and sparse are happy with it but, IIRC,
it's not allowed by the standard...

> And what about the "namespace" warnings from the fscache (cache.o)
> code that now show up?  I hadn't seen those before.
> Any easy way to remove them?
> 
> "WARNING: module cifs uses symbol sigprocmask from namespace
> fs/cifs/cache.o: $(deps_/home/sfrench/cifs-2.6/fs/cifs/cache.o), but
> does not import it."

This one is not from sparse, it's from modpost (see EXPORT_SYMBOL_NS).

Cheers,
-- Luc

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-02  1:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 16:28 Many unexpected warnings with current sparse Steve French
2019-10-01 23:10 ` Luc Van Oostenryck
2019-10-01 23:14   ` Steve French
2019-10-02  0:19     ` Luc Van Oostenryck
2019-10-02  1:24       ` Steve French
2019-10-02  1:35         ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).