Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1702915rdb; Sun, 8 Oct 2023 22:56:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiaTbURIuYIykay+TyoremafzMet6KDAzGADRQlP+H+WcjRJtSDMNKkEAm1nLvLYXmushK X-Received: by 2002:a17:902:ee41:b0:1bc:c82:9368 with SMTP id 1-20020a170902ee4100b001bc0c829368mr14305577plo.32.1696830960744; Sun, 08 Oct 2023 22:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696830960; cv=none; d=google.com; s=arc-20160816; b=fPU3JzqMUI4Nn3+K+cSdVu8boizRHtB8fCnGDsFjPs/mz6syhVUhL/R4yxlE2tZM7T mn9zTkwemQ8ul0W+UaooB1dKQiMZesLt0hW6SFbrt9/Xpsw0cvFVxteVnjnqKZoIRObx YjpxX/z+E3Jy2N0C+r4iJV2PRQ5x9fSIAnSiqlNEVGBQx5zvcj6Jn7wXRuShEFejsU5U q0DUC2VndtRDbZ1rk+9QLaCnHxdZZdqzMvk3jKQs3yzoEASb34liEwj/Pz1dxoriGCLN m7TEMwOwZoRCAkEHGoT7ht7X1FHX28LRbLPFW525we1ygS3/8JYo1AkV2ll/Z1M7bGsp XMbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0QPY2+/eY99+F9H+gzoA4HxsiGpF3Wr8Wu5ypbnDbmY=; fh=lBPOCyUZz/c82nGgJrPaF7r9ucXW9XtlpkYp17sdRGM=; b=PxuTgMK4hmmkiSEqXBArA/hlPC8t8ygZuF2i7Xm8KhpSe14lCzZUMr+F0GlnUdMhXD fz9CrRZMUn4hdSYiR9juG57sReSaogZaB17wq0ZWPT8CGxW9R2V+KHzMBvX9aFx5g5QM AelVx4Ebmccukv3bS89oIOXos3JLm3ieMPd4wqSwSVo5VBSrh8VtVBS7x/jSL13yfcbw ECPf2P3Pn4EkSgsaWIXgmuf25Tk7M3aJ3ZrENs3auosDvUjsnGn6CZmnmQeLOJUC+r8+ B2o8sdqI42PUADHiVlwvTAYz6OkgEk9SOGZMR5WdK7EHBnYunBY9A+JHJIz93V5mu9KU 3kHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y19-20020a170903011300b001c6182d9fdasi8380788plc.326.2023.10.08.22.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 22:56:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 45CC78022091; Sun, 8 Oct 2023 22:55:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345129AbjJIFzs (ORCPT + 52 others); Mon, 9 Oct 2023 01:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345049AbjJIFzr (ORCPT ); Mon, 9 Oct 2023 01:55:47 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB21A4 for ; Sun, 8 Oct 2023 22:55:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpjEv-00042z-Kq; Mon, 09 Oct 2023 07:55:37 +0200 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpjEq-000L3W-Gp; Mon, 09 Oct 2023 07:55:32 +0200 Received: from sha by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qpjEq-00DU3G-EO; Mon, 09 Oct 2023 07:55:32 +0200 Date: Mon, 9 Oct 2023 07:55:32 +0200 From: Sascha Hauer To: Jinjie Ruan Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih , Kalle Valo , neo_jou , Hans Ulli Kroll Subject: Re: [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() Message-ID: <20231009055532.GB3114228@pengutronix.de> References: <20231008025852.1239450-1-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231008025852.1239450-1-ruanjinjie@huawei.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 08 Oct 2023 22:55:49 -0700 (PDT) X-Spam-Level: ** On Sun, Oct 08, 2023 at 10:58:52AM +0800, Jinjie Ruan wrote: > Both usb_kill_urb() and usb_free_urb() do the NULL check itself, so there > is no need to duplicate it prior to calling. > > Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support") > Signed-off-by: Jinjie Ruan > --- > drivers/net/wireless/realtek/rtw88/usb.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) Acked-by: Sascha Hauer Sascha > > diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c > index d879d7e3dc81..e6ab1ac6d709 100644 > --- a/drivers/net/wireless/realtek/rtw88/usb.c > +++ b/drivers/net/wireless/realtek/rtw88/usb.c > @@ -611,8 +611,7 @@ static void rtw_usb_cancel_rx_bufs(struct rtw_usb *rtwusb) > > for (i = 0; i < RTW_USB_RXCB_NUM; i++) { > rxcb = &rtwusb->rx_cb[i]; > - if (rxcb->rx_urb) > - usb_kill_urb(rxcb->rx_urb); > + usb_kill_urb(rxcb->rx_urb); > } > } > > @@ -623,10 +622,8 @@ static void rtw_usb_free_rx_bufs(struct rtw_usb *rtwusb) > > for (i = 0; i < RTW_USB_RXCB_NUM; i++) { > rxcb = &rtwusb->rx_cb[i]; > - if (rxcb->rx_urb) { > - usb_kill_urb(rxcb->rx_urb); > - usb_free_urb(rxcb->rx_urb); > - } > + usb_kill_urb(rxcb->rx_urb); > + usb_free_urb(rxcb->rx_urb); > } > } > > -- > 2.34.1 > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |