public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: wharms@bfs.de
Cc: Julia Lawall <julia@diku.dk>, Roland Dreier <rolandd@cisco.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 10/27] drivers/infiniband/core: Use memdup_user
Date: Sat, 22 May 2010 08:15:50 -0700	[thread overview]
Message-ID: <adaaars0xy1.fsf@roland-alpha.cisco.com> (raw)
In-Reply-To: <4BF7A65D.1070501@bfs.de> (walter harms's message of "Sat, 22 May 2010 11:39:41 +0200")

 > > +	data = memdup_user((void __user *)(unsigned long)src, len);
 > > +	if (IS_ERR(data))
 > > +		return PTR_ERR(data);

 > This cast look strange, can it happen that (unsigned long)<(u64) ?
 > (is there a 32bit infiniband) ?

There is 32-bit infiniband.  Linux kernel assumes that unsigned long is
equivalent to uintptr_t -- in other words all pointers are the same size
as longs.  So when casting from integer to pointer we add a cast to
unsigned long to avoid a warning precisely in the 32-bit case -- we
would get a warning about cast to pointer from integer of different size
when casting from 64-bit integer to 32-bit pointer.
-- 
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html

  reply	other threads:[~2010-05-22 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-22  8:21 [PATCH 10/27] drivers/infiniband/core: Use memdup_user Julia Lawall
2010-05-22  9:39 ` walter harms
2010-05-22 15:15   ` Roland Dreier [this message]
2010-05-26  4:11 ` Roland Dreier

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=adaaars0xy1.fsf@roland-alpha.cisco.com \
    --to=rdreier@cisco.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rolandd@cisco.com \
    --cc=sean.hefty@intel.com \
    --cc=wharms@bfs.de \
    /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