* [PATCH] doc: add kernel-doc comment for u64_to_user_ptr
@ 2023-01-02 18:43 Federico Vaga
2023-01-02 19:03 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Federico Vaga @ 2023-01-02 18:43 UTC (permalink / raw)
To: Jonathan Corbet, Jens Axboe, Keith Busch, Peter Zijlstra,
Andrew Morton, Mark Rutland, Mikulas Patocka, Andy Shevchenko
Cc: Federico Vaga, linux-doc, linux-kernel
Add a kernel-doc comment in kernel.h to document the macro
`u64_to_user_ptr`.
As of today, this macro is mentioned in the documentation in
'ioctl.rst' and 'botching-up-ioctls.rst'
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
---
include/linux/kernel.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fe6efb24d151..8bcd126f64f2 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -56,6 +56,10 @@
#define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
+/**
+ * u64_to_user_ptr - convert an unsigned 64bit number into a user pointer
+ * @x: the number to convert
+ */
#define u64_to_user_ptr(x) ( \
{ \
typecheck(u64, (x)); \
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] doc: add kernel-doc comment for u64_to_user_ptr
2023-01-02 18:43 [PATCH] doc: add kernel-doc comment for u64_to_user_ptr Federico Vaga
@ 2023-01-02 19:03 ` Andy Shevchenko
2023-01-02 19:15 ` Federico Vaga
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2023-01-02 19:03 UTC (permalink / raw)
To: Federico Vaga
Cc: Jonathan Corbet, Jens Axboe, Keith Busch, Peter Zijlstra,
Andrew Morton, Mark Rutland, Mikulas Patocka, linux-doc,
linux-kernel
On Mon, Jan 02, 2023 at 07:43:49PM +0100, Federico Vaga wrote:
> Add a kernel-doc comment in kernel.h to document the macro
> `u64_to_user_ptr`.
We refer functions as func(), so `u64_to_user_ptr` --> u64_to_user_ptr().
> As of today, this macro is mentioned in the documentation in
> 'ioctl.rst' and 'botching-up-ioctls.rst'
Missing period at the end.
...
> +/**
> + * u64_to_user_ptr - convert an unsigned 64bit number into a user pointer
64-bit
> + * @x: the number to convert
Isn't 'number' is a bit misleading here?
It decodes the user pointer, that is encoded into unsigned 64-bit value.
Unfortunately I am not a native speaker, I can't propose anything better.
It might be that the 'number' is quite good choice, dunno.
> + */
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] doc: add kernel-doc comment for u64_to_user_ptr
2023-01-02 19:03 ` Andy Shevchenko
@ 2023-01-02 19:15 ` Federico Vaga
0 siblings, 0 replies; 3+ messages in thread
From: Federico Vaga @ 2023-01-02 19:15 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jonathan Corbet, Jens Axboe, Keith Busch, Peter Zijlstra,
Andrew Morton, Mark Rutland, Mikulas Patocka, linux-doc,
linux-kernel
On Mon, Jan 02, 2023 at 09:03:34PM +0200, Andy Shevchenko wrote:
>On Mon, Jan 02, 2023 at 07:43:49PM +0100, Federico Vaga wrote:
>> Add a kernel-doc comment in kernel.h to document the macro
>> `u64_to_user_ptr`.
>
>We refer functions as func(), so `u64_to_user_ptr` --> u64_to_user_ptr().
>
>> As of today, this macro is mentioned in the documentation in
>> 'ioctl.rst' and 'botching-up-ioctls.rst'
>
>Missing period at the end.
>
>...
>
>> +/**
>> + * u64_to_user_ptr - convert an unsigned 64bit number into a user pointer
>
>64-bit
>
>> + * @x: the number to convert
>
>Isn't 'number' is a bit misleading here?
>It decodes the user pointer, that is encoded into unsigned 64-bit value.
>Unfortunately I am not a native speaker, I can't propose anything better.
>It might be that the 'number' is quite good choice, dunno.
I agree about the macro's purpose. However, it does its job even if the 64-bit
value isn't a valid pointer (and this is what you will get). For this reason I
used a generic "number".
>> + */
>
>--
>With Best Regards,
>Andy Shevchenko
>
>
--
Federico Vaga
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-02 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-02 18:43 [PATCH] doc: add kernel-doc comment for u64_to_user_ptr Federico Vaga
2023-01-02 19:03 ` Andy Shevchenko
2023-01-02 19:15 ` Federico Vaga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox