All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atul Kumar Pant <atulpant.linux@gmail.com>
To: gregkh@linuxfoundation.org, richard.leitner@linux.dev,
	wsa+renesas@sang-engineering.com, mhocko@suse.com,
	surenb@google.com
Cc: Atul Kumar Pant <atulpant.linux@gmail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	shuah@kernel.org
Subject: [PATCH v1] drivers: usb: Removes use of assignment in if condition
Date: Wed, 16 Aug 2023 02:11:41 +0530	[thread overview]
Message-ID: <20230815204141.51972-1-atulpant.linux@gmail.com> (raw)

This patch fixes following checkpatch.pl issue:
ERROR: do not use assignment in if condition

Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
---
 drivers/usb/core/devio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index e501a03d6c70..56899fed6bd4 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -2333,9 +2333,10 @@ static int proc_ioctl(struct usb_dev_state *ps, struct usbdevfs_ioctl *ctl)
 		}
 	}
 
+	intf = usb_ifnum_to_if(ps->dev, ctl->ifno);
 	if (ps->dev->state != USB_STATE_CONFIGURED)
 		retval = -EHOSTUNREACH;
-	else if (!(intf = usb_ifnum_to_if(ps->dev, ctl->ifno)))
+	else if (!intf)
 		retval = -EINVAL;
 	else switch (ctl->ioctl_code) {
 
-- 
2.25.1


             reply	other threads:[~2023-08-15 20:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 20:41 Atul Kumar Pant [this message]
2023-08-15 21:07 ` [PATCH v1] drivers: usb: Removes use of assignment in if condition Greg KH
2023-08-16  2:52   ` Atul Kumar Pant
2023-08-16 14:43     ` Greg KH
2023-08-16  3:43   ` Atul Kumar Pant
2023-08-16 14:42     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230815204141.51972-1-atulpant.linux@gmail.com \
    --to=atulpant.linux@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=richard.leitner@linux.dev \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.