Damien Le Moal 0cdc58580b scsi: sd_zbc: Fix compilation warning
kbuild test robot gets the following compilation warning using gcc 7.4
cross compilation for c6x (GCC_VERSION=7.4.0 make.cross ARCH=c6x).

   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;
         ^~~~~~~~~~~

This is a false-positive report. The variable zone_blocks is always
initialized in sd_zbc_check_zones() before use. It is not initialized
only and only if sd_zbc_check_zones() fails.

Avoid this warning by initializing the zone_blocks variable to 0.

Fixes: 5f832a395859 ("scsi: sd_zbc: Fix sd_zbc_check_zones() error checks")
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-07-16 22:37:22 -04:00
..
2018-12-18 23:19:21 -05:00
2019-05-08 10:12:46 -07:00
2019-05-08 10:12:46 -07:00
2019-03-09 16:53:47 -08:00
2019-05-21 06:16:22 -04:00
2019-05-08 10:12:46 -07:00
2019-03-02 11:39:54 -08:00
2018-12-18 23:19:21 -05:00
2018-06-19 22:02:25 -04:00
2018-12-18 23:19:21 -05:00
2019-06-18 19:46:23 -04:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:58:35 -05:00
2018-12-18 23:19:21 -05:00
2019-06-18 19:46:18 -04:00
2019-06-18 19:46:18 -04:00
2018-12-18 23:19:21 -05:00
2018-11-06 21:31:28 -05:00
2019-05-21 06:16:22 -04:00
2018-12-18 23:19:21 -05:00
2018-12-28 14:48:06 -08:00
2019-03-09 16:53:47 -08:00
2018-06-19 22:02:25 -04:00
2019-07-16 22:37:22 -04:00
2019-06-18 19:46:17 -04:00
2019-02-12 22:33:00 -05:00
2019-05-21 06:16:23 -04:00
2019-05-21 06:16:23 -04:00
2018-12-18 23:19:21 -05:00
2019-05-21 06:16:23 -04:00
2019-06-18 19:46:18 -04:00
2018-12-18 23:19:21 -05:00
2019-06-20 15:37:02 -04:00