* [PATCH 1/1] Staging: comedi: comedi_fops.c: Fixed coding style issue
@ 2016-05-10 15:51 Shyam Saini
2016-05-10 16:45 ` Ian Abbott
0 siblings, 1 reply; 2+ messages in thread
From: Shyam Saini @ 2016-05-10 15:51 UTC (permalink / raw)
To: abbotti; +Cc: gregkh, hsweeten, devel, linux-kernel, Shyam Saini
Fixed following checkpatch.pl warnings
WARNING: Prefer WRITE_ONCE(<FOO>, <BAR>) over ACCESS_ONCE(<FOO>) = <BAR>
WARNING: Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>)
Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
drivers/staging/comedi/comedi_fops.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 629080f..4d87596 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -312,8 +312,8 @@ static void comedi_file_reset(struct file *file)
}
cfp->last_attached = dev->attached;
cfp->last_detach_count = dev->detach_count;
- ACCESS_ONCE(cfp->read_subdev) = read_s;
- ACCESS_ONCE(cfp->write_subdev) = write_s;
+ WRITE_ONCE(cfp->read_subdev, read_s);
+ WRITE_ONCE(cfp->write_subdev, write_s);
}
static void comedi_file_check(struct file *file)
@@ -331,7 +331,7 @@ static struct comedi_subdevice *comedi_file_read_subdevice(struct file *file)
struct comedi_file *cfp = file->private_data;
comedi_file_check(file);
- return ACCESS_ONCE(cfp->read_subdev);
+ return READ_ONCE(cfp->read_subdev);
}
static struct comedi_subdevice *comedi_file_write_subdevice(struct file *file)
@@ -339,7 +339,7 @@ static struct comedi_subdevice *comedi_file_write_subdevice(struct file *file)
struct comedi_file *cfp = file->private_data;
comedi_file_check(file);
- return ACCESS_ONCE(cfp->write_subdev);
+ return READ_ONCE(cfp->write_subdev);
}
static int resize_async_buffer(struct comedi_device *dev,
@@ -1992,7 +1992,7 @@ static int do_setrsubd_ioctl(struct comedi_device *dev, unsigned long arg,
!(s_old->async->cmd.flags & CMDF_WRITE))
return -EBUSY;
- ACCESS_ONCE(cfp->read_subdev) = s_new;
+ WRITE_ONCE(cfp->read_subdev, s_new);
return 0;
}
@@ -2034,7 +2034,7 @@ static int do_setwsubd_ioctl(struct comedi_device *dev, unsigned long arg,
(s_old->async->cmd.flags & CMDF_WRITE))
return -EBUSY;
- ACCESS_ONCE(cfp->write_subdev) = s_new;
+ WRITE_ONCE(cfp->write_subdev, s_new);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] Staging: comedi: comedi_fops.c: Fixed coding style issue
2016-05-10 15:51 [PATCH 1/1] Staging: comedi: comedi_fops.c: Fixed coding style issue Shyam Saini
@ 2016-05-10 16:45 ` Ian Abbott
0 siblings, 0 replies; 2+ messages in thread
From: Ian Abbott @ 2016-05-10 16:45 UTC (permalink / raw)
To: Shyam Saini; +Cc: gregkh, hsweeten, devel, linux-kernel
On 10/05/16 16:51, Shyam Saini wrote:
> Fixed following checkpatch.pl warnings
> WARNING: Prefer WRITE_ONCE(<FOO>, <BAR>) over ACCESS_ONCE(<FOO>) = <BAR>
>
> WARNING: Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>)
>
> Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
> ---
> drivers/staging/comedi/comedi_fops.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> index 629080f..4d87596 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -312,8 +312,8 @@ static void comedi_file_reset(struct file *file)
> }
> cfp->last_attached = dev->attached;
> cfp->last_detach_count = dev->detach_count;
> - ACCESS_ONCE(cfp->read_subdev) = read_s;
> - ACCESS_ONCE(cfp->write_subdev) = write_s;
> + WRITE_ONCE(cfp->read_subdev, read_s);
> + WRITE_ONCE(cfp->write_subdev, write_s);
> }
>
> static void comedi_file_check(struct file *file)
> @@ -331,7 +331,7 @@ static struct comedi_subdevice *comedi_file_read_subdevice(struct file *file)
> struct comedi_file *cfp = file->private_data;
>
> comedi_file_check(file);
> - return ACCESS_ONCE(cfp->read_subdev);
> + return READ_ONCE(cfp->read_subdev);
> }
>
> static struct comedi_subdevice *comedi_file_write_subdevice(struct file *file)
> @@ -339,7 +339,7 @@ static struct comedi_subdevice *comedi_file_write_subdevice(struct file *file)
> struct comedi_file *cfp = file->private_data;
>
> comedi_file_check(file);
> - return ACCESS_ONCE(cfp->write_subdev);
> + return READ_ONCE(cfp->write_subdev);
> }
>
> static int resize_async_buffer(struct comedi_device *dev,
> @@ -1992,7 +1992,7 @@ static int do_setrsubd_ioctl(struct comedi_device *dev, unsigned long arg,
> !(s_old->async->cmd.flags & CMDF_WRITE))
> return -EBUSY;
>
> - ACCESS_ONCE(cfp->read_subdev) = s_new;
> + WRITE_ONCE(cfp->read_subdev, s_new);
> return 0;
> }
>
> @@ -2034,7 +2034,7 @@ static int do_setwsubd_ioctl(struct comedi_device *dev, unsigned long arg,
> (s_old->async->cmd.flags & CMDF_WRITE))
> return -EBUSY;
>
> - ACCESS_ONCE(cfp->write_subdev) = s_new;
> + WRITE_ONCE(cfp->write_subdev, s_new);
> return 0;
> }
>
>
Thanks!
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-10 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10 15:51 [PATCH 1/1] Staging: comedi: comedi_fops.c: Fixed coding style issue Shyam Saini
2016-05-10 16:45 ` Ian Abbott
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).