From: Uros Bizjak <ubizjak@gmail.com>
To: linux-sparse@vger.kernel.org
Subject: sparse: Expected ) at end of cast operator, got __seg_gs
Date: Fri, 1 Dec 2023 15:10:35 +0100 [thread overview]
Message-ID: <CAFULd4Zm94W07Rv+0J0E2=dtd3hoc7us_sQi-pOUiomYS1Za-w@mail.gmail.com> (raw)
In-Reply-To: <CAFULd4ZgT1dZFz36ZbPeqJa+U2NwusSTudg175sSarhpvEu-Zw@mail.gmail.com>
Forwarded from linux-kernel@vger.kernel.org
---------- Forwarded message ---------
From: Uros Bizjak <ubizjak@gmail.com>
Date: Fri, Dec 1, 2023 at 2:57 PM
Subject: Re: [tip:x86/percpu 12/12]
arch/x86/include/asm/preempt.h:27:55: sparse: sparse: incompatible
types for operation (&):
To: kernel test robot <lkp@intel.com>
Cc: <oe-kbuild-all@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<x86@kernel.org>, Ingo Molnar <mingo@kernel.org>, Nadav Amit
<namit@vmware.com>
On Sun, Oct 8, 2023 at 2:43 AM kernel test robot <lkp@intel.com> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/percpu
> head: ca4256348660cb2162668ec3d13d1f921d05374a
> commit: ca4256348660cb2162668ec3d13d1f921d05374a [12/12] x86/percpu: Use C for percpu read/write accessors
> config: x86_64-randconfig-122-20231007 (https://download.01.org/0day-ci/archive/20231008/202310080853.UhMe5iWa-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231008/202310080853.UhMe5iWa-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/202310080853.UhMe5iWa-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
> kernel/bpf/percpu_freelist.c: note: in included file (through arch/x86/include/asm/preempt.h, include/linux/preempt.h, include/linux/spinlock.h, ...):
> arch/x86/include/asm/percpu.h:550:49: sparse: sparse: Expected ) at end of cast operator
> arch/x86/include/asm/percpu.h:550:49: sparse: sparse: got __seg_gs
> arch/x86/include/asm/percpu.h:564:33: sparse: sparse: Expected ) at end of cast operator
> arch/x86/include/asm/percpu.h:564:33: sparse: sparse: got __seg_gs
sparse is too strict here. The following code is perfectly legal:
--cut here--
int __seg_gs foo;
int bar (int *pcp)
{
return *(typeof (*pcp) __seg_gs *)(unsigned long)(pcp);
}
--cut here--
$ gcc -O2 -S -Wextra -Wall test.c
$
$ sparse test.c
test.c:1:14: error: Expected ; at end of declaration
test.c:1:14: error: got foo
test.c:5:26: error: Expected ) at end of cast operator
test.c:5:26: error: got __seg_gs
$
Uros.
next parent reply other threads:[~2023-12-01 14:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202310080853.UhMe5iWa-lkp@intel.com>
[not found] ` <CAFULd4ZgT1dZFz36ZbPeqJa+U2NwusSTudg175sSarhpvEu-Zw@mail.gmail.com>
2023-12-01 14:10 ` Uros Bizjak [this message]
2023-12-01 14:51 ` sparse: Expected ) at end of cast operator, got __seg_gs Dan Carpenter
2023-12-01 14:56 ` Uros Bizjak
2023-12-04 13:05 ` Luc Van Oostenryck
2023-12-04 13:57 ` Uros Bizjak
2023-12-04 14:37 ` Luc Van Oostenryck
2023-12-04 14:50 ` Uros Bizjak
2023-12-04 15:02 ` Uros Bizjak
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='CAFULd4Zm94W07Rv+0J0E2=dtd3hoc7us_sQi-pOUiomYS1Za-w@mail.gmail.com' \
--to=ubizjak@gmail.com \
--cc=linux-sparse@vger.kernel.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).