From owner-svn-src-head@freebsd.org Thu Nov 12 17:17:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADEEDA2C91B; Thu, 12 Nov 2015 17:17:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f172.google.com (mail-yk0-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FF4D1B60; Thu, 12 Nov 2015 17:17:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykdv3 with SMTP id v3so102562435ykd.0; Thu, 12 Nov 2015 09:17:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=pUi5SuiOwXAE58wI9AzC3/ZhSME8eJ887BgePA9N7z8=; b=J/ss3lUGQ58MfrADVTc527kvj4WiY3UrXRn/n1jmBkcvbeDSVKOctIu8TVQm0amAYA 0N+a11KMjPc9WFSjOzRL5mz/T8mGqN3d6dmpL+zfjoZ08ZLuzWt+mvuibaKuyIi+7tMW 6gOIR90OKgVSY/HztJWHrHVLLlKYHkTqiGDkFAVZnwgQCj8lMz9ON8FBCJMncCih8I2D 1yshjZFgYoLMUKPEbx6ePbpGITviSygIBAhAuBptV5bvh+mwlbsI4ZXH8R8t/i+ES4/t 8xQ392AV61dn3NtHIsbTbanjU8PRGLMcUvn259tqWQk/R7NdUJqgC5FF9Iro8/x28b/b jy2g== X-Received: by 10.129.106.193 with SMTP id f184mr17319479ywc.157.1447348627023; Thu, 12 Nov 2015 09:17:07 -0800 (PST) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com. [209.85.160.176]) by smtp.gmail.com with ESMTPSA id f67sm16209756ywd.19.2015.11.12.09.17.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 09:17:06 -0800 (PST) Received: by ykfs79 with SMTP id s79so102711154ykf.1; Thu, 12 Nov 2015 09:17:06 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.13.213 with SMTP id 204mr17056181ywn.281.1447348626505; Thu, 12 Nov 2015 09:17:06 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.17.2 with HTTP; Thu, 12 Nov 2015 09:17:06 -0800 (PST) In-Reply-To: <201511121012.tACACKTI075143@repo.freebsd.org> References: <201511121012.tACACKTI075143@repo.freebsd.org> Date: Thu, 12 Nov 2015 09:17:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r290711 - head/sys/ofed/drivers/infiniband/core From: Conrad Meyer To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 17:17:08 -0000 These should cast through (u)intptr_t rather than unsigned long. Best, Conrad On Thu, Nov 12, 2015 at 2:12 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Nov 12 10:12:20 2015 > New Revision: 290711 > URL: https://svnweb.freebsd.org/changeset/base/290711 > > Log: > Fix integer to pointer of different size conversion warnings when > using GCC for 32-bit platforms. The integer size in this case is > hardcoded 64-bit while the pointer size is 32-bit. > > Sponsored by: Mellanox Technologies > MFC after: 2 weeks > > Modified: > head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c > head/sys/ofed/drivers/infiniband/core/uverbs_main.c > > Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 12 09:56:25 2015 (r290710) > +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 12 10:12:20 2015 (r290711) > @@ -1379,7 +1379,8 @@ ssize_t ib_uverbs_create_cq(struct ib_uv > return -EFAULT; > > return create_cq(file, buf, in_len, out_len, &cmd, > - IB_USER_VERBS_CMD_BASIC, (void __user *)cmd.response); > + IB_USER_VERBS_CMD_BASIC, > + (void __user *) (unsigned long) cmd.response); > } > > ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file, > @@ -1609,7 +1610,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uv > if (copy_from_user(&cmd_obj, buf, cmd_size)) > return -EFAULT; > > - response = (void __user *)cmd->response; > + response = (void __user *) (unsigned long) cmd->response; > > if (!disable_raw_qp_enforcement && > cmd->qp_type == IB_QPT_RAW_PACKET && !priv_check(curthread, PRIV_NET_RAW)) > > Modified: head/sys/ofed/drivers/infiniband/core/uverbs_main.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Nov 12 09:56:25 2015 (r290710) > +++ head/sys/ofed/drivers/infiniband/core/uverbs_main.c Thu Nov 12 10:12:20 2015 (r290711) > @@ -81,8 +81,8 @@ static struct ib_udata_ops uverbs_copy_e > #define INIT_UDATA_EX(udata, ibuf, obuf, ilen, olen) \ > do { \ > (udata)->ops = &uverbs_copy_ex; \ > - (udata)->inbuf = (void __user *)(ibuf); \ > - (udata)->outbuf = (void __user *)(obuf); \ > + (udata)->inbuf = (void __user *)(unsigned long)(ibuf); \ > + (udata)->outbuf = (void __user *)(unsigned long)(obuf); \ > (udata)->inlen = (ilen); \ > (udata)->outlen = (olen); \ > } while (0) >