linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: usbhid: Fix use assignment in if condition
       [not found] <20230711014359.11991-1-zhanglibing@cdjrlc.com>
@ 2023-07-11  1:47 ` wuyonggang001
  2023-07-11  4:09   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: wuyonggang001 @ 2023-07-11  1:47 UTC (permalink / raw)
  To: jikos, benjamin.tissoires; +Cc: linux-usb, linux-input, linux-kernel

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: usbhid: Fix use assignment in if condition
  2023-07-11  1:47 ` [PATCH] HID: usbhid: Fix use assignment in if condition wuyonggang001
@ 2023-07-11  4:09   ` Greg KH
  2023-07-12  0:53     ` Bagas Sanjaya
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2023-07-11  4:09 UTC (permalink / raw)
  To: wuyonggang001
  Cc: jikos, benjamin.tissoires, linux-usb, linux-input, linux-kernel

On Tue, Jul 11, 2023 at 09:47:06AM +0800, wuyonggang001@208suo.com wrote:
> 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;

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
  and can not be applied.  Please read the file,
  Documentation/process/email-clients.rst in order to fix this.


If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: usbhid: Fix use assignment in if condition
  2023-07-11  4:09   ` Greg KH
@ 2023-07-12  0:53     ` Bagas Sanjaya
  0 siblings, 0 replies; 3+ messages in thread
From: Bagas Sanjaya @ 2023-07-12  0:53 UTC (permalink / raw)
  To: Greg KH, wuyonggang001
  Cc: jikos, benjamin.tissoires, linux-usb, linux-input, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

On Tue, Jul 11, 2023 at 06:09:22AM +0200, Greg KH wrote:
> You are receiving this message because of the following common error(s)
> as indicated below:
> 
> - Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
>   and can not be applied.  Please read the file,
>   Documentation/process/email-clients.rst in order to fix this.

Hi Greg,

208suo.com people send their patches (including this one) using
Roundcube, which is knwon to corrupt patches as you mentioned. Maybe
I have to send Documentation/process/email-client.rst patch to mention
this, right?

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-12  0:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230711014359.11991-1-zhanglibing@cdjrlc.com>
2023-07-11  1:47 ` [PATCH] HID: usbhid: Fix use assignment in if condition wuyonggang001
2023-07-11  4:09   ` Greg KH
2023-07-12  0:53     ` Bagas Sanjaya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).