lkml.org 
[lkml]   [2022]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw()
On Mon, Jun 06, 2022 at 12:58:19PM +0200, Alexander Lobakin wrote:
> From: Nathan Chancellor <nathan@kernel.org>
> Date: Mon, 23 May 2022 08:05:22 -0700
>
> > Clang warns:
> >
> > drivers/misc/cardreader/rts5261.c:406:13: error: variable 'setting_reg2' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> > } else if (efuse_valid == 0) {
> > ^~~~~~~~~~~~~~~~
> > drivers/misc/cardreader/rts5261.c:412:30: note: uninitialized use occurs here
> > pci_read_config_dword(pdev, setting_reg2, &lval2);
> > ^~~~~~~~~~~~
> >
> > efuse_valid == 1 is not a valid value so just return early from the
> > function to avoid using setting_reg2 uninitialized.
> >
> > Fixes: b1c5f3085149 ("misc: rtsx: add rts5261 efuse function")
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Tom Rix <trix@redhat.com>
> > Suggested-by: Ricky WU <ricky_wu@realtek.com>
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>
> Ping? Mainline 5.19-rc1 is now broken due to this.

Perhaps use a different compiler? :)

It's in my "to apply" queue, will get there hopefully this week, it came
in during the merge window which prevented me from touching it. You
know this...

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-06-06 13:24    [W:0.092 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site