From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: Arnd Bergmann <arnd@arndb.de>, Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Roland Dreier <roland@purestorage.com>,
linux-rdma@vger.kernel.org, Matan Barak <matanb@mellanox.com>,
Or Gerlitz <ogerlitz@mellanox.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] IB/core: avoid 32-bit warning
Date: Wed, 7 Oct 2015 16:19:27 +0300 [thread overview]
Message-ID: <56151BDF.8010504@dev.mellanox.co.il> (raw)
In-Reply-To: <17269152.DqJfCm1LOx@wuerfel>
On 10/7/2015 3:29 PM, Arnd Bergmann wrote:
> The INIT_UDATA() macro requires a pointer or unsigned long argument for
> both input and output buffer, and all callers had a cast from when
> the code was merged until a recent restructuring, so now we get
>
> core/uverbs_cmd.c: In function 'ib_uverbs_create_cq':
> core/uverbs_cmd.c:1481:66: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>
> This makes the code behave as before by adding back the cast to
> unsigned long.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 565197dd8fb1 ("IB/core: Extend ib_uverbs_create_cq")
>
> diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
> index be4cb9f04be3..88b3b78340f2 100644
> --- a/drivers/infiniband/core/uverbs_cmd.c
> +++ b/drivers/infiniband/core/uverbs_cmd.c
> @@ -1478,7 +1478,7 @@ ssize_t ib_uverbs_create_cq(struct ib_uverbs_file *file,
> if (copy_from_user(&cmd, buf, sizeof(cmd)))
> return -EFAULT;
>
> - INIT_UDATA(&ucore, buf, cmd.response, sizeof(cmd), sizeof(resp));
> + INIT_UDATA(&ucore, buf, (unsigned long)cmd.response, sizeof(cmd), sizeof(resp));
Would it make sense to cast inside INIT_UDATA() and not have callers
worry about it?
next prev parent reply other threads:[~2015-10-07 13:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 12:29 [PATCH] IB/core: avoid 32-bit warning Arnd Bergmann
2015-10-07 13:00 ` Yann Droneaud
2015-10-07 13:19 ` Sagi Grimberg [this message]
2015-10-07 13:46 ` Arnd Bergmann
2015-10-07 13:46 ` Yann Droneaud
2015-10-21 20:58 ` Doug Ledford
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=56151BDF.8010504@dev.mellanox.co.il \
--to=sagig@dev.mellanox.co.il \
--cc=arnd@arndb.de \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matanb@mellanox.com \
--cc=ogerlitz@mellanox.com \
--cc=roland@purestorage.com \
--cc=sean.hefty@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).