Re: [PATCH] block/iocost: silence warning on 'last_period' potentially being unused

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/10/2024 7:32 AM, Jens Axboe wrote:
> If CONFIG_TRACEPOINTS isn't enabled, we assign this variable but then
> never use it. This can cause the compiler to complain about that:
> 
> block/blk-iocost.c:1264:6: warning: variable 'last_period' set but not used [-Wunused-but-set-variable]
>   1264 |         u64 last_period, cur_period;
>        |             ^
> 
> Rather than add ifdefs to guard this, just mark it __maybe_unused.
> 
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202401102335.GiWdeIo9-lkp@xxxxxxxxx/
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
> 
> ---
>

much cleaner than ifdef for sure...

Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>

-ck






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux