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()

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v12 1/2] kernel.h: add u64_to_user_ptr()
Date 2016-04-26 16:50 +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>
Organization linux.* mail to news gateway

Show all headers | 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