aboutsummaryrefslogtreecommitdiffstats
path: root/samples/kfifo/record-example.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2021-09-23 19:29:18 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-13 14:36:48 +0200
commit880732ae31e890a568a71eb50d5747284b3c4dbe (patch)
treed7e64027fec15b8a89def8999a515aecef9e7766 /samples/kfifo/record-example.c
parentmisc: ad525x_dpot: Make ad_dpot_remove() return void (diff)
downloadlinux-dev-880732ae31e890a568a71eb50d5747284b3c4dbe.tar.xz
linux-dev-880732ae31e890a568a71eb50d5747284b3c4dbe.zip
samples/kfifo: Rename read_lock/write_lock
The variables names read_lock and write_lock can clash with functions used for read/writer locks. Rename read_lock to read_access and write_lock to write_access to avoid a name collision. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lkml.kernel.org/r/20210806152551.qio7c3ho6pexezup@linutronix.de Link: https://lore.kernel.org/r/20210923172918.o22iwgvn3w7ilh44@linutronix.de Acked-by: Stefani Seibold <stefani@seibold.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples/kfifo/record-example.c')
-rw-r--r--samples/kfifo/record-example.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/kfifo/record-example.c b/samples/kfifo/record-example.c
index f64f3d62d6c2..e4087b2d3fc4 100644
--- a/samples/kfifo/record-example.c
+++ b/samples/kfifo/record-example.c
@@ -22,10 +22,10 @@
#define PROC_FIFO "record-fifo"
/* lock for procfs read access */
-static DEFINE_MUTEX(read_lock);
+static DEFINE_MUTEX(read_access);
/* lock for procfs write access */
-static DEFINE_MUTEX(write_lock);
+static DEFINE_MUTEX(write_access);
/*
* define DYNAMIC in this example for a dynamically allocated fifo.
@@ -123,12 +123,12 @@ static ssize_t fifo_write(struct file *file, const char __user *buf,
int ret;
unsigned int copied;
- if (mutex_lock_interruptible(&write_lock))
+ if (mutex_lock_interruptible(&write_access))
return -ERESTARTSYS;
ret = kfifo_from_user(&test, buf, count, &copied);
- mutex_unlock(&write_lock);
+ mutex_unlock(&write_access);
if (ret)
return ret;
@@ -141,12 +141,12 @@ static ssize_t fifo_read(struct file *file, char __user *buf,
int ret;
unsigned int copied;
- if (mutex_lock_interruptible(&read_lock))
+ if (mutex_lock_interruptible(&read_access))
return -ERESTARTSYS;
ret = kfifo_to_user(&test, buf, count, &copied);
- mutex_unlock(&read_lock);
+ mutex_unlock(&read_access);
if (ret)
return ret;