diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2014-05-20 06:33:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-25 16:39:19 -0400 |
commit | 444f8bda81a35ae7b1e7558e971b2dbc397d3ca9 (patch) | |
tree | 633d1675b4d0f54a6f42841576f989032d4da655 | |
parent | f57051942fa48ed75928dfa3c392c1a849ba943a (diff) |
[media] USB: as102_usb_drv.c: Remove useless return variables
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 <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/staging/media/as102/as102_usb_drv.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c index e4a69454ebeb..e6f6278e97d6 100644 --- a/drivers/staging/media/as102/as102_usb_drv.c +++ b/drivers/staging/media/as102/as102_usb_drv.c | |||
@@ -249,7 +249,7 @@ static void as102_free_usb_stream_buffer(struct as102_dev_t *dev) | |||
249 | 249 | ||
250 | static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev) | 250 | static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev) |
251 | { | 251 | { |
252 | int i, ret = 0; | 252 | int i; |
253 | 253 | ||
254 | dev->stream = usb_alloc_coherent(dev->bus_adap.usb_dev, | 254 | dev->stream = usb_alloc_coherent(dev->bus_adap.usb_dev, |
255 | MAX_STREAM_URB * AS102_USB_BUF_SIZE, | 255 | MAX_STREAM_URB * AS102_USB_BUF_SIZE, |
@@ -280,7 +280,7 @@ static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev) | |||
280 | 280 | ||
281 | dev->stream_urb[i] = urb; | 281 | dev->stream_urb[i] = urb; |
282 | } | 282 | } |
283 | return ret; | 283 | return 0; |
284 | } | 284 | } |
285 | 285 | ||
286 | static void as102_usb_stop_stream(struct as102_dev_t *dev) | 286 | static void as102_usb_stop_stream(struct as102_dev_t *dev) |
@@ -458,7 +458,6 @@ exit: | |||
458 | 458 | ||
459 | static int as102_release(struct inode *inode, struct file *file) | 459 | static int as102_release(struct inode *inode, struct file *file) |
460 | { | 460 | { |
461 | int ret = 0; | ||
462 | struct as102_dev_t *dev = NULL; | 461 | struct as102_dev_t *dev = NULL; |
463 | 462 | ||
464 | dev = file->private_data; | 463 | dev = file->private_data; |
@@ -467,7 +466,7 @@ static int as102_release(struct inode *inode, struct file *file) | |||
467 | kref_put(&dev->kref, as102_usb_release); | 466 | kref_put(&dev->kref, as102_usb_release); |
468 | } | 467 | } |
469 | 468 | ||
470 | return ret; | 469 | return 0; |
471 | } | 470 | } |
472 | 471 | ||
473 | MODULE_DEVICE_TABLE(usb, as102_usb_id_table); | 472 | MODULE_DEVICE_TABLE(usb, as102_usb_id_table); |