All of lore.kernel.org
 help / color / mirror / Atom feed
* [anolis-intel-cloud:devel-5.10 8/8] drivers/gpu/drm/drm_modes.c:772:6: warning: comparison of distinct pointer types ('typeof (mode->clock) *' (aka 'const int *') and 'typeof (num) *' (aka 'unsigned int *'))
@ 2025-05-27  3:41 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-27  3:41 UTC (permalink / raw)
  To: aubrey.li; +Cc: oe-kbuild-all

tree:   https://gitee.com/anolis/intel-cloud-kernel.git devel-5.10
head:   c91b41e6a4cc972b62dc7c0f433436091b4028e5
commit: c91b41e6a4cc972b62dc7c0f433436091b4028e5 [8/8] drm/modes: Avoid divide by zero harder in drm_mode_vrefresh()
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250527/202505271145.ki3Qds5a-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
rustc: rustc 1.58.0 (02072b482 2022-01-11)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250527/202505271145.ki3Qds5a-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/202505271145.ki3Qds5a-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/drm_modes.c:772:6: warning: comparison of distinct pointer types ('typeof (mode->clock) *' (aka 'const int *') and 'typeof (num) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
     772 |         if (check_mul_overflow(mode->clock, num, &num))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:88:15: note: expanded from macro 'check_mul_overflow'
      88 |         (void) (&__a == &__b);                  \
         |                 ~~~~ ^  ~~~~
>> drivers/gpu/drm/drm_modes.c:772:6: warning: comparison of distinct pointer types ('typeof (mode->clock) *' (aka 'const int *') and 'typeof (&num)' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
     772 |         if (check_mul_overflow(mode->clock, num, &num))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:89:15: note: expanded from macro 'check_mul_overflow'
      89 |         (void) (&__a == __d);                   \
         |                 ~~~~ ^  ~~~
>> drivers/gpu/drm/drm_modes.c:775:6: warning: comparison of distinct pointer types ('typeof (mode->htotal * mode->vtotal) *' (aka 'int *') and 'typeof (den) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
     775 |         if (check_mul_overflow(mode->htotal * mode->vtotal, den, &den))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:88:15: note: expanded from macro 'check_mul_overflow'
      88 |         (void) (&__a == &__b);                  \
         |                 ~~~~ ^  ~~~~
>> drivers/gpu/drm/drm_modes.c:775:6: warning: comparison of distinct pointer types ('typeof (mode->htotal * mode->vtotal) *' (aka 'int *') and 'typeof (&den)' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
     775 |         if (check_mul_overflow(mode->htotal * mode->vtotal, den, &den))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:89:15: note: expanded from macro 'check_mul_overflow'
      89 |         (void) (&__a == __d);                   \
         |                 ~~~~ ^  ~~~
   4 warnings generated.


vim +772 drivers/gpu/drm/drm_modes.c

   749	
   750	/**
   751	 * drm_mode_vrefresh - get the vrefresh of a mode
   752	 * @mode: mode
   753	 *
   754	 * Returns:
   755	 * @modes's vrefresh rate in Hz, rounded to the nearest integer. Calculates the
   756	 * value first if it is not yet set.
   757	 */
   758	int drm_mode_vrefresh(const struct drm_display_mode *mode)
   759	{
   760		unsigned int num = 1, den = 1;
   761	
   762		if (mode->htotal == 0 || mode->vtotal == 0)
   763			return 0;
   764	
   765		if (mode->flags & DRM_MODE_FLAG_INTERLACE)
   766			num *= 2;
   767		if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
   768			den *= 2;
   769		if (mode->vscan > 1)
   770			den *= mode->vscan;
   771	
 > 772		if (check_mul_overflow(mode->clock, num, &num))
   773			return 0;
   774	
 > 775		if (check_mul_overflow(mode->htotal * mode->vtotal, den, &den))
   776			return 0;
   777	
   778		return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(num, 1000), den);
   779	}
   780	EXPORT_SYMBOL(drm_mode_vrefresh);
   781	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-27  3:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27  3:41 [anolis-intel-cloud:devel-5.10 8/8] drivers/gpu/drm/drm_modes.c:772:6: warning: comparison of distinct pointer types ('typeof (mode->clock) *' (aka 'const int *') and 'typeof (num) *' (aka 'unsigned int *')) kernel test robot

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.