diff mbox

[2/4,media] cpia2: Adjust two function calls together with a variable assignment

Message ID b7bd5189-926c-b48c-37af-5d764c0674ec@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

SF Markus Elfring Sept. 17, 2017, 1:32 p.m. UTC
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 mbox

Patch

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);