From: Dan Carpenter <error27@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
kernel test robot <lkp@intel.com>,
Orlando Chamberlain <orlandoch.dev@gmail.com>
Subject: Re: sparse false-positive ? (was [linux-next:master 3256/8744] drivers/platform/x86/apple-gmux.c:224:48: sparse: sparse: incorrect type in argument 1 (different address spaces))
Date: Tue, 4 Apr 2023 13:07:14 +0300 [thread overview]
Message-ID: <f4beb5cb-8887-41a5-9ef8-35e163e2f509@kili.mountain> (raw)
In-Reply-To: <a07aa39e-4a70-6942-9837-717a69484e96@redhat.com>
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@intel.com/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@intel.com>
> > | Link: https://lore.kernel.org/oe-kbuild-all/202304040401.IMxt7Ubi-lkp@intel.com/
> >
> > 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;
regards,
dan carpenter
next prev parent reply other threads:[~2023-04-04 10:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 20:39 [linux-next:master 3256/8744] drivers/platform/x86/apple-gmux.c:224:48: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2023-04-04 9:50 ` sparse false-positive ? (was [linux-next:master 3256/8744] drivers/platform/x86/apple-gmux.c:224:48: sparse: sparse: incorrect type in argument 1 (different address spaces)) Hans de Goede
2023-04-04 10:07 ` Dan Carpenter [this message]
2023-04-04 10:56 ` Hans de Goede
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=f4beb5cb-8887-41a5-9ef8-35e163e2f509@kili.mountain \
--to=error27@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=orlandoch.dev@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox