mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Mark Brown <broonie@kernel.org>
Cc: Colin Ian King <colin.i.king@gmail.com>,
	Oder Chiou <oder_chiou@realtek.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Jack Yu <jack.yu@realtek.com>,
	linux-sound@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] ASoC: rt-sdw-common: Fix bit-wise or'ing of values into uninitialized variable ret
Date: Tue, 8 Oct 2024 21:28:07 +0300	[thread overview]
Message-ID: <84edfcd4-02f3-4cd0-90d8-eb5f3cdabec5@stanley.mountain> (raw)
In-Reply-To: <ZwVmCNAVSOgqT6Qd@finisterre.sirena.org.uk>

On Tue, Oct 08, 2024 at 06:04:08PM +0100, Mark Brown wrote:
> On Tue, Oct 08, 2024 at 05:47:07PM +0100, Colin Ian King wrote:
> > There are a handful of bit-wise or'ing of values into the uninitialized
> > variable ret resulting in garbage results. Fix this by ininitializing
> > ret to zero.
> 
> I'm very disappinted in the compiler for not noticing this :(

We disabled GCC's uninitialized variable check years ago before we enabled
-Werror.  Clang does catch this.

  CC      sound/soc/codecs/rt-sdw-common.o
sound/soc/codecs/rt-sdw-common.c:119:3: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
                ret |= SND_JACK_BTN_2;
                ^~~
sound/soc/codecs/rt-sdw-common.c:111:9: note: initialize the variable 'ret' to silence this warning
        int ret;
               ^
                = 0

regards,
dan carpenter


  reply	other threads:[~2024-10-08 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 16:47 Colin Ian King
2024-10-08 17:04 ` Mark Brown
2024-10-08 18:28   ` Dan Carpenter [this message]
2024-10-09  2:16   ` Jack Yu

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=84edfcd4-02f3-4cd0-90d8-eb5f3cdabec5@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=broonie@kernel.org \
    --cc=colin.i.king@gmail.com \
    --cc=jack.yu@realtek.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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®