mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 07:39:47 +00:00
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>
This commit is contained in:
parent
90059e9395
commit
e21dd90eb8
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user