From: David Laight <David.Laight@ACULAB.COM>
To: 'Tejun Heo' <tj@kernel.org>
Cc: Carlos Bilbao <carlos.bilbao@amd.com>,
"josef@toxicpanda.com" <josef@toxicpanda.com>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
amd <amd@localhost.localdomain>
Subject: RE: [PATCH] blk-iocost: fix seq_printf compile type mismatch error
Date: Fri, 21 Jul 2023 08:05:59 +0000 [thread overview]
Message-ID: <fd89f72848da4569a19ec8a1ac9ec94e@AcuMS.aculab.com> (raw)
In-Reply-To: <ZLmT3mXuDlYY61w0@slm.duckdns.org>
From: Tejun Heo
> Sent: 20 July 2023 21:07
>
> On Wed, Jul 19, 2023 at 08:57:32AM +0000, David Laight wrote:
> > From: Tejun Heo
> > > Sent: 17 July 2023 19:49
> > >
> > > On Mon, Jul 17, 2023 at 09:18:52AM -0500, Carlos Bilbao wrote:
> > > > From: amd <amd@localhost.localdomain>
> > > >
> > > > Fix two type mismatch errors encountered while compiling blk-iocost.c with
> > > > GCC version 13.1.1 that involved constant operator WEIGHT_ONE. Cast the
> > > > result of the division operation to (unsigned int) to match the expected
> > > > format specifier %u in two seq_printf invocations.
> > >
> > > Can you detail the warnings? Was that on 32bit compiles?
> >
> > The problem is caused by gcc 13 changing the types of the
> > constants inside an enum to be all the same.
> >
> > The best fix is (probably) to replace all the enum used to
> > define unrelated constants with #defines.
>
> Yeah, but then you end up without any way to read that value from outside
> the kernel for BPF, drgn or any other tools which use debug info. That
> actually matters.
Some of those constants (probably including the one that forces
the enum to 'long' are very boring.
I don't remember which one caused the change, but some were
similar to 'microseconds in a second'.
In any case it is enough to split the enum.
If you really need unrelated constants to be defined in an enum
them maybe use a separate enum for each.
Using (on one line):
enum { name = constant };
may work best.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2023-07-21 8:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230717141852.153965-1-carlos.bilbao@amd.com>
2023-07-17 14:23 ` [PATCH] blk-iocost: fix seq_printf compile type mismatch error Carlos Bilbao
2023-07-17 18:49 ` Tejun Heo
2023-07-18 15:37 ` Carlos Bilbao
2023-07-20 20:05 ` Tejun Heo
2023-07-19 8:57 ` David Laight
2023-07-20 20:06 ` 'Tejun Heo'
2023-07-21 8:05 ` David Laight [this message]
2023-07-21 17:58 ` 'Tejun Heo'
2023-07-21 22:32 ` Carlos Bilbao
2023-07-22 1:14 ` Tejun Heo
2023-07-31 15:04 ` Carlos Bilbao
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=fd89f72848da4569a19ec8a1ac9ec94e@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=amd@localhost.localdomain \
--cc=axboe@kernel.dk \
--cc=carlos.bilbao@amd.com \
--cc=cgroups@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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;
as well as URLs for NNTP newsgroup(s).