lkml.org 
[lkml]   [2016]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] checkpatch: Whine about ACCESS_ONCE


On Sat, 16 Apr 2016, Joe Perches wrote:

> On Sat, 2016-04-16 at 12:04 -0700, Joe Perches wrote:
> > Add a test for use of ACCESS_ONCE that could be written using
> > READ_ONCE or WRITE_ONCE.
> >
> > --fix it too if desired.
>
> And here's a simple coccinelle script that does a
> rather better job:
>
> $ cat access_once.cocci
> @@
> expression e1;
> expression e2;
> @@
>
> - ACCESS_ONCE(e1) = e2
> + WRITE_ONCE(e1, e2)
>
> @@
> expression e1;
> @@
>
> - ACCESS_ONCE(e1)
> + READ_ONCE(e1)

Looks good to me. Is this something to put in the kernel?

julia

\
 
 \ /
  Last update: 2016-04-17 08:01    [W:0.069 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site