From: Tejun Heo <tj@kernel.org>
To: Yann Droneaud <ydroneaud@opteya.com>
Cc: Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blk-iocost: don't make all constants unsigned long long
Date: Wed, 4 Jan 2023 12:16:17 -1000 [thread overview]
Message-ID: <Y7X6sUDLe2CrPk8H@slm.duckdns.org> (raw)
In-Reply-To: <20221220201819.1497577-1-ydroneaud@opteya.com>
On Tue, Dec 20, 2022 at 09:18:19PM +0100, Yann Droneaud wrote:
> My shiny new compiler (GCC 13) is reporting the following
> warnings:
>
> ../block/blk-iocost.c: In function 'ioc_weight_prfill':
> ../block/blk-iocost.c:3035:37: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
> 3035 | seq_printf(sf, "%s %u\n", dname, iocg->cfg_weight / WEIGHT_ONE);
> | ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | | |
> | unsigned int long unsigned int
> | %lu
> ../block/blk-iocost.c: In function 'ioc_weight_show':
> ../block/blk-iocost.c:3045:34: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
> 3045 | seq_printf(sf, "default %u\n", iocc->dfl_weight / WEIGHT_ONE);
> | ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | | |
> | unsigned int long unsigned int
> | %lu
>
> It appears WEIGHT_ONE enum is unnecessarly unsigned long
> (or unsigned long long on 32bit) because of VTIME_PER_SEC
> and/or AUTOP_CYCLE_NSEC need the enum to be that large.
>
> Addressed by lazy splitting the "catch all" anonymous
> enum and placing the unsigned long long constants in
> their own anonymous enums.
>
> Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
There's a better patch doing this which groups the enums into two groups.
Let's do that instead.
Thanks.
--
tejun
prev parent reply other threads:[~2023-01-04 22:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 20:18 Yann Droneaud
2022-12-22 13:58 ` Michal Koutný
2023-01-04 22:15 ` Tejun Heo
2023-01-04 22:17 ` Tejun Heo
2023-01-04 22:16 ` Tejun Heo [this message]
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=Y7X6sUDLe2CrPk8H@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ydroneaud@opteya.com \
/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
all inboxes | Powered by JetHome®