Skip to content

Commit 742e324

Browse files
committed
block/iocost: silence warning on 'last_period' potentially being unused
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@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202401102335.GiWdeIo9-lkp@intel.com/ Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent c830095 commit 742e324

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

block/blk-iocost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ static void weight_updated(struct ioc_gq *iocg, struct ioc_now *now)
12611261
static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now)
12621262
{
12631263
struct ioc *ioc = iocg->ioc;
1264-
u64 last_period, cur_period;
1264+
u64 __maybe_unused last_period, cur_period;
12651265
u64 vtime, vtarget;
12661266
int i;
12671267

0 commit comments

Comments
 (0)