All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Norihiko Hama <Norihiko.Hama@alpsalpine.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: [usb:usb-testing 17/35] drivers/usb/storage/usb.c:141:21: error: incompatible pointer types passing 'unsigned int *' to parameter of type 'uint64_t *' (aka 'unsigned long long *')
Date: Wed, 1 May 2024 14:32:56 +0800	[thread overview]
Message-ID: <202405011431.PvaZHpRK-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
head:   ac6a205c5bef39d65ecd9f5dd2c1d75652c35405
commit: 70d66b8e47e6fa031f541291e9dd3d7f0c44b41e [17/35] usb-storage: Optimize scan delay more precisely
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240501/202405011431.PvaZHpRK-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240501/202405011431.PvaZHpRK-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/202405011431.PvaZHpRK-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/usb/storage/usb.c:141:21: warning: comparison of distinct pointer types ('typeof ((delay_ms)) *' (aka 'unsigned int *') and 'uint64_t *' (aka 'unsigned long long *')) [-Wcompare-distinct-pointer-types]
           unsigned int rem = do_div(delay_ms, int_pow(10, ndecimals));
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div'
           (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
                  ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
>> drivers/usb/storage/usb.c:141:21: error: incompatible pointer types passing 'unsigned int *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
           unsigned int rem = do_div(delay_ms, int_pow(10, ndecimals));
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
                   __rem = __div64_32(&(n), __base);       \
                                      ^~~~
   arch/arm/include/asm/div64.h:24:45: note: passing argument to parameter 'n' here
   static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
                                               ^
>> drivers/usb/storage/usb.c:141:21: warning: shift count >= width of type [-Wshift-count-overflow]
           unsigned int rem = do_div(delay_ms, int_pow(10, ndecimals));
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:234:25: note: expanded from macro 'do_div'
           } else if (likely(((n) >> 32) == 0)) {          \
                                  ^  ~~
   include/linux/compiler.h:76:40: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                               ^
   2 warnings and 1 error generated.


vim +141 drivers/usb/storage/usb.c

   123	
   124	/**
   125	 * fixed_point_uint_to_str - format a fixed-point decimal value into a string
   126	 * @val: The integer value to format, scaled by 10^(@ndecimals).
   127	 * @ndecimals: Number of decimal places in the fixed-point value.
   128	 * @str: Where to store the formatted string.
   129	 * @size: The size of buffer for @str.
   130	 *
   131	 * Format a fixed-point decimal value in @val scaled by 10^(@ndecimals)
   132	 * into a string in @str where to store the formatted string.
   133	 * The string trailing fractional part '0' is trimmed.
   134	 *
   135	 * Returns the number of characters written into @str.
   136	 */
   137	static int fixed_point_uint_to_str(unsigned int val, int ndecimals,
   138					   char *str, int size)
   139	{
   140		unsigned int delay_ms = val;
 > 141		unsigned int rem = do_div(delay_ms, int_pow(10, ndecimals));
   142		int len;
   143		char buf[16];
   144	
   145		len = scnprintf(buf, sizeof(buf), "%d", delay_ms);
   146		if (rem) {
   147			char format[8];
   148	
   149			snprintf(format, sizeof(format) - 1, ".%%0%dd", ndecimals);
   150			len += scnprintf(buf + len, sizeof(buf) - len, format, rem);
   151			while (buf[--len] == '0')
   152				buf[len] = '\0';
   153		}
   154		return scnprintf(str, size, "%s\n", buf);
   155	}
   156	

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

             reply	other threads:[~2024-05-01  6:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01  6:32 kernel test robot [this message]
2024-05-01  6:50 ` [usb:usb-testing 17/35] drivers/usb/storage/usb.c:141:21: error: incompatible pointer types passing 'unsigned int *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') Greg Kroah-Hartman
2024-05-01 14:03   ` Alan Stern
2024-05-02  8:04     ` Norihiko Hama

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=202405011431.PvaZHpRK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Norihiko.Hama@alpsalpine.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=stern@rowland.harvard.edu \
    /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.