Skip to content

Commit

Permalink
[media] USB: as102_usb_drv.c: Remove useless return variables
Browse files Browse the repository at this point in the history
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
- return ret;
+ return C;
// </smpl>

Signed-off-by: Peter Senna Tschudin <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
petersenna authored and mchehab committed May 25, 2014
1 parent f570519 commit 444f8bd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/staging/media/as102/as102_usb_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static void as102_free_usb_stream_buffer(struct as102_dev_t *dev)

static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev)
{
int i, ret = 0;
int i;

dev->stream = usb_alloc_coherent(dev->bus_adap.usb_dev,
MAX_STREAM_URB * AS102_USB_BUF_SIZE,
Expand Down Expand Up @@ -280,7 +280,7 @@ static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev)

dev->stream_urb[i] = urb;
}
return ret;
return 0;
}

static void as102_usb_stop_stream(struct as102_dev_t *dev)
Expand Down Expand Up @@ -458,7 +458,6 @@ static int as102_open(struct inode *inode, struct file *file)

static int as102_release(struct inode *inode, struct file *file)
{
int ret = 0;
struct as102_dev_t *dev = NULL;

dev = file->private_data;
Expand All @@ -467,7 +466,7 @@ static int as102_release(struct inode *inode, struct file *file)
kref_put(&dev->kref, as102_usb_release);
}

return ret;
return 0;
}

MODULE_DEVICE_TABLE(usb, as102_usb_id_table);

0 comments on commit 444f8bd

Please sign in to comment.