From: kernel test robot <lkp@intel.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, x86@kernel.org,
Thomas Gleixner <tglx@linutronix.de>
Subject: [tip:timers/ptp 39/39] lib/vdso/gettimeofday.c:335:17: warning: shift count >= width of type
Date: Tue, 8 Jul 2025 03:12:19 +0800 [thread overview]
Message-ID: <202507080348.hKtUspGk-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/ptp
head: 7893ea1006fcbb876ddf53ad4ebba4a054add4b2
commit: 7893ea1006fcbb876ddf53ad4ebba4a054add4b2 [39/39] vdso/gettimeofday: Add support for auxiliary clocks
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20250708/202507080348.hKtUspGk-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 01c97b4953e87ae455bd4c41e3de3f0f0f29c61c)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250708/202507080348.hKtUspGk-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/202507080348.hKtUspGk-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from <built-in>:4:
>> lib/vdso/gettimeofday.c:335:17: warning: shift count >= width of type [-Wshift-count-overflow]
335 | else if (msk & VDSO_AUX)
| ^~~~~~~~
include/vdso/datapage.h:50:18: note: expanded from macro 'VDSO_AUX'
50 | #define VDSO_AUX __GENMASK(CLOCK_AUX_LAST, CLOCK_AUX)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/bits.h:7:56: note: expanded from macro '__GENMASK'
7 | #define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <built-in>:4:
lib/vdso/gettimeofday.c:481:19: warning: shift count >= width of type [-Wshift-count-overflow]
481 | } else if (msk & VDSO_AUX) {
| ^~~~~~~~
include/vdso/datapage.h:50:18: note: expanded from macro 'VDSO_AUX'
50 | #define VDSO_AUX __GENMASK(CLOCK_AUX_LAST, CLOCK_AUX)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/bits.h:7:56: note: expanded from macro '__GENMASK'
7 | #define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
--
In file included from <built-in>:4:
>> lib/vdso/gettimeofday.c:335:17: warning: shift count >= width of type [-Wshift-count-overflow]
335 | else if (msk & VDSO_AUX)
| ^~~~~~~~
include/vdso/datapage.h:50:18: note: expanded from macro 'VDSO_AUX'
50 | #define VDSO_AUX __GENMASK(CLOCK_AUX_LAST, CLOCK_AUX)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/bits.h:7:56: note: expanded from macro '__GENMASK'
7 | #define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <built-in>:4:
lib/vdso/gettimeofday.c:481:19: warning: shift count >= width of type [-Wshift-count-overflow]
481 | } else if (msk & VDSO_AUX) {
| ^~~~~~~~
include/vdso/datapage.h:50:18: note: expanded from macro 'VDSO_AUX'
50 | #define VDSO_AUX __GENMASK(CLOCK_AUX_LAST, CLOCK_AUX)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/bits.h:7:56: note: expanded from macro '__GENMASK'
7 | #define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
vim +335 lib/vdso/gettimeofday.c
313
314 static __always_inline bool
315 __cvdso_clock_gettime_common(const struct vdso_time_data *vd, clockid_t clock,
316 struct __kernel_timespec *ts)
317 {
318 const struct vdso_clock *vc = vd->clock_data;
319 u32 msk;
320
321 if (!vdso_clockid_valid(clock))
322 return false;
323
324 /*
325 * Convert the clockid to a bitmask and use it to check which
326 * clocks are handled in the VDSO directly.
327 */
328 msk = 1U << clock;
329 if (likely(msk & VDSO_HRES))
330 vc = &vc[CS_HRES_COARSE];
331 else if (msk & VDSO_COARSE)
332 return do_coarse(vd, &vc[CS_HRES_COARSE], clock, ts);
333 else if (msk & VDSO_RAW)
334 vc = &vc[CS_RAW];
> 335 else if (msk & VDSO_AUX)
336 return do_aux(vd, clock, ts);
337 else
338 return false;
339
340 return do_hres(vd, vc, clock, ts);
341 }
342
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-07-07 19:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202507080348.hKtUspGk-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tglx@linutronix.de \
--cc=thomas.weissschuh@linutronix.de \
--cc=x86@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
all inboxes | Powered by JetHome®