Re: [PATCH] print address space number for cast-from-AS warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 06, 2018 at 04:01:28PM -0700, Linus Torvalds wrote:
> On Thu, Sep 6, 2018 at 3:52 PM Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
> >
> > I suppose that hard-coding these names wouldn't be too bad.
> > Otherwise, I only see something like:
> 
> I was thinking that we could do something like actually change sparse
> to track a token instead of a number for the address space, and then
> we'd just make the kernel eventually switch to
> 
>   #define __user  __attribute__((noderef, address_space(user)))
> 
> and the address space would just magically change from '1' to 'user'.
> 
> The sparse validation tests would then just use a token name, and you
> coulkd just have a warning like
> 
>    warning: cast removes 'user' address space of expression
> 
> and yeah, the kernel warnings would look odd for a while ("cast
> removes '1' address space of expression"), but we'd know that they
> eventually would become more legible as we start relying on a newer
> version of sparse.
> 
> Maybe it's not a big deal, and maybe it's too painful to change the
> asn from an integer to a token pointer. I didn't even look at that.

Yes, that would also be possible, of course.
I think it would be a good thing to have a name in the message.

It shouldn't be a big problem to deal with a pointer (most uses would 
be unchanged, a few places use things like 'as1 |= sym->ctype.as;'
which will need a bit more care).

OTOH, this would destroy one of my patch to shrink the size of
struct ctype (worth maybe 0.5% of perf), though. I'm also a bit
annoyed about this transition period. I'll think about it.

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux