From: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for v3.13 2/7] IB/uverbs: remove implicit cast in INIT_UDATA()
Date: Wed, 27 Nov 2013 13:18:34 +0100 [thread overview]
Message-ID: <1385554714.21498.9.camel@localhost.localdomain> (raw)
In-Reply-To: <5295AB98.8080205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Hi Matan,
Le mercredi 27 novembre 2013 à 10:21 +0200, Matan Barak a écrit :
> On 27/11/2013 12:02 AM, Yann Droneaud wrote:
...
> > INIT_UDATA(&udata, buf + sizeof cmd,
> > - (unsigned long) cmd.response + sizeof resp,
> > + (void __user *)(unsigned long)cmd.response + sizeof resp,
>
> The response field is already __u64 and casting to (void __user *)
> should match the machine's pointer type size. Why do we have to cast to
> (unsigned long) and then cast to (void __user *) ?
>
On 32bit ABI, u64 is not matching the size of the pointer.
Without the cast to unsigned long, GCC complains with:
warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
So the cast is required on 32bit platforms.
Regards.
--
Yann Droneaud
OPTEYA
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-11-27 12:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 22:02 [PATCH for v3.13 0/7] create_flow/destroy_flow fixes for v3.13 Yann Droneaud
[not found] ` <cover.1385501822.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2013-11-26 22:02 ` [PATCH for v3.13 1/7] IB/core: const'ify inbuf in struct ib_udata Yann Droneaud
2013-11-26 22:02 ` [PATCH for v3.13 2/7] IB/uverbs: remove implicit cast in INIT_UDATA() Yann Droneaud
[not found] ` <471895ee06633a624e934cf501c7a460755fe4a4.1385501822.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2013-11-27 8:21 ` Matan Barak
[not found] ` <5295AB98.8080205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2013-11-27 12:18 ` Yann Droneaud [this message]
2013-11-26 22:02 ` [PATCH for v3.13 3/7] IB/uverbs: set outbuf to NULL when no core response space is provided Yann Droneaud
2013-11-26 22:02 ` [PATCH for v3.13 4/7] IB/uverbs: check reserved field in extended command header Yann Droneaud
2013-11-26 22:02 ` [PATCH for v3.13 5/7] IB/uverbs: check comp_mask in destroy_flow Yann Droneaud
2013-11-26 22:02 ` [PATCH for v3.13 6/7] IB/uverbs: check reserved fields in create_flow Yann Droneaud
2013-11-26 22:02 ` [PATCH for v3.13 7/7] IB/uverbs: set error code when fail to consume all flow_spec items Yann Droneaud
2013-11-27 8:34 ` [PATCH for v3.13 0/7] create_flow/destroy_flow fixes for v3.13 Matan Barak
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=1385554714.21498.9.camel@localhost.localdomain \
--to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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