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


Groups > linux.kernel > #1387566

Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr()

Path csiph.com!goblin3!goblin.stu.neva.ru!inn5.news.alteholz.net!easy.in-chemnitz.de!news2.arglkargh.de!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr()
Date Tue, 26 Apr 2016 16:50:03 +0200
Message-ID <rsctl-Xx-37@gated-at.bofh.it> (permalink)
References <rqoRX-2Wv-7@gated-at.bofh.it> <rqoRY-2Wv-39@gated-at.bofh.it> <rs7tF-57R-23@gated-at.bofh.it> <rsc9Y-OI-25@gated-at.bofh.it>
X-Session-Marker 6A6F6540706572636865732E636F6D
X-Spam-Summary 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3870:4321:5007:6742:7514:7576:10004:10400:10848:11026:11473:11658:11914:12043:12517:12519:12740:13069:13156:13161:13228:13229:13311:13357:13439:14040:14181:14659:14721:21080:30003:30051:30054:30064:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none
X-He-Tag home87_5dcbec4778021
X-Filterd-Recvd-Size 2467
Content-Type text/plain; charset="ISO-8859-1"
X-Mailer Evolution 3.18.5.2-0ubuntu1
MIME-Version 1.0
Content-Transfer-Encoding 7bit
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 31
Organization linux.* mail to news gateway
X-Original-Cc Gustavo Padovan <gustavo@padovan.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, devel@driverdev.osuosl.org, Daniel Stone <daniels@collabora.com>, Daniel Vetter <daniel.vetter@ffwll.ch>, Riley Andrews <riandrews@android.com>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Arve Hjønnevåg <arve@android.com>, Daniel Vetter <daniel.vetter@intel.com>, Andrew Morton <akpm@linux-foundation.org>, John Harrison <John.C.Harrison@Intel.com>
X-Original-Date Tue, 26 Apr 2016 07:40:43 -0700
X-Original-Message-ID <1461681643.2726.140.camel@perches.com>
X-Original-References <1461253130-9266-1-git-send-email-gustavo@padovan.org> <1461253130-9266-2-git-send-email-gustavo@padovan.org> <1461661318.7839.5.camel@pengutronix.de> <20160426142906.GI7857@joana>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1387566

Show key headers only | View raw


On Tue, 2016-04-26 at 11:29 -0300, Gustavo Padovan wrote:
> 2016-04-26 Lucas Stach <l.stach@pengutronix.de>:
> > Am Donnerstag, den 21.04.2016, 12:38 -0300 schrieb Gustavo Padovan:
> > > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > > 
> > > This function had copies in 3 different files. Unify them in kernel.h.
> > > 
> > > Cc: Joe Perches <joe@perches.com>
> > > Cc: Andrew Morton <akpm@linux-foundation.org>
> > > Cc: David Airlie <airlied@linux.ie>
> > > Cc: Daniel Vetter <daniel.vetter@intel.com>
> > > Cc: Rob Clark <robdclark@gmail.com>
> > > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > > 
> > Though I normally prefer static inline functions, I see the benefits of
> > using the macro form here.

An inline could still work
	static inline void __user *u64_to_user_ptr(u64 address)
	{
		return (void __user *)(uintptr_t)address;
	}
if the macro was
	#define u64_to_user_ptr(x)		\
	({					\
		typecheck(u64, x);		\
		(u64_to_user_ptr)(x);		\
	})

the parenthesis around the u64_to_user_ptr
in the macro should prevent expansion.

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


Thread

[PATCH v12 0/2] staging/android: Sync ABI rework Gustavo Padovan <gustavo@padovan.org> - 2016-04-21 17:40 +0200
  [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Gustavo Padovan <gustavo@padovan.org> - 2016-04-21 17:40 +0200
    Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Daniel Vetter <daniel@ffwll.ch> - 2016-04-22 10:40 +0200
      Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Gustavo Padovan <gustavo@padovan.org> - 2016-04-22 16:40 +0200
    Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Rob Clark <robdclark@gmail.com> - 2016-04-22 17:20 +0200
      Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Maarten Lankhorst <maarten.lankhorst@linux.intel.com> - 2016-04-24 12:50 +0200
    Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Lucas Stach <l.stach@pengutronix.de> - 2016-04-26 11:30 +0200
      Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Gustavo Padovan <gustavo.padovan@collabora.co.uk> - 2016-04-26 16:30 +0200
        Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr() Joe Perches <joe@perches.com> - 2016-04-26 16:50 +0200

csiph-web