Hi, On 4/4/23 12:07, Dan Carpenter wrote: > On Tue, Apr 04, 2023 at 11:50:17AM +0200, Hans de Goede wrote: >> Dan, >> >> Can you perhaps help me understand the following sparse warnings, >> they seem like false-positives to me. But I'm not used to >> sparse giving false-positives so I think I might be missing something >> here ? >> >> On 4/3/23 22:39, kernel test robot wrote: >>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master >>> head: 31bd35b66249699343d2416658f57e97314a433a >>> commit: 0c18184de990e63f708b090bcb9fc6c0fbc427cd [3256/8744] platform/x86: apple-gmux: support MMIO gmux on T2 Macs >>> config: x86_64-randconfig-s023-20230403 (https://download.01.org/0day-ci/archive/20230404/202304040401.IMxt7Ubi-lkp@xxxxxxxxx/config) >>> compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 >>> reproduce: >>> # apt-get install sparse >>> # sparse version: v0.6.4-39-gce1a6720-dirty >>> # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0c18184de990e63f708b090bcb9fc6c0fbc427cd >>> git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git >>> git fetch --no-tags linux-next master >>> git checkout 0c18184de990e63f708b090bcb9fc6c0fbc427cd >>> # save the config file >>> mkdir build_dir && cp config build_dir/.config >>> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 olddefconfig >>> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/x86/ >>> >>> If you fix the issue, kindly add following tag where applicable >>> | Reported-by: kernel test robot <lkp@xxxxxxxxx> >>> | Link: https://lore.kernel.org/oe-kbuild-all/202304040401.IMxt7Ubi-lkp@xxxxxxxxx/ >>> >>> sparse warnings: (new ones prefixed by >>) >>>>> drivers/platform/x86/apple-gmux.c:224:48: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got unsigned char [usertype] * @@ >>> drivers/platform/x86/apple-gmux.c:224:48: sparse: expected void const [noderef] __iomem * >>> drivers/platform/x86/apple-gmux.c:224:48: sparse: got unsigned char [usertype] * >> >> So apple-gmux.c:224 for the commit these sparse warnings are about reads: >> >> u8 gwr = ioread8(gmux_data->iomem_base + GMUX_MMIO_COMMAND_SEND); >> >> Where gmux_data is a "struct apple_gmux_data *" and the iomem_base member is: >> >> u8 *__iomem iomem_base; >> > > The __iomem should go before the *. > > u8 __iomem *iomem_base; Heh, thank you Dan! I'll send out a fix for this right away. Regards, Hans