summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/adutux.c
diff options
context:
space:
mode:
authorSalah Triki <salah.triki@gmail.com>2021-08-03 01:53:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-05 12:31:34 +0200
commite21dd90eb86488fb2689c766311eb6fce98b2eb7 (patch)
tree2755e80fdc50116f1239a058637b9c28a710d7bb /drivers/usb/misc/adutux.c
parent90059e9395cae00d79ecb1f7e1e702756416bc6a (diff)
downloadlinux-stable-e21dd90eb86488fb2689c766311eb6fce98b2eb7.tar.gz
linux-stable-e21dd90eb86488fb2689c766311eb6fce98b2eb7.tar.bz2
linux-stable-e21dd90eb86488fb2689c766311eb6fce98b2eb7.zip
usb: misc: adutux: use swap()
Use swap() in order to make code cleaner. Issue found by coccinelle. Signed-off-by: Salah Triki <salah.triki@gmail.com> Link: https://lore.kernel.org/r/20210803005343.GA1578854@pc Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/adutux.c')
-rw-r--r--drivers/usb/misc/adutux.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index 6d15a097b007..ed6a19254d2f 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -394,13 +394,10 @@ static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,
spin_lock_irqsave (&dev->buflock, flags);
if (dev->read_buffer_length) {
/* we secure access to the primary */
- char *tmp;
dev_dbg(&dev->udev->dev,
"%s : swap, read_buffer_length = %d\n",
__func__, dev->read_buffer_length);
- tmp = dev->read_buffer_secondary;
- dev->read_buffer_secondary = dev->read_buffer_primary;
- dev->read_buffer_primary = tmp;
+ swap(dev->read_buffer_primary, dev->read_buffer_secondary);
dev->secondary_head = 0;
dev->secondary_tail = dev->read_buffer_length;
dev->read_buffer_length = 0;