public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: kaos@ocs.com.au
Cc: linux-kernel@vger.kernel.org
Subject: Re: sparse annotation question
Date: Wed, 12 Jul 2006 00:22:55 -0700 (PDT)	[thread overview]
Message-ID: <20060712.002255.45063957.davem@davemloft.net> (raw)
In-Reply-To: <28491.1152686564@kao2.melbourne.sgi.com>

From: Keith Owens <kaos@ocs.com.au>
Date: Wed, 12 Jul 2006 16:42:44 +1000

> I tried various combinations of __force, but kept getting this:
> 
> warning: incorrect type in argument 1 (different address spaces)
>    expected unsigned long *addr
>    got unsigned long [noderef] [force] *[addressable] bsp<asn:1>
> 
> What finally worked was
> 
>  	unsigned long i, *bsp, __user *ubsp;
> 	...
> 	ubsp = (unsigned long __user *) bsp;
> 	put_user(*contents, ubsp);
> 

Right, I guess if you try to do the cast in the put_user() macro
argument, you'll run into troubles because the __chk_user_ptr(ptr)
call wants an absolutely pure __user pointer, not one that is part of
a __force cast.

      reply	other threads:[~2006-07-12  7:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12  5:47 sparse annotation question Keith Owens
2006-07-12  6:14 ` David Miller
2006-07-12  6:42   ` Keith Owens
2006-07-12  7:22     ` David Miller [this message]

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=20060712.002255.45063957.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@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