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 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: References: 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: 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 , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Arve =?ISO-8859-1?Q?Hj=F8nnev=E5g?= , Daniel Vetter , Andrew Morton , John Harrison 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 On Tue, 2016-04-26 at 11:29 -0300, Gustavo Padovan wrote: > 2016-04-26 Lucas Stach : > > Am Donnerstag, den 21.04.2016, 12:38 -0300 schrieb Gustavo Padovan: > > > From: Gustavo Padovan > > > > > > This function had copies in 3 different files. Unify them in kernel.h. > > > > > > Cc: Joe Perches > > > Cc: Andrew Morton > > > Cc: David Airlie > > > Cc: Daniel Vetter > > > Cc: Rob Clark > > > Signed-off-by: Gustavo Padovan > > > > > 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.