From: Kalle Valo <kvalo@codeaurora.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Ryder Lee <ryder.lee@mediatek.com>, Arnd Bergmann <arnd@arndb.de>,
linux-wireless@vger.kernel.org,
Nick Desaulniers <ndesaulniers@google.com>,
linux-kernel@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>,
clang-built-linux@googlegroups.com,
linux-mediatek@lists.infradead.org,
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org,
Felix Fietkau <nbd@nbd.name>
Subject: Re: [PATCH] [v2] mt76: mt7915: fix unused 'mode' variable
Date: Fri, 26 Feb 2021 17:37:50 +0200 [thread overview]
Message-ID: <87lfbaalgx.fsf@codeaurora.org> (raw)
In-Reply-To: <20210226142215.3482168-1-arnd@kernel.org> (Arnd Bergmann's message of "Fri, 26 Feb 2021 15:21:27 +0100")
+ linux-wireless
Arnd Bergmann <arnd@kernel.org> writes:
> From: Arnd Bergmann <arnd@arndb.de>
>
> clang points out a possible corner case in the mt7915_tm_set_tx_cont()
> function if called with invalid arguments:
>
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:593:2: warning: variable 'mode' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
> default:
> ^~~~~~~
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:597:13: note: uninitialized use occurs here
> rateval = mode << 6 | rate_idx;
> ^~~~
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:506:37: note: initialize the variable 'mode' to silence this warning
> u8 rate_idx = td->tx_rate_idx, mode;
> ^
>
> Change it to return an error instead of continuing with invalid data
> here.
>
> Fixes: 3f0caa3cbf94 ("mt76: mt7915: add support for continuous tx in testmode")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: remove the extra 'break;' after return.
> ---
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
You forgot to Cc linux-wireless and hence patchwork didn't see this, so
I applied this manually instead:
c490492f15f6 mt76: mt7915: fix unused 'mode' variable
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@codeaurora.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Felix Fietkau <nbd@nbd.name>,
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>,
Arnd Bergmann <arnd@arndb.de>, Ryder Lee <ryder.lee@mediatek.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH] [v2] mt76: mt7915: fix unused 'mode' variable
Date: Fri, 26 Feb 2021 17:37:50 +0200 [thread overview]
Message-ID: <87lfbaalgx.fsf@codeaurora.org> (raw)
In-Reply-To: <20210226142215.3482168-1-arnd@kernel.org> (Arnd Bergmann's message of "Fri, 26 Feb 2021 15:21:27 +0100")
+ linux-wireless
Arnd Bergmann <arnd@kernel.org> writes:
> From: Arnd Bergmann <arnd@arndb.de>
>
> clang points out a possible corner case in the mt7915_tm_set_tx_cont()
> function if called with invalid arguments:
>
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:593:2: warning: variable 'mode' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
> default:
> ^~~~~~~
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:597:13: note: uninitialized use occurs here
> rateval = mode << 6 | rate_idx;
> ^~~~
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:506:37: note: initialize the variable 'mode' to silence this warning
> u8 rate_idx = td->tx_rate_idx, mode;
> ^
>
> Change it to return an error instead of continuing with invalid data
> here.
>
> Fixes: 3f0caa3cbf94 ("mt76: mt7915: add support for continuous tx in testmode")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: remove the extra 'break;' after return.
> ---
> drivers/net/wireless/mediatek/mt76/mt7915/testmode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
You forgot to Cc linux-wireless and hence patchwork didn't see this, so
I applied this manually instead:
c490492f15f6 mt76: mt7915: fix unused 'mode' variable
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2021-02-26 15:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-26 14:21 [PATCH] [v2] mt76: mt7915: fix unused 'mode' variable Arnd Bergmann
2021-02-26 14:21 ` Arnd Bergmann
2021-02-26 14:21 ` Arnd Bergmann
2021-02-26 15:37 ` Kalle Valo [this message]
2021-02-26 15:37 ` Kalle Valo
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=87lfbaalgx.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi83@gmail.com \
--cc=nathan@kernel.org \
--cc=nbd@nbd.name \
--cc=ndesaulniers@google.com \
--cc=ryder.lee@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.