* Re: [block:for-linus 20/23] include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function
[not found] <201907131730.Br9OqtbO%lkp@intel.com>
@ 2019-07-15 5:43 ` Damien Le Moal
2019-07-15 13:56 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Damien Le Moal @ 2019-07-15 5:43 UTC (permalink / raw)
To: Jens Axboe, linux-block; +Cc: Christoph Hellwig, Martin K. Petersen
On 2019/07/13 18:10, kbuild test robot wrote:
> tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/axboe/linux-block.git for-linus
> head: 787c79d6393fc028887cc1b6066915f0b094e92f
> commit: b091ac616846a1da75b1f2566b41255ce7f0e0a6 [20/23] sd_zbc: Fix report zones buffer allocation
> config: c6x-allyesconfig (attached as .config)
> compiler: c6x-elf-gcc (GCC) 7.4.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout b091ac616846a1da75b1f2566b41255ce7f0e0a6
> # save the attached .config to linux build tree
> GCC_VERSION=7.4.0 make.cross ARCH=c6x
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
> In file included from include/asm-generic/bug.h:18:0,
> from arch/c6x/include/asm/bug.h:12,
> from include/linux/bug.h:5,
> from include/linux/thread_info.h:12,
> from include/asm-generic/current.h:5,
> from ./arch/c6x/include/generated/asm/current.h:1,
> from include/linux/sched.h:12,
> from include/linux/blkdev.h:5,
> from drivers//scsi/sd_zbc.c:11:
> drivers//scsi/sd_zbc.c: In function 'sd_zbc_read_zones':
>>> include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function [-Wmaybe-uninitialized]
> #define __round_mask(x, y) ((__typeof__(x))((y)-1))
> ^
> drivers//scsi/sd_zbc.c:464:6: note: 'zone_blocks' was declared here
> u32 zone_blocks;
> ^~~~~~~~~~~
[...]
Jens,
This warning does not show up on x86_64 native build with gcc 9.1.
I just sent a patch to remove the warning, but I do not have a c6x cross
compilation environment available so the patch was checked only on x86.
Best regards.
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [block:for-linus 20/23] include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function
2019-07-15 5:43 ` [block:for-linus 20/23] include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function Damien Le Moal
@ 2019-07-15 13:56 ` Jens Axboe
2019-07-15 23:41 ` Damien Le Moal
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2019-07-15 13:56 UTC (permalink / raw)
To: Damien Le Moal, linux-block; +Cc: Christoph Hellwig, Martin K. Petersen
On 7/14/19 11:43 PM, Damien Le Moal wrote:
> On 2019/07/13 18:10, kbuild test robot wrote:
>> tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/axboe/linux-block.git for-linus
>> head: 787c79d6393fc028887cc1b6066915f0b094e92f
>> commit: b091ac616846a1da75b1f2566b41255ce7f0e0a6 [20/23] sd_zbc: Fix report zones buffer allocation
>> config: c6x-allyesconfig (attached as .config)
>> compiler: c6x-elf-gcc (GCC) 7.4.0
>> reproduce:
>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> git checkout b091ac616846a1da75b1f2566b41255ce7f0e0a6
>> # save the attached .config to linux build tree
>> GCC_VERSION=7.4.0 make.cross ARCH=c6x
>>
>> If you fix the issue, kindly add following tag
>> Reported-by: kbuild test robot <lkp@intel.com>
>>
>> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
>> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>>
>> All warnings (new ones prefixed by >>):
>>
>> In file included from include/asm-generic/bug.h:18:0,
>> from arch/c6x/include/asm/bug.h:12,
>> from include/linux/bug.h:5,
>> from include/linux/thread_info.h:12,
>> from include/asm-generic/current.h:5,
>> from ./arch/c6x/include/generated/asm/current.h:1,
>> from include/linux/sched.h:12,
>> from include/linux/blkdev.h:5,
>> from drivers//scsi/sd_zbc.c:11:
>> drivers//scsi/sd_zbc.c: In function 'sd_zbc_read_zones':
>>>> include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function [-Wmaybe-uninitialized]
>> #define __round_mask(x, y) ((__typeof__(x))((y)-1))
>> ^
>> drivers//scsi/sd_zbc.c:464:6: note: 'zone_blocks' was declared here
>> u32 zone_blocks;
>> ^~~~~~~~~~~
> [...]
>
> Jens,
>
> This warning does not show up on x86_64 native build with gcc 9.1.
> I just sent a patch to remove the warning, but I do not have a c6x cross
> compilation environment available so the patch was checked only on x86.
Is it a false positive, or is it legit?
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [block:for-linus 20/23] include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function
2019-07-15 13:56 ` Jens Axboe
@ 2019-07-15 23:41 ` Damien Le Moal
0 siblings, 0 replies; 3+ messages in thread
From: Damien Le Moal @ 2019-07-15 23:41 UTC (permalink / raw)
To: Jens Axboe, linux-block; +Cc: Christoph Hellwig, Martin K. Petersen
On 2019/07/15 22:56, Jens Axboe wrote:
> On 7/14/19 11:43 PM, Damien Le Moal wrote:
>> On 2019/07/13 18:10, kbuild test robot wrote:
>>> tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/axboe/linux-block.git for-linus
>>> head: 787c79d6393fc028887cc1b6066915f0b094e92f
>>> commit: b091ac616846a1da75b1f2566b41255ce7f0e0a6 [20/23] sd_zbc: Fix report zones buffer allocation
>>> config: c6x-allyesconfig (attached as .config)
>>> compiler: c6x-elf-gcc (GCC) 7.4.0
>>> reproduce:
>>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>> chmod +x ~/bin/make.cross
>>> git checkout b091ac616846a1da75b1f2566b41255ce7f0e0a6
>>> # save the attached .config to linux build tree
>>> GCC_VERSION=7.4.0 make.cross ARCH=c6x
>>>
>>> If you fix the issue, kindly add following tag
>>> Reported-by: kbuild test robot <lkp@intel.com>
>>>
>>> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
>>> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>>>
>>> All warnings (new ones prefixed by >>):
>>>
>>> In file included from include/asm-generic/bug.h:18:0,
>>> from arch/c6x/include/asm/bug.h:12,
>>> from include/linux/bug.h:5,
>>> from include/linux/thread_info.h:12,
>>> from include/asm-generic/current.h:5,
>>> from ./arch/c6x/include/generated/asm/current.h:1,
>>> from include/linux/sched.h:12,
>>> from include/linux/blkdev.h:5,
>>> from drivers//scsi/sd_zbc.c:11:
>>> drivers//scsi/sd_zbc.c: In function 'sd_zbc_read_zones':
>>>>> include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>> #define __round_mask(x, y) ((__typeof__(x))((y)-1))
>>> ^
>>> drivers//scsi/sd_zbc.c:464:6: note: 'zone_blocks' was declared here
>>> u32 zone_blocks;
>>> ^~~~~~~~~~~
>> [...]
>>
>> Jens,
>>
>> This warning does not show up on x86_64 native build with gcc 9.1.
>> I just sent a patch to remove the warning, but I do not have a c6x cross
>> compilation environment available so the patch was checked only on x86.
>
> Is it a false positive, or is it legit?
It is a false positive: if sd_zbc_check_zones() returns success, zone_blocks is
always initialized. The zone_blocks variable is not initialized only if
sd_zbc_check_zones() fails, but in that case this variable is not used at all.
My guess is that gcc 7.4 warning is due to the error path, while gcc 9.1 does a
better job at detecting that the variable is not used in failure cases.
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-15 23:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <201907131730.Br9OqtbO%lkp@intel.com>
2019-07-15 5:43 ` [block:for-linus 20/23] include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function Damien Le Moal
2019-07-15 13:56 ` Jens Axboe
2019-07-15 23:41 ` Damien Le Moal
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 NNTP newsgroup(s).