Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36276593rwd; Mon, 10 Jul 2023 21:40:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEfEA3LN7sNNQlQC/Qmw+xWXNfVDW2nt8g/I91yOZEoQfw8KXwbzZP6z4RnZexnUtFJnUGW X-Received: by 2002:a17:906:5304:b0:993:db29:d27d with SMTP id h4-20020a170906530400b00993db29d27dmr13087213ejo.34.1689050400862; Mon, 10 Jul 2023 21:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689050400; cv=none; d=google.com; s=arc-20160816; b=OTBHLrEma9ctV8IHv8pXrfbYX7OLH6P1kFgUk86en1QoWNiKDTFKlpmy8yyfoFBG4o RSKLN0rviIPLjvkzGPzM4E9Rg8lEQiSVFXyaV6MFm7TQM+uB29Pf8PjxAsMll8TNvVXy BNunvocLZwHPra2PyHpZHjd9zge8jYwxjk+aPzBLxuSO81ytnseQUVTdICweeTz4+yrM lPCQ1/+G3zxPfs/3mqb2w6BjSwGWCHvvjc3qXAPoc1aHtNicA+GzevmZ1LD3bIaMk9mQ er6ETv/Lu8IcficqkRhPhkoYF3LFEBBaEgIZubpghVQnPDdA3La9Mb7s9JKaqnwcfIyA u0sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Gr88q1r/2kCX6y5Y9N5wD8z7p2ABUDqs3cMyHSQkzTU=; fh=9nQo06UoT6v6DeBwvfTApDxa0G0+1ry8pGCm0I/QXjY=; b=VPvd9guDBnAEP+vchq15NtfgBoQsM1egYyI/f2KGsNB1hv51oy5U558KLqP4UJLj5C iXrFcCrK17s40UyStnk3HncxFfHoa97Z5uO0OlRdzhLe8986RpAkL0yVfMt5XgtA/7XL D13MoTdso4kUaVAZHlqziIsiM7mKVjcvIx1rWa5rewC/9a+RA2vK2Kbey04qKQn+wUI8 SpYjGgF7kA4+o6SlbyBYQ0wQ1wzaPdYwLiYldSVzBak6Y5+PNwK6rQLkifbBftQkUd4W ev6kXLxcRk3/z6vRXMpd3TrsCLqhCa/mgkf2eBN3twOGnZHhW/lg7hge/8zKXFbrfghT +o8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ctoFXbYO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a170906709200b009934728f33bsi1146333ejk.533.2023.07.10.21.39.37; Mon, 10 Jul 2023 21:40:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ctoFXbYO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229911AbjGKEJ3 (ORCPT + 99 others); Tue, 11 Jul 2023 00:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjGKEJ2 (ORCPT ); Tue, 11 Jul 2023 00:09:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01B58B0; Mon, 10 Jul 2023 21:09:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9002C612CA; Tue, 11 Jul 2023 04:09:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74CE1C433C8; Tue, 11 Jul 2023 04:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689048566; bh=1nMmpV3CVV4TbzRvPkAb9n7aZZSr8i4Jl6Q0Ss4Rmfs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ctoFXbYOCpWpvWu+Fh62F+//ohxNPdpGuO6F346FfP4zFgFe1RSL+5PLthQicXRiB mQ7ah+hR7xtWAiJN1pb5uBmTVNawA1SrnBCemjBGHcHtZz0HVIQ83i6hjwCHg8Gtai a4UasTNCoQwW+3o8VcIqvVvoD8p9M0rzli0t5N+c= Date: Tue, 11 Jul 2023 06:09:22 +0200 From: Greg KH To: wuyonggang001@208suo.com Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: usbhid: Fix use assignment in if condition Message-ID: <2023071100-recoup-rebuild-c55a@gregkh> References: <20230711014359.11991-1-zhanglibing@cdjrlc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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