lkml.org 
[lkml]   [2017]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/4] [media] cpia2: Adjust two function calls together with a variable assignment
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 17 Sep 2017 12:56:50 +0200

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/usb/cpia2/cpia2_usb.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c
index c6be2786a66f..161c9b827f8e 100644
--- a/drivers/media/usb/cpia2/cpia2_usb.c
+++ b/drivers/media/usb/cpia2/cpia2_usb.c
@@ -367,7 +367,8 @@ static void cpia2_usb_complete(struct urb *urb)
if(cam->streaming) {
/* resubmit */
urb->dev = cam->dev;
- if ((i = usb_submit_urb(urb, GFP_ATOMIC)) != 0)
+ i = usb_submit_urb(urb, GFP_ATOMIC);
+ if (i != 0)
ERR("%s: usb_submit_urb ret %d!\n", __func__, i);
}
}
@@ -852,5 +853,5 @@ static int cpia2_usb_probe(struct usb_interface *intf,
}

-
- if((ret = cpia2_init_camera(cam)) < 0) {
+ ret = cpia2_init_camera(cam);
+ if (ret < 0) {
ERR("%s: failed to initialize cpia2 camera (ret = %d)\n", __func__, ret);
--
2.14.1
\
 
 \ /
  Last update: 2017-09-17 15:34    [W:0.043 / U:3.908 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site