Linux-Wireless Archive mirror
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Ping-Ke Shih <pkshih@realtek.com>, <linux-wireless@vger.kernel.org>
Cc: <rtl8821cerfe2@gmail.com>
Subject: Re: [PATCH] wifi: rtlwifi: 8192d: initialize rate_mask in rtl92de_update_hal_rate_mask()
Date: Sat, 4 May 2024 20:11:09 +0800	[thread overview]
Message-ID: <141c8359-ef40-46c0-bb0d-46e572c41317@RTEXMBS04.realtek.com.tw> (raw)
In-Reply-To: <20240504111916.31445-1-pkshih@realtek.com>

Ping-Ke Shih <pkshih@realtek.com> wrote:

> le32p_replace_bits() only updates partial bits of rate_mask, and gcc warns
> below. Set initial value to avoid warnings, and prevent random value of
> missed bits (bit 6 of rate_mask.macid_and_short_gi).
> 
> In file included from ./include/linux/fortify-string.h:5,
>                  from ./include/linux/string.h:369,
>                  from ./include/linux/bitmap.h:13,
>                  from ./include/linux/cpumask.h:13,
>                  from ./include/linux/sched.h:16,
>                  from drivers/net/wireless/realtek/rtlwifi/rtl8192d/../wifi.h:9,
>                  from drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c:4:
> In function 'le32p_replace_bits',
>     inlined from 'rtl92de_update_hal_rate_mask.isra' at drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c:986:2:
> ./include/linux/bitfield.h:189:15: warning: 'rate_mask' is used uninitialized [-Wuninitialized]
>   189 |         *p = (*p & ~to(field)) | type##_encode_bits(val, field);        \
>       |               ^~
> ./include/linux/bitfield.h:196:9: note: in expansion of macro '____MAKE_OP'
>   196 |         ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \
>       |         ^~~~~~~~~~~
> ./include/linux/bitfield.h:201:1: note: in expansion of macro '__MAKE_OP'
>   201 | __MAKE_OP(32)
>       | ^~~~~~~~~
> drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c: In function 'rtl92de_update_hal_rate_mask.isra':
> drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c:863:37: note: 'rate_mask' declared here
>   863 |         struct rtl92d_rate_mask_h2c rate_mask;
>       |                                     ^~~~~~~~~
> 
> Fixes: 014bba73b525 ("wifi: rtlwifi: Adjust rtl8192d-common for USB")
> Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

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

82b85a836a59 wifi: rtlwifi: 8192d: initialize rate_mask in rtl92de_update_hal_rate_mask()

---

This is to quickly fix GCC warning [1] to prevent blocking pull-request.

[1] https://lore.kernel.org/linux-wireless/03e00a7f47c86323f34748853ba38859b4d52695.camel@realtek.com/T/#mdcc6bc74e1600b4c6f4ac3b97a5324ef07816db4

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


      reply	other threads:[~2024-05-04 12:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04 11:19 [PATCH] wifi: rtlwifi: 8192d: initialize rate_mask in rtl92de_update_hal_rate_mask() Ping-Ke Shih
2024-05-04 12:11 ` 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=141c8359-ef40-46c0-bb0d-46e572c41317@RTEXMBS04.realtek.com.tw \
    --to=pkshih@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rtl8821cerfe2@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).