Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28323024rwd; Tue, 4 Jul 2023 17:37:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlFOYN6MM05VTa4RdCuPmz3dZ/HHLVX6JbrKG0OdeK16va2ste73li3JoNnI0pyfRVLzlNUY X-Received: by 2002:a92:cc0e:0:b0:345:d3eb:471c with SMTP id s14-20020a92cc0e000000b00345d3eb471cmr12535321ilp.28.1688517420312; Tue, 04 Jul 2023 17:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688517420; cv=none; d=google.com; s=arc-20160816; b=Srp7mW16XOc5OIcC5Z0c7yS3g8ehUeLLb+hDvYsusap9uifOM8vyv7gibthXcKBonu dDP1IcOJz68k1pAU0nfKimnH8yHbqrC2gPFhpetfy7xzM2ITLVQS6Lm1mG2n/ZSMqTvZ IDVE2x0Q2CSHLKGgTRPqmdlwreXa2L7dI6t32rk/U8tFKd+XBqMjkBh40ooTqAb1ejWY NmlDTV9B4ACQ3cNUh++MAIs1EP5hfNYHSeRgR6MePJVM7sy1uTIpZSLJZOffqgX/IrYw 8+rY8jax3Exk9pugF2nXym0rpdXsrjmr21WYC3FLz5fmXPkw2a7a4jPnEjPrGh4Ck0fW Pxmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=OXkpN89g43bkB3TyLVfkhUYjGC0uPt74p1jKXHqxL+c=; fh=SodM6y25l8FIvJgVzJ4dfjskHhJlrB2ywYuQFT9pQYA=; b=hJouUwlzdeyePLCO+7eRDdxS04e+P8mzab/YSUb+yqDsuzaYbiKw+SwX3s7BUbmjAG eJMN15nDE2+9crHO6epTT72924z+OR2oiMcTIrXIDz7yBUvwKjnd3UF/t+A5EpSN9+yb hFweRsqHeYPhVxVQxybAx8a8r2rflgK++TOfulg45gi4S7Z9PunYmHvQys2wbRu+CJTz K/EVhsgnmydjTOFYp+Vt6H0xXmtqfd42lQ8vb/fct53MxRkcC88GJWCOzz9hN3Me1YrK QtxCfkOjha45/0Ua5GPEcVDIvgeIwqkotW3JpoPZTYQD9j0VkyYGyEWNnXk1gkRmlBja w3ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a637b44000000b0055bc23bdde5si3045930pgn.176.2023.07.04.17.36.48; Tue, 04 Jul 2023 17:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbjGEART convert rfc822-to-8bit (ORCPT + 59 others); Tue, 4 Jul 2023 20:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230417AbjGEARS (ORCPT ); Tue, 4 Jul 2023 20:17:18 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF13C10EC; Tue, 4 Jul 2023 17:17:15 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3650GtYfA022836, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 3650GtYfA022836 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Wed, 5 Jul 2023 08:16:55 +0800 Received: from RTEXMBS06.realtek.com.tw (172.21.6.99) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Wed, 5 Jul 2023 08:16:59 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 5 Jul 2023 08:16:58 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d]) by RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d%5]) with mapi id 15.01.2375.007; Wed, 5 Jul 2023 08:16:58 +0800 From: Ping-Ke Shih To: Zhang Shurong CC: "kvalo@kernel.org" , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2] wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() Thread-Topic: [PATCH v2] wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() Thread-Index: AQHZrphiwDYjKTiieUyOq1vcNBvSGa+qS9AA Date: Wed, 5 Jul 2023 00:16:58 +0000 Message-ID: <023e7728935f49bf8307616691322c9f@realtek.com> References: In-Reply-To: Accept-Language: en-US, zh-TW Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.69.188] x-kse-serverinfo: RTEXMBS06.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-wireless@vger.kernel.org > -----Original Message----- > From: Zhang Shurong > Sent: Wednesday, July 5, 2023 12:55 AM > To: Ping-Ke Shih > Cc: kvalo@kernel.org; linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; Zhang Shurong > > Subject: [PATCH v2] wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() > > If there is a failure during rtw89_fw_h2c_raw() rtw89_debug_priv_send_h2c > should return negative error code instead of a positive value count. > > Fix this bug by returning correct error code. > > The changes in this version: > - fix some compile error As Larry mentioned, this should be added after delimiter '---'. > > Signed-off-by: Zhang Shurong > > update Also, remove this 'update'. > --- > drivers/net/wireless/realtek/rtw89/debug.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c > index 1db2d59d33ff..a679f79b85ec 100644 > --- a/drivers/net/wireless/realtek/rtw89/debug.c > +++ b/drivers/net/wireless/realtek/rtw89/debug.c > @@ -3026,17 +3026,18 @@ static ssize_t rtw89_debug_priv_send_h2c_set(struct file *filp, > struct rtw89_debugfs_priv *debugfs_priv = filp->private_data; > struct rtw89_dev *rtwdev = debugfs_priv->rtwdev; Move 'int err = 0' here in reverse X'mas tree order, and use 'int ret = 0' instead, so people don't need to guess if there is special meaning of 'err', which is just a regular error code. > u8 *h2c; > + int err = 0; > u16 h2c_len = count / 2; > > h2c = rtw89_hex2bin_user(rtwdev, user_buf, count); > if (IS_ERR(h2c)) > return -EFAULT; > > - rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len); > + err = rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len); > > kfree(h2c); > > - return count; > + return err ? err : count; > } > > static int > -- > 2.41.0