[PATCH 12/13] usb: core: config: remove multiple assignments

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

 



This fixes the following checkpatch.pl warning at multiple locations:

CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided

Signed-off-by: Robert Greener <rob@xxxxxxxxxxxxxx>
---
 drivers/usb/core/config.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index ab3395ec4260..1fe995a66182 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -342,7 +342,8 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
 			 */
 			if (udev->quirks & USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL) {
 				n = clamp(fls(d->bInterval) + 3, i, j);
-				i = j = n;
+				j = n;
+				i = j;
 			}
 			/*
 			 * This quirk fixes bIntervals reported in
@@ -350,7 +351,8 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
 			 */
 			if (udev->quirks & USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL) {
 				n = clamp(fls(d->bInterval), i, j);
-				i = j = n;
+				j = n;
+				i = j;
 			}
 			break;
 		default:		/* USB_SPEED_FULL or _LOW */
@@ -554,7 +556,8 @@ static int usb_parse_interface(struct device *ddev, int cfgno,
 	size -= i;
 
 	/* Allocate space for the right(?) number of endpoints */
-	num_ep = num_ep_orig = alt->desc.bNumEndpoints;
+	num_ep_orig = alt->desc.bNumEndpoints;
+	num_ep = num_ep_orig;
 	alt->desc.bNumEndpoints = 0;		/* Use as a counter */
 	if (num_ep > USB_MAXENDPOINTS) {
 		dev_warn(ddev,
@@ -616,7 +619,8 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
 	unsigned int iad_num = 0;
 
 	memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE);
-	nintf = nintf_orig = config->desc.bNumInterfaces;
+	nintf_orig = config->desc.bNumInterfaces;
+	nintf = nintf_orig;
 	config->desc.bNumInterfaces = 0;	// Adjusted later
 
 	if (config->desc.bDescriptorType != USB_DT_CONFIG ||
@@ -741,7 +745,8 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
 			 cfgno, n, plural(n), nintf_orig);
 	else if (n == 0)
 		dev_warn(ddev, "config %d has no interfaces?\n", cfgno);
-	config->desc.bNumInterfaces = nintf = n;
+	nintf = n;
+	config->desc.bNumInterfaces = nintf;
 
 	/* Check for missing interface numbers */
 	for (i = 0; i < nintf; ++i) {
@@ -762,7 +767,8 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
 			dev_warn(ddev,
 				 "too many alternate settings for config %d interface %d: %d, using maximum allowed: %d\n",
 				 cfgno, inums[i], j, USB_MAXALTSETTING);
-			nalts[i] = j = USB_MAXALTSETTING;
+			j = USB_MAXALTSETTING;
+			nalts[i] = j;
 		}
 
 		intfc = kzalloc(struct_size(intfc, altsetting, j), GFP_KERNEL);
@@ -867,7 +873,8 @@ int usb_get_configuration(struct usb_device *dev)
 		dev_warn(ddev,
 			 "too many configurations: %d, using maximum allowed: %d\n",
 			 ncfg, USB_MAXCONFIG);
-		dev->descriptor.bNumConfigurations = ncfg = USB_MAXCONFIG;
+		ncfg = USB_MAXCONFIG;
+		dev->descriptor.bNumConfigurations = ncfg;
 	}
 
 	if (ncfg < 1) {
-- 
2.32.0




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux