mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Qianfeng Rong <rongqianfeng@vivo.com>,
	Ping-Ke Shih <pkshih@realtek.com>,
	<linux-wireless@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Qianfeng Rong <rongqianfeng@vivo.com>
Subject: Re: [PATCH v2] wifi: rtw89: use int type to store negative error codes
Date: Mon, 1 Sep 2025 11:39:33 +0800	[thread overview]
Message-ID: <eb1ba911-a34d-4c18-a7f6-dbc75a5b4e0d@RTKEXHMBS06.realtek.com.tw> (raw)
In-Reply-To: <20250827150620.550641-1-rongqianfeng@vivo.com>

Qianfeng Rong <rongqianfeng@vivo.com> wrote:

> The 'ret' variable stores returns from other functions, which return
> either zero on success or negative error codes on failure.  Storing
> error codes in u32 (an unsigned type) causes no runtime issues but is
> stylistically inconsistent and very ugly.  Change 'ret' from u32 to
> int - this has no runtime impact.
> 
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

a650d86bcaf5 wifi: rtw89: use int type to store negative error codes

With below changes because of smatch warning:

  rtw89/mac.c:1197 rtw89_mac_hfc_init() warn: missing error code? 'ret'

Changes:

  The change of 'int' type seemingly give smatch a hint to treat 'ret'
  as error code, detecting if we miss to assign proper error code.

@@ -1194,7 +1194,7 @@ int rtw89_mac_hfc_init(struct rtw89_dev *rtwdev, bool reset, bool en, bool h2c_e
        if (!en && h2c_en) {
                mac->hfc_h2c_cfg(rtwdev);
                mac->hfc_func_en(rtwdev, en, h2c_en);
-               return ret;
+               return 0;
        }

        for (ch = RTW89_DMA_ACH0; ch < RTW89_DMA_H2C; ch++) {

---
https://github.com/pkshih/rtw.git


      parent reply	other threads:[~2025-09-01  3:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 15:06 Qianfeng Rong
2025-08-29  0:31 ` Ping-Ke Shih
2025-09-01  3:39 ` Ping-Ke Shih [this message]

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=eb1ba911-a34d-4c18-a7f6-dbc75a5b4e0d@RTKEXHMBS06.realtek.com.tw \
    --to=pkshih@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rongqianfeng@vivo.com \
    /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®