From: Keith Owens <kaos@ocs.com.au>
To: linux-kernel@vger.kernel.org
Subject: sparse annotation question
Date: Wed, 12 Jul 2006 15:47:03 +1000 [thread overview]
Message-ID: <27360.1152683223@kao2.melbourne.sgi.com> (raw)
This fragment of ia64 code calculates the address of a user space
location, starting from a kernel derived (i.e. not user supplied)
pointer. put_user() has to be used because the code is running in
interrupt context and the calculated target address may be invalid or
paged out.
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).
next reply other threads:[~2006-07-12 5:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-12 5:47 Keith Owens [this message]
2006-07-12 6:14 ` sparse annotation question David Miller
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=27360.1152683223@kao2.melbourne.sgi.com \
--to=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