From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E5272BFC60 for ; Wed, 30 Sep 2026 05:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790745227; cv=none; b=HhYIxF2rtvLJoU1T9iUxHFf44cG5uK/fgcjmXAF6jkYsqnF+QOb26tXGvz5tidl1XccrHI6u0AqGHjRCnFGus4tJ31X7TjX4H6BLxWIOMxopvRSDlpvraezuPIhTmUW5aXQRpJnXbK6V0j/6WAOOY2JCl+G4gvxHkJ0aAVYZPVE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790745227; c=relaxed/simple; bh=H/tmicNDpxUtvIke845g59poB6J8KdJJDFYK44XO+ZI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=G20e9mxIHhBdpjG7D7tqUZ7j1pE5yu2ANxAsspRckdtpcz8TqsiqimhSR9I1KiaiD80AcLUZyvGm1oPvor7mqNkArimT0BmKx4aHl544dK9eV30lsH8zIE8mVbTFDCB0Xw0Dg82JOnyjZhScO7LicQy966nMS9ovgr/+GPvSXL4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Q+pBMBW+; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Q+pBMBW+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1790745226; x=1822281226; h=date:from:to:cc:subject:message-id:mime-version: content-transfer-encoding; bh=H/tmicNDpxUtvIke845g59poB6J8KdJJDFYK44XO+ZI=; b=Q+pBMBW+GbopBxQrfdsE0QdJcx6XDpGwF6n1ZNDQfOOyYYkOgkKxInqY C4G+OSh/nhBgGs5JlUXQoSD83siJocjYWUTgR3IZG61TkTOst6/xIo46Q OIZzn+N1X1qql5ic0naEDDcrMJbcTKSK4gHltRqLtXizoF2eFiLWp2oen 2tvjlRcdI4pfVlyQSwolK2hP0nKBxdoUwfzXk/Puk8CcaXOkwBnM5IUFm 2B7Qz698VyjTbWtlputRw06a0aeecTEZSSMvpyT2AZC4ttqYqEIumWKnZ XdPH9weTTwA27NLGo8fYEqdl/EYRv3QkDZqC/vdcX/Ahpq1q92eUWkF6r A==; X-CSE-ConnectionGUID: X/Ph1ESKTHi/yPfqcfcTJA== X-CSE-MsgGUID: rxZvbyg5ToGuurX7WMYdig== X-IronPort-AV: E=McAfee;i="6800,10657,11920"; a="90516874" X-IronPort-AV: E=Sophos;i="6.27,132,1787036400"; d="scan'208";a="90516874" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2026 22:13:45 -0700 X-CSE-ConnectionGUID: nT7239o8QnSnaakxcWdIsA== X-CSE-MsgGUID: 3kfvvcuAQdi3YQQRKvcHmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,132,1787036400"; d="scan'208";a="274694669" Received: from lkp-server01.sh.intel.com (HELO 462990a40a85) ([10.239.97.150]) by orviesa008.jf.intel.com with ESMTP; 29 Sep 2026 22:13:44 -0700 Received: from kbuild by 462990a40a85 with local (Exim 4.98.2) (envelope-from ) id 1xBmdR-00000000QA0-0gbV; Wed, 30 Sep 2026 05:13:41 +0000 Date: Wed, 30 Sep 2026 13:13:05 +0800 From: kernel test robot To: David Woodhouse Cc: oe-kbuild-all@lists.linux.dev Subject: [dwmw2:timekeeping 10/14] kernel/time/timekeeping.c:2957:56: warning: left shift count >= width of type Message-ID: <202609301335.NZqudgSP-lkp@intel.com> User-Agent: s-nail v14.9.25 Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tree: git://git.infradead.org/users/dwmw2/linux timekeeping head: 6000baa1ec08e9e0880ad0b51db6574882d09ae1 commit: ff4e31e721392e007b2b38a9815e3c01f497ce2d [10/14] timekeeping: Add a= bsolute reference for feed-forward clock discipline config: csky-allnoconfig (https://download.01.org/0day-ci/archive/20260930/= 202609301335.NZqudgSP-lkp@intel.com/config) compiler: csky-linux-gcc (GCC) 16.1.0 reproduce (this is a W=3D1 build): (https://download.01.org/0day-ci/archive= /20260930/202609301335.NZqudgSP-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new versio= n of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202609301335.NZqudgSP-lkp@i= ntel.com/ All warnings (new ones prefixed by >>): kernel/time/timekeeping.c: In function 'timekeeping_set_reference': >> kernel/time/timekeeping.c:2957:56: warning: left shift count >=3D width = of type [-Wshift-count-overflow] 2957 | offset_scaled =3D (sec_diff * (s64)(NSEC_PER_SEC << NTP_= SCALE_SHIFT)) + | ^~ -- >> Warning: kernel/time/ntp.c:581 function parameter 'ntpdata' not describe= d in 'ntp_update_skew_delta' >> Warning: kernel/time/ntp.c:581 function parameter 'settle' not described= in 'ntp_update_skew_delta' >> Warning: kernel/time/ntp.c:581 expecting prototype for ntp_set_time_offs= et(). Prototype was for ntp_update_skew_delta() instead vim +2957 kernel/time/timekeeping.c 2872=09 2873 int timekeeping_set_reference(const struct tk_reference *ref, bool s= tep) 2874 { 2875 struct timekeeper *tks =3D &tk_core.shadow_timekeeper; 2876 struct timespec64 ts_delta; 2877 u64 new_tl, delta, ref_frac, ref_sec; 2878 s64 offset_ns, offset_scaled, ref_ns, sec_diff; 2879 u64 xt_shifted; 2880 unsigned long flags; 2881=09 2882 raw_spin_lock_irqsave(&tk_core.lock, flags); 2883=09 2884 if (tks->cs_id !=3D ref->cs_id) { 2885 raw_spin_unlock_irqrestore(&tk_core.lock, flags); 2886 return -ENODEV; 2887 } 2888=09 2889 /* 2890 * Process any pending ticks and set up a known state of the *curre= nt* 2891 * tick, including zero skew_delta. 2892 */ 2893 ntp_set_time_offset(tks->id, 0); 2894 __timekeeping_advance(&tk_core, TK_ADV_FREQ); 2895=09 2896 /* 2897 * Compute the NTP tick_length from the reference period. 2898 * tick_length is in ns << NTP_SCALE_SHIFT (i.e. ns << 32) per tick. 2899 * period_frac_sec is the counter period as a fraction of a second 2900 * (0.period_shift fixed point), so: 2901 * tick_length =3D period_frac_sec * cycle_interval * NSEC_PER_SEC 2902 * >> (32 + period_shift) 2903 */ 2904 new_tl =3D mul_u64_u64_shr(ref->period_frac_sec, 2905 (u64)tks->cycle_interval * NSEC_PER_SEC, 2906 32 + ref->period_shift); 2907 ntp_set_tick_length(tks->id, new_tl); 2908=09 2909 /* 2910 * Compute reference time at cycle_last (i.e. "now" after 2911 * __timekeeping_advance()). Use 128-bit arithmetic to handle 2912 * seconds overflow in ref_frac. 2913 */ 2914 delta =3D tks->tkr_mono.cycle_last - ref->counter_value; 2915 ref_frac =3D mul_u64_u64_shr_add_u64(&ref_sec, delta, 2916 ref->period_frac_sec, 2917 ref->period_shift, 2918 ref->time_frac_sec); 2919 ref_sec +=3D ref->time_sec; 2920=09 2921 /* 2922 * Compute the phase error between the reference time at the next 2923 * tick boundary and the kernel's xtime there. 2924 */ 2925 xt_shifted =3D tks->tkr_mono.xtime_nsec; 2926 ref_ns =3D (s64)mul_u64_u64_shr(ref_frac, NSEC_PER_SEC, 64); 2927 sec_diff =3D (s64)(ref_sec - tks->xtime_sec); 2928=09 2929 offset_ns =3D sec_diff * NSEC_PER_SEC + ref_ns - 2930 (s64)(xt_shifted >> tks->tkr_mono.shift); 2931=09 2932=09 2933 if (step) { 2934 struct timespec64 new_xt, xt; 2935=09 2936 xt =3D tk_xtime(tks); 2937 ts_delta =3D ns_to_timespec64(offset_ns); 2938 new_xt =3D timespec64_add(xt, ts_delta); 2939 tk_set_wall_to_mono(tks, 2940 timespec64_sub(tks->wall_to_monotonic, ts_delta)); 2941 tk_set_xtime(tks, &new_xt); 2942=09 2943 /* Recompute after step =E2=80=94 only sub-ns residual remains */ 2944 xt_shifted =3D tks->tkr_mono.xtime_nsec; 2945 sec_diff =3D (s64)(ref_sec - tks->xtime_sec); 2946 } else if (offset_ns > MAXPHASE || offset_ns < -MAXPHASE) { 2947 timekeeping_restore_shadow(&tk_core); 2948 raw_spin_unlock_irqrestore(&tk_core.lock, flags); 2949 return -EINVAL; 2950 } 2951=09 2952 /* 2953 * Set time_offset with full sub-ns precision. sec_diff can 2954 * only be -1, 0, or 1 at this point (bounded by MAXPHASE or 2955 * by the step having just aligned to the nearest nanosecond). 2956 */ > 2957 offset_scaled =3D (sec_diff * (s64)(NSEC_PER_SEC << NTP_SCALE_SHIFT= )) + 2958 (((s64)mul_u64_u64_shr(ref_frac, 2959 (u64)NSEC_PER_SEC << tks->tkr_mono.shift, 64) - 2960 (s64)xt_shifted) << (NTP_SCALE_SHIFT - tks->tkr_mono.shift)); 2961 ntp_set_time_offset(tks->id, offset_scaled); 2962 /* 2963 * Preload ntp_error with the negative of the in-progress tick's 2964 * accumulation delta. logarithmic_accumulation() will do: 2965 * ntp_error +=3D ntp_tick - (xtime_interval << ntp_error_shift) 2966 * (skew_delta is zero, so there is no skew term). Setting ntp_erro= r to 2967 * the negation means that after this tick accumulates, ntp_error l= ands 2968 * at ~0 =E2=80=94 so no spurious =C2=B11 dithering is triggered. T= he cached ntp_tick 2969 * and xtime_interval here are exactly the ones that tick will use = (the 2970 * new tick_length only takes effect from the tick after). 2971 */ 2972 tks->ntp_error =3D ((s64)tks->xtime_interval << tks->ntp_error_shif= t) - 2973 (s64)tks->ntp_tick; 2974=09 2975 timekeeping_update_from_shadow(&tk_core, 2976 step ? TK_CLOCK_WAS_SET : 0); 2977 raw_spin_unlock_irqrestore(&tk_core.lock, flags); 2978=09 2979 if (step) { 2980 clock_was_set(CLOCK_SET_WALL); 2981 audit_tk_injoffset(ts_delta); 2982 } 2983 return 0; 2984 } 2985 EXPORT_SYMBOL_GPL(timekeeping_set_reference); 2986=09 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki