From: wuyonggang001@208suo.com
To: jikos@kernel.org, benjamin.tissoires@redhat.com
Cc: linux-usb@vger.kernel.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] HID: usbhid: Fix use assignment in if condition
Date: Tue, 11 Jul 2023 09:47:06 +0800 [thread overview]
Message-ID: <a4ca3852846e220cf378a664cf1c6213@208suo.com> (raw)
In-Reply-To: <20230711014359.11991-1-zhanglibing@cdjrlc.com>
Fix the following checkpatch error(s):
drivers/hid/usbhid/usbkbd.c:238:240:242:246: ERROR: do not use
assignment in if condition
Signed-off-by: Yonggang Wu <wuyonggang001@208suo.com>
---
drivers/hid/usbhid/usbkbd.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index c439ed2f16db..cde7f82b7070 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -235,15 +235,29 @@ static void usb_kbd_close(struct input_dev *dev)
static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd
*kbd)
{
- if (!(kbd->irq = usb_alloc_urb(0, GFP_KERNEL)))
+ kbd->irq = usb_alloc_urb(0, GFP_KERNEL)
+
+ if (!kbd->irq)
return -1;
- if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
+
+ kbd->led = usb_alloc_urb(0, GFP_KERNEL)
+
+ if (!kbd->led)
return -1;
- if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL,
&kbd->new_dma)))
+
+ kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbd->new_dma)
+
+ if (!kbd->new)
return -1;
- if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest),
GFP_KERNEL)))
+
+ kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL)
+
+ if (!kbd->cr)
return -1;
- if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL,
&kbd->leds_dma)))
+
+ kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL, &kbd->leds_dma)
+
+ if (!kbd->leds)
return -1;
return 0;
next parent reply other threads:[~2023-07-11 1:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230711014359.11991-1-zhanglibing@cdjrlc.com>
2023-07-11 1:47 ` wuyonggang001 [this message]
2023-07-11 4:09 ` Greg KH
2023-07-12 0:53 ` Bagas Sanjaya
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=a4ca3852846e220cf378a664cf1c6213@208suo.com \
--to=wuyonggang001@208suo.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®