From: kernel test robot <lkp@intel.com>
To: David Laight <David.Laight@aculab.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
LKML <linux-kernel@vger.kernel.org>,
'Arnd Bergmann' <arnd@kernel.org>, 'Jens Axboe' <axboe@kernel.dk>,
'Matthew Wilcox' <willy@infradead.org>,
'Christoph Hellwig' <hch@infradead.org>,
'Andrew Morton' <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>,
'Dan Carpenter' <dan.carpenter@linaro.org>,
"'Jason A . Donenfeld'" <Jason@zx2c4.com>,
"'pedro.falcato@gmail.com'" <pedro.falcato@gmail.com>,
'Mateusz Guzik' <mjguzik@gmail.com>,
'Lorenzo Stoakes' <lorenzo.stoakes@oracle.com>
Subject: Re: [PATCH next 6/7] minmax.h: Simplify the variants of clamp()
Date: Thu, 28 Nov 2024 23:05:06 +0800 [thread overview]
Message-ID: <202411282222.oF0B4110-lkp@intel.com> (raw)
In-Reply-To: <8f69f4deac014f558bab186444bac2e8@AcuMS.aculab.com>
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20241121]
url: https://github.com/intel-lab-lkp/linux/commits/David-Laight/minmax-h-Add-whitespace-around-operators-and-after-commas/20241121-152617
base: next-20241121
patch link: https://lore.kernel.org/r/8f69f4deac014f558bab186444bac2e8%40AcuMS.aculab.com
patch subject: [PATCH next 6/7] minmax.h: Simplify the variants of clamp()
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20241128/202411282222.oF0B4110-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241128/202411282222.oF0B4110-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411282222.oF0B4110-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/iio/magnetometer/yamaha-yas530.c:30:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/s390/include/asm/elf.h:181:
In file included from arch/s390/include/asm/mmu_context.h:11:
In file included from arch/s390/include/asm/pgalloc.h:18:
In file included from include/linux/mm.h:2223:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/iio/magnetometer/yamaha-yas530.c:414:20: warning: implicit conversion from 'unsigned long' to 'typeof (h[i])' (aka 'int') changes value from 18446744073709543424 to -8192 [-Wconstant-conversion]
414 | clamp_val(h[i], -BIT(13), BIT(13) - 1);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:233:66: note: expanded from macro 'clamp_val'
233 | #define clamp_val(val, lo, hi) __careful_clamp(typeof(val), val, lo, hi)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
include/linux/minmax.h:197:26: note: expanded from macro '__careful_clamp'
197 | __clamp_once(type, val, lo, hi, __UNIQUE_ID(v_), __UNIQUE_ID(l_), __UNIQUE_ID(h_))
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:188:14: note: expanded from macro '__clamp_once'
188 | type ulo = (lo); \
| ~~~ ^~
5 warnings generated.
vim +414 drivers/iio/magnetometer/yamaha-yas530.c
de8860b1ed4701 Linus Walleij 2020-12-24 358
65f79b50103067 Jakob Hauser 2022-08-13 359 /**
65f79b50103067 Jakob Hauser 2022-08-13 360 * yas537_measure() - Make a measure from the hardware
65f79b50103067 Jakob Hauser 2022-08-13 361 * @yas5xx: The device state
65f79b50103067 Jakob Hauser 2022-08-13 362 * @t: the raw temperature measurement
65f79b50103067 Jakob Hauser 2022-08-13 363 * @x: the raw x axis measurement
65f79b50103067 Jakob Hauser 2022-08-13 364 * @y1: the y1 axis measurement
65f79b50103067 Jakob Hauser 2022-08-13 365 * @y2: the y2 axis measurement
65f79b50103067 Jakob Hauser 2022-08-13 366 * @return: 0 on success or error code
65f79b50103067 Jakob Hauser 2022-08-13 367 */
65f79b50103067 Jakob Hauser 2022-08-13 368 static int yas537_measure(struct yas5xx *yas5xx, u16 *t, u16 *x, u16 *y1, u16 *y2)
de8860b1ed4701 Linus Walleij 2020-12-24 369 {
65f79b50103067 Jakob Hauser 2022-08-13 370 struct yas5xx_calibration *c = &yas5xx->calibration;
65f79b50103067 Jakob Hauser 2022-08-13 371 unsigned int busy;
65f79b50103067 Jakob Hauser 2022-08-13 372 u8 data[8];
65f79b50103067 Jakob Hauser 2022-08-13 373 u16 xy1y2[3];
65f79b50103067 Jakob Hauser 2022-08-13 374 s32 h[3], s[3];
65f79b50103067 Jakob Hauser 2022-08-13 375 int i, ret;
65f79b50103067 Jakob Hauser 2022-08-13 376
65f79b50103067 Jakob Hauser 2022-08-13 377 mutex_lock(&yas5xx->lock);
65f79b50103067 Jakob Hauser 2022-08-13 378
65f79b50103067 Jakob Hauser 2022-08-13 379 /* Contrary to YAS530/532, also a "cont" bit is set, meaning unknown */
65f79b50103067 Jakob Hauser 2022-08-13 380 ret = regmap_write(yas5xx->map, YAS537_MEASURE, YAS5XX_MEASURE_START |
65f79b50103067 Jakob Hauser 2022-08-13 381 YAS5XX_MEASURE_CONT);
65f79b50103067 Jakob Hauser 2022-08-13 382 if (ret < 0)
65f79b50103067 Jakob Hauser 2022-08-13 383 goto out_unlock;
65f79b50103067 Jakob Hauser 2022-08-13 384
65f79b50103067 Jakob Hauser 2022-08-13 385 /* Use same timeout like YAS530/532 but the bit is in data row 2 */
65f79b50103067 Jakob Hauser 2022-08-13 386 ret = regmap_read_poll_timeout(yas5xx->map, YAS5XX_MEASURE_DATA + 2, busy,
65f79b50103067 Jakob Hauser 2022-08-13 387 !(busy & YAS5XX_MEASURE_DATA_BUSY),
65f79b50103067 Jakob Hauser 2022-08-13 388 500, 20000);
65f79b50103067 Jakob Hauser 2022-08-13 389 if (ret) {
65f79b50103067 Jakob Hauser 2022-08-13 390 dev_err(yas5xx->dev, "timeout waiting for measurement\n");
65f79b50103067 Jakob Hauser 2022-08-13 391 goto out_unlock;
65f79b50103067 Jakob Hauser 2022-08-13 392 }
65f79b50103067 Jakob Hauser 2022-08-13 393
65f79b50103067 Jakob Hauser 2022-08-13 394 ret = regmap_bulk_read(yas5xx->map, YAS5XX_MEASURE_DATA,
65f79b50103067 Jakob Hauser 2022-08-13 395 data, sizeof(data));
65f79b50103067 Jakob Hauser 2022-08-13 396 if (ret)
65f79b50103067 Jakob Hauser 2022-08-13 397 goto out_unlock;
65f79b50103067 Jakob Hauser 2022-08-13 398
65f79b50103067 Jakob Hauser 2022-08-13 399 mutex_unlock(&yas5xx->lock);
65f79b50103067 Jakob Hauser 2022-08-13 400
65f79b50103067 Jakob Hauser 2022-08-13 401 *t = get_unaligned_be16(&data[0]);
65f79b50103067 Jakob Hauser 2022-08-13 402 xy1y2[0] = FIELD_GET(GENMASK(13, 0), get_unaligned_be16(&data[2]));
65f79b50103067 Jakob Hauser 2022-08-13 403 xy1y2[1] = get_unaligned_be16(&data[4]);
65f79b50103067 Jakob Hauser 2022-08-13 404 xy1y2[2] = get_unaligned_be16(&data[6]);
65f79b50103067 Jakob Hauser 2022-08-13 405
65f79b50103067 Jakob Hauser 2022-08-13 406 /* The second version of YAS537 needs to include calibration coefficients */
65f79b50103067 Jakob Hauser 2022-08-13 407 if (yas5xx->version == YAS537_VERSION_1) {
65f79b50103067 Jakob Hauser 2022-08-13 408 for (i = 0; i < 3; i++)
65f79b50103067 Jakob Hauser 2022-08-13 409 s[i] = xy1y2[i] - BIT(13);
65f79b50103067 Jakob Hauser 2022-08-13 410 h[0] = (c->k * (128 * s[0] + c->a2 * s[1] + c->a3 * s[2])) / BIT(13);
65f79b50103067 Jakob Hauser 2022-08-13 411 h[1] = (c->k * (c->a4 * s[0] + c->a5 * s[1] + c->a6 * s[2])) / BIT(13);
65f79b50103067 Jakob Hauser 2022-08-13 412 h[2] = (c->k * (c->a7 * s[0] + c->a8 * s[1] + c->a9 * s[2])) / BIT(13);
65f79b50103067 Jakob Hauser 2022-08-13 413 for (i = 0; i < 3; i++) {
65f79b50103067 Jakob Hauser 2022-08-13 @414 clamp_val(h[i], -BIT(13), BIT(13) - 1);
65f79b50103067 Jakob Hauser 2022-08-13 415 xy1y2[i] = h[i] + BIT(13);
65f79b50103067 Jakob Hauser 2022-08-13 416 }
65f79b50103067 Jakob Hauser 2022-08-13 417 }
65f79b50103067 Jakob Hauser 2022-08-13 418
65f79b50103067 Jakob Hauser 2022-08-13 419 *x = xy1y2[0];
65f79b50103067 Jakob Hauser 2022-08-13 420 *y1 = xy1y2[1];
65f79b50103067 Jakob Hauser 2022-08-13 421 *y2 = xy1y2[2];
65f79b50103067 Jakob Hauser 2022-08-13 422
65f79b50103067 Jakob Hauser 2022-08-13 423 return 0;
65f79b50103067 Jakob Hauser 2022-08-13 424
65f79b50103067 Jakob Hauser 2022-08-13 425 out_unlock:
65f79b50103067 Jakob Hauser 2022-08-13 426 mutex_unlock(&yas5xx->lock);
65f79b50103067 Jakob Hauser 2022-08-13 427 return ret;
65f79b50103067 Jakob Hauser 2022-08-13 428 }
65f79b50103067 Jakob Hauser 2022-08-13 429
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-11-28 15:06 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 19:09 [PATCH next 0/7] minmax.h: Cleanups and minor optimisations David Laight
2024-11-18 19:11 ` [PATCH next 1/7] minmax.h: Add whitespace around operators and after commas David Laight
2024-11-18 19:12 ` [PATCH next 2/7] minmax.h: Update some comments David Laight
2024-11-18 19:12 ` [PATCH next 3/7] minmax.h: Reduce the #define expansion of min(), max() and clamp() David Laight
2024-11-18 19:13 ` [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp() David Laight
2025-01-18 16:13 ` Buiild error in i915/xe (was: [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()) Guenter Roeck
2025-01-18 17:09 ` David Laight
2025-01-18 17:49 ` Guenter Roeck
2025-01-18 18:09 ` David Laight
2025-01-18 18:36 ` Buiild error in i915/xe Guenter Roeck
2025-01-18 21:18 ` David Laight
2025-01-18 21:38 ` Guenter Roeck
2025-01-18 21:21 ` Buiild error in i915/xe (was: [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()) Linus Torvalds
2025-01-18 21:59 ` Buiild error in i915/xe Guenter Roeck
2025-01-18 22:04 ` Linus Torvalds
2025-01-18 22:11 ` Buiild error in i915/xe (was: [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()) David Laight
2025-01-18 22:58 ` Buiild error in i915/xe Guenter Roeck
2025-01-19 9:09 ` David Laight
2025-01-20 10:48 ` Jani Nikula
2025-01-20 11:15 ` David Laight
2025-01-20 11:21 ` Jani Nikula
2025-01-20 14:15 ` Guenter Roeck
2025-01-20 18:41 ` David Laight
2025-01-20 18:55 ` Andy Shevchenko
2025-01-20 19:14 ` Linus Torvalds
2025-01-21 5:58 ` Guenter Roeck
2025-01-18 23:24 ` Buiild error in i915/xe (was: [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()) Pedro Falcato
2024-11-18 19:14 ` [PATCH next 5/7] minmax.h: Move all the clamp() definitions after the min/max() ones David Laight
2024-11-18 19:15 ` [PATCH next 6/7] minmax.h: Simplify the variants of clamp() David Laight
2024-11-22 20:20 ` kernel test robot
2024-11-28 15:05 ` kernel test robot [this message]
2024-11-28 15:52 ` David Laight
2024-11-18 19:15 ` [PATCH next 7/7] minmax.h: Remove some #defines that are only expanded once David Laight
2025-01-18 17:56 ` ✓ CI.Patch_applied: success for Buiild error in i915/xe (was: [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()) Patchwork
2025-01-18 17:56 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-18 17:57 ` ✓ CI.KUnit: success " Patchwork
2025-01-18 18:16 ` ✓ CI.Build: " Patchwork
2025-01-18 18:18 ` ✓ CI.Hooks: " Patchwork
2025-01-18 18:19 ` ✓ CI.checksparse: " Patchwork
2025-01-18 18:37 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2025-01-18 18:46 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-18 18:51 ` ✗ i915.CI.BAT: failure " Patchwork
2025-01-18 20:30 ` ✗ Xe.CI.Full: " Patchwork
2025-01-18 22:08 ` ✗ Fi.CI.BUILD: failure for Buiild error in i915/xe (was: [PATCH next 4/7] minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()) (rev2) Patchwork
2025-01-18 22:10 ` ✗ CI.Patch_applied: " Patchwork
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=202411282222.oF0B4110-lkp@intel.com \
--to=lkp@intel.com \
--cc=David.Laight@aculab.com \
--cc=Jason@zx2c4.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@kernel.org \
--cc=axboe@kernel.dk \
--cc=dan.carpenter@linaro.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=lorenzo.stoakes@oracle.com \
--cc=mjguzik@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pedro.falcato@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.