public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Dan Carpenter' <dan.carpenter@linaro.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: "linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	clang-built-linux <llvm@lists.linux.dev>,
	linux-block <linux-block@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"lkft-triage@lists.linaro.org" <lkft-triage@lists.linaro.org>,
	"Linux Regressions" <regressions@lists.linux.dev>,
	Anders Roxell <anders.roxell@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Nathan Chancellor <nathan@kernel.org>,
	Jens Axboe <axboe@kernel.dk>
Subject: RE: s390: block/blk-iocost.c:1101:11: error: call to '__compiletime_assert_557' declared with 'error' attribute: clamp() low limit 1 greater than high limit active
Date: Wed, 4 Dec 2024 16:11:33 +0000	[thread overview]
Message-ID: <7920126775c74fa5915afbeedcfe2058@AcuMS.aculab.com> (raw)
In-Reply-To: <5ffa868f-cbf0-42ae-ae10-5c39b0de05e7@stanley.mountain>

From: Dan Carpenter <dan.carpenter@linaro.org>
> Sent: 04 December 2024 14:39
> 
> Let's add David to the Cc list because he's the expert on clamp().

The traceback info misses the important point.
I can't see the 'inlined from line 2225' message.

We have (line 1084):
static void __propagate_weights(struct ioc_gq *iocg, u32 active, u32 inuse,
				bool save, struct ioc_now *now)
followed by:
		inuse = clamp_t(u32, inuse, 1, active);

But line 2225 has:
	__propagate_weights(iocg, 0, 0, false, now);

With aggressive inlining the compiler sees 'active == 0'
and the lo > hi test correctly triggers.

The previous version only verified 'lo <= hi' if it was a constant
integer expression - which it isn't here.

No idea what the code is trying to do, nor what value it expects
clamp(val, 1, 0) to generate - likely to be 0 or 1 depending on
the order of the comparisons.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2024-12-04 16:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 10:31 s390: block/blk-iocost.c:1101:11: error: call to '__compiletime_assert_557' declared with 'error' attribute: clamp() low limit 1 greater than high limit active Naresh Kamboju
2024-12-04 14:39 ` Dan Carpenter
2024-12-04 16:11   ` David Laight [this message]
2024-12-04 16:50     ` Dan Carpenter
2024-12-04 17:40       ` Tejun Heo
2024-12-04 18:26         ` David Laight
2024-12-04 18:32           ` 'Tejun Heo'

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=7920126775c74fa5915afbeedcfe2058@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=anders.roxell@linaro.org \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=llvm@lists.linux.dev \
    --cc=naresh.kamboju@linaro.org \
    --cc=nathan@kernel.org \
    --cc=regressions@lists.linux.dev \
    /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