lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 Jan 2023 12:16:17 -1000
From:   Tejun Heo <tj@...nel.org>
To:     Yann Droneaud <ydroneaud@...eya.com>
Cc:     Josef Bacik <josef@...icpanda.com>, Jens Axboe <axboe@...nel.dk>,
        cgroups@...r.kernel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [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@...eya.com>

There's a better patch doing this which groups the enums into two groups.
Let's do that instead.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ