diff options
| author | Ming Lei <[email protected]> | 2022-07-16 17:53:44 +0800 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2022-07-16 06:32:48 -0600 |
| commit | f2450f8a2c1ec3e88d6674f747b913aa5f21fa59 (patch) | |
| tree | 785d4f0a0122b3de0199e15795e4925086fdc01a /tools/perf/scripts/python | |
| parent | 020e3618cc81abf11fe6bffaac27861ff94707ce (diff) | |
ublk_drv: fix build warning with -Wmaybe-uninitialized and one sparse warning
After applying -Wmaybe-uninitialized manually, two build warnings are
triggered:
drivers/block/ublk_drv.c:940:11: warning: ‘io’ may be used uninitialized [-Wmaybe-uninitialized]
940 | io->flags &= ~UBLK_IO_FLAG_ACTIVE;
drivers/block/ublk_drv.c: In function ‘ublk_ctrl_uring_cmd’:
drivers/block/ublk_drv.c:1531:9: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
Fix the 1st one by removing 'io->flags &= ~UBLK_IO_FLAG_ACTIVE;' which
isn't needed since the function always return successfully after setting
this flag.
Fix the 2nd one by always initializing 'ret'.
Also fix another sparse warning of 'sparse: sparse: incorrect type in return
expression' by changing return type of ublk_setup_iod().
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions