From: kernel test robot <lkp@intel.com>
To: aubrey.li@linux.intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [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 *'))
Date: Tue, 27 May 2025 11:41:36 +0800 [thread overview]
Message-ID: <202505271145.ki3Qds5a-lkp@intel.com> (raw)
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
reply other threads:[~2025-05-27 3:42 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=202505271145.ki3Qds5a-lkp@intel.com \
--to=lkp@intel.com \
--cc=aubrey.li@linux.intel.com \
--cc=oe-kbuild-all@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 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.