lkml.org 
[lkml]   [2023]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] blk-iocost: don't make all constants unsigned long long
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

\
 
 \ /
  Last update: 2023-03-26 23:27    [W:0.075 / U:1.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site