Re: [PATCH 1/3] make sparse keep its promise about context tracking

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

 



One comment on your patch description, by the way:

Johannes Berg wrote:
> However, the kernel use of __attribute__((context(...)) is actually
> wrong, the kernel often does things like:
> 
>     static void *dev_mc_seq_start(struct seq_file *seq, loff_t * pos)
>             __acquires(dev_base_lock)
>     {
>             [...]
>             read_lock(&dev_base_lock);
>             [...]
>     }
> 
> rather than
> 
>     static void *dev_mc_seq_start(struct seq_file *seq, loff_t * pos)
>             __acquires(dev_base_lock)
>     {
>             [...]
>             __acquire__(dev_base_lock);
>             read_lock(&dev_base_lock);
>             [...]
>     }

I don't understand why you count this as wrong.  read_lock should
handle acquiring the context itself, either via an __acquires
annotation if written as a function, or via an __acquire__ statement
if written as a macro.  Callers of read_lock shouldn't need to
explicitly call __acquire__.

- Josh Triplett

Attachment: signature.asc
Description: OpenPGP digital signature


[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