Thread (41 messages) 41 messages, 8 authors, 2025-12-19

Re: [patch V3 08/12] uaccess: Provide put/get_user_masked()

From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: 2025-10-17 13:41:43
Also in: linux-fsdevel, linux-riscv, linux-s390, linuxppc-dev, lkml

On 2025-10-17 06:09, Thomas Gleixner wrote:
Provide conveniance wrappers around scoped masked user access similiar to
convenience
similar
+/**
+ * get_user_masked - Read user data with masked access
+ * @_val:	The variable to store the value read from user memory
+ * @_usrc:	Pointer to the user space memory to read from
+ *
+ * Return: true if successful, false when faulted
^ '.' (or not) across sentences. Your choice, but it's irregular across
the series.
+ */
+#define get_user_masked(_val, _usrc)				\
+({								\
+	__label__ efault;					\
+	typeof((_usrc)) _tmpsrc	= (_usrc);			\
Remove extra () around _usrc in typeof.

UNIQUE_ID for _tmpsrc ?
+	bool ____ret = true;					\
Why so many underscores ? It there are nesting concerns,
it may be a sign that UNIQUE_ID is needed.

+ */
+#define put_user_masked(_val, _udst)				\
+({								\
+	__label__ efault;					\
+	typeof((_udst)) _tmpdst	= (_udst);			\
Remove extra () around _udst in typeof.

UNIQUE_ID for _tmpsrc ?
+	bool ____ret = true;	
UNIQUE_ID for ____ret ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help