Commit e6f9e13b authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Greg Kroah-Hartman

usb: misc: sisusbvga: compress return logic into one line

Simplify return logic to avoid unnecessary variable declaration
and assignment.

These issues were detected using Coccinelle and the following
semantic patch:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 992510f3
...@@ -610,13 +610,11 @@ static int sisusb_write_memio_byte(struct sisusb_usb_data *sisusb, int type, ...@@ -610,13 +610,11 @@ static int sisusb_write_memio_byte(struct sisusb_usb_data *sisusb, int type,
u32 addr, u8 data) u32 addr, u8 data)
{ {
struct sisusb_packet packet; struct sisusb_packet packet;
int ret;
packet.header = (1 << (addr & 3)) | (type << 6); packet.header = (1 << (addr & 3)) | (type << 6);
packet.address = addr & ~3; packet.address = addr & ~3;
packet.data = data << ((addr & 3) << 3); packet.data = data << ((addr & 3) << 3);
ret = sisusb_send_packet(sisusb, 10, &packet); return sisusb_send_packet(sisusb, 10, &packet);
return ret;
} }
static int sisusb_write_memio_word(struct sisusb_usb_data *sisusb, int type, static int sisusb_write_memio_word(struct sisusb_usb_data *sisusb, int type,
...@@ -1333,13 +1331,11 @@ static int sisusb_write_pci_config(struct sisusb_usb_data *sisusb, ...@@ -1333,13 +1331,11 @@ static int sisusb_write_pci_config(struct sisusb_usb_data *sisusb,
int regnum, u32 data) int regnum, u32 data)
{ {
struct sisusb_packet packet; struct sisusb_packet packet;
int ret;
packet.header = 0x008f; packet.header = 0x008f;
packet.address = regnum | 0x10000; packet.address = regnum | 0x10000;
packet.data = data; packet.data = data;
ret = sisusb_send_packet(sisusb, 10, &packet); return sisusb_send_packet(sisusb, 10, &packet);
return ret;
} }
static int sisusb_read_pci_config(struct sisusb_usb_data *sisusb, static int sisusb_read_pci_config(struct sisusb_usb_data *sisusb,
...@@ -2982,14 +2978,11 @@ static long sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2982,14 +2978,11 @@ static long sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static long sisusb_compat_ioctl(struct file *f, unsigned int cmd, static long sisusb_compat_ioctl(struct file *f, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
long retval;
switch (cmd) { switch (cmd) {
case SISUSB_GET_CONFIG_SIZE: case SISUSB_GET_CONFIG_SIZE:
case SISUSB_GET_CONFIG: case SISUSB_GET_CONFIG:
case SISUSB_COMMAND: case SISUSB_COMMAND:
retval = sisusb_ioctl(f, cmd, arg); return sisusb_ioctl(f, cmd, arg);
return retval;
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment