All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Roman Kagan <rkagan@virtuozzo.com>,
	"Denis V. Lunev" <den@openvz.org>,
	Andrey Smetanin <asmetanin@virtuozzo.com>,
	kbuild-all@01.org, kvm@vger.kernel.org,
	Christopher Li <sparse@chrisli.org>,
	Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [kbuild-all] [kvm:queue 27/38] arch/x86/kvm/hyperv.c:186:41: sparse: incorrect type in argument 2 (different modifiers)
Date: Tue, 5 Jan 2016 14:51:57 +0100	[thread overview]
Message-ID: <20160105135156.GB1044@macpro.local> (raw)
In-Reply-To: <20150918150644.GB20668@wfg-t540p.sh.intel.com>

On Fri, Sep 18, 2015 at 11:06:44PM +0800, Fengguang Wu wrote:
> [CC sparse people]
> 
> On Fri, Sep 18, 2015 at 04:41:56PM +0200, Paolo Bonzini wrote:
> > 
> > 
> > On 18/09/2015 16:40, Roman Kagan wrote:
> > > typedef unsigned long __nocast cputime_t;
> > > 
> > > extern void task_cputime_adjusted(cputime_t *);
> > > extern void current_task_runtime_100ns(void);
> > > 
> > > void current_task_runtime_100ns(void)
> > > {
> > >         cputime_t utime;
> > > 
> > >         task_cputime_adjusted(&utime);
> > > }
> > > %%% gcc -c x.c -Wall -Werror -O2; echo $?
> > > 0
> > > %%% sparse x.c
> > > x.c:16:32: warning: incorrect type in argument 1 (different modifiers)
> > > x.c:16:32:    expected unsigned long [nocast] [usertype] *<noident>
> > > x.c:16:32:    got unsigned long *<noident>
> > > x.c:16:32: warning: implicit cast to nocast type
> > > 
> > > Looks like a sparse bug to me.
> > 
> > Indeed...
> > 
> > Paolo

The problem is that the intent and semantic of 'nocast' is not clear at all.
There is an explanation about 'nocast' vs. 'bitwise' here:
	https://git.kernel.org/cgit/devel/sparse/sparse.git/tree/Documentation/sparse.txt
but it doesn't give much info about the exact wanted behaviour.

Since for the kernel 'nocast' is only used for cputime_t & cputime64_t,
I think it should be clarified and fixed if needed.
A patch proposal is following.

Regards,
Luc

  reply	other threads:[~2016-01-05 13:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 13:39 [kvm:queue 27/38] arch/x86/kvm/hyperv.c:186:41: sparse: incorrect type in argument 2 (different modifiers) kbuild test robot
2015-09-18 13:51 ` Denis V. Lunev
2015-09-18 13:55   ` Paolo Bonzini
2015-09-18 13:57     ` Denis V. Lunev
2015-09-18 14:40     ` Roman Kagan
2015-09-18 14:41       ` Paolo Bonzini
2015-09-18 15:06         ` [kbuild-all] " Fengguang Wu
2016-01-05 13:51           ` Luc Van Oostenryck [this message]
2016-01-05 16:25             ` [PATCH] Do not drop 'nocast' modifier when taking the address Luc Van Oostenryck
2016-02-02 20:25               ` Christopher Li
2016-02-03  3:43                 ` Luc Van Oostenryck
2016-02-03  4:09                   ` Christopher Li
2016-02-03  9:15                     ` Luc Van Oostenryck
2016-02-22 18:41                       ` Christopher Li

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=20160105135156.GB1044@macpro.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=asmetanin@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkagan@virtuozzo.com \
    --cc=sparse@chrisli.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 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.