Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1241467

Re: [PATCH] IB/core: avoid 32-bit warning

Path csiph.com!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod
From Yann Droneaud <ydroneaud@opteya.com>
Newsgroups linux.kernel
Subject Re: [PATCH] IB/core: avoid 32-bit warning
Date Wed, 07 Oct 2015 15:10:01 +0200
Message-ID <qgWDL-5In-5@gated-at.bofh.it> (permalink)
References <qgWaM-4Te-51@gated-at.bofh.it>
X-Original-To Arnd Bergmann <arnd@arndb.de>, Doug Ledford <dledford@redhat.com>, Sean Hefty <sean.hefty@intel.com>, Hal Rosenstock <hal.rosenstock@gmail.com>
Organization OPTEYA
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.16.5 (3.16.5-3.fc22)
MIME-Version 1.0
Content-Transfer-Encoding 8bit
X-Sa-Exim-Connect-IP 77.154.202.32
X-Sa-Exim-Mail-From ydroneaud@opteya.com
X-Sa-Exim-Version 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000)
X-Sa-Exim-Scanned Yes (on ou.quest-ce.net)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 50
X-Original-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
X-Original-Date Wed, 07 Oct 2015 15:00:26 +0200
X-Original-Message-ID <1444222826.3188.62.camel@opteya.com>
X-Original-References <17269152.DqJfCm1LOx@wuerfel>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1241467

Show key headers only | View raw


Hi,

Le mercredi 07 octobre 2015 à 14:29 +0200, Arnd Bergmann a écrit :
> 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")
> 

Reviewed-by: Yann Droneaud <ydroneaud@opteya.com>

> 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));
>  
>  	INIT_UDATA(&uhw, buf + sizeof(cmd),
>  		   (unsigned long)cmd.response + sizeof(resp),
> 

Regards.

-- 
Yann Droneaud
OPTEYA

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] IB/core: avoid 32-bit warning Arnd Bergmann <arnd@arndb.de> - 2015-10-07 14:40 +0200
  Re: [PATCH] IB/core: avoid 32-bit warning Yann Droneaud <ydroneaud@opteya.com> - 2015-10-07 15:10 +0200
  Re: [PATCH] IB/core: avoid 32-bit warning Sagi Grimberg <sagig@dev.mellanox.co.il> - 2015-10-07 15:20 +0200
    Re: [PATCH] IB/core: avoid 32-bit warning Arnd Bergmann <arnd@arndb.de> - 2015-10-07 15:50 +0200
    Re: [PATCH] IB/core: avoid 32-bit warning Yann Droneaud <ydroneaud@opteya.com> - 2015-10-07 15:50 +0200

csiph-web