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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux