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: Tue, 11 Jul 2006 23:14:09 -0700 (PDT)	[thread overview]
Message-ID: <20060711.231409.121242621.davem@davemloft.net> (raw)
In-Reply-To: <27360.1152683223@kao2.melbourne.sgi.com>

From: Keith Owens <kaos@ocs.com.au>
Date: Wed, 12 Jul 2006 15:47:03 +1000

> func (long regno, unsigned long *contents)
> {
> 	unsigned long i, *bsp;
> 	mm_segment_t old_fs;
> 	bsp = <expression involving only kernel variables>;
> 	old_fs = set_fs(KERNEL_DS);
> 	for (i = 0; i < (regno - 32); ++i)
> 		bsp = ia64_rse_skip_regs(bsp, 1);
> 	put_user(*contents, bsp);
> 	set_fs(old_fs);
> }
> 
> sparse is complaining that the second parameter to put_user() is not
> marked as __user.  How do I tell sparse to ignore this case?  Marking
> bsp as __user does not work, sparse then complains about incorrect type
> in assignment (different address spaces).

Since, in this case, you "know what you are doing" you can force the
matter by using the __force keyword as well as __user.


  reply	other threads:[~2006-07-12  6:13 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 [this message]
2006-07-12  6:42   ` Keith Owens
2006-07-12  7:22     ` David Miller

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=20060711.231409.121242621.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