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

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

 



On Tue, Oct 05, 2021 at 02:43:08PM +0100, Robert Greener wrote:
> 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 is another case where I disagree with checkpatch.pl.  There are
times when multiple assignments are appropriate; this is one of them.
So are the other ones in this patch.

Alan Stern



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

  Powered by Linux