From: Tejun Heo <tj@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block/iocost: silence warning on 'last_period' potentially being unused
Date: Wed, 10 Jan 2024 08:08:53 -1000 [thread overview]
Message-ID: <ZZ7dNfAZputj8DQH@slm.duckdns.org> (raw)
In-Reply-To: <06a7b6da-f3de-43cb-8ac5-bdd090a7d33b@kernel.dk>
On Wed, Jan 10, 2024 at 08:32:19AM -0700, 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@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202401102335.GiWdeIo9-lkp@intel.com/
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
next prev parent reply other threads:[~2024-01-10 18:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 15:32 [PATCH] block/iocost: silence warning on 'last_period' potentially being unused Jens Axboe
2024-01-10 15:42 ` Johannes Thumshirn
2024-01-10 18:08 ` Tejun Heo [this message]
2024-01-10 23:28 ` Chaitanya Kulkarni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZZ7dNfAZputj8DQH@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox