mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tee: move tee_ioctl_shm_register_data to above IOCTL definition
@ 2026-09-03 17:57 Andrew Davis
  2026-09-10  9:13 ` Sumit Garg
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Davis @ 2026-09-03 17:57 UTC (permalink / raw)
  To: Jens Wiklander, Sumit Garg, op-tee, linux-kernel; +Cc: Andrew Davis

Most of the struct definitions for a given IOCTL definition immediately
preceded that definition. The struct tee_ioctl_shm_register_data is an
exception as it is placed above the TEE_IOC_SHM_REGISTER_FD definition,
not the TEE_IOC_SHM_REGISTER one it is to be used with. Move it down
to match the others.

This is a non-functional change for consistency and to help prevent
someone from accidentally using the wrong struct with the wrong IOCTL
based on the struct's location.

Fix a couple small spelling issues while here.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 include/uapi/linux/tee.h | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h
index 5203977ed35d1..76815b0f4b665 100644
--- a/include/uapi/linux/tee.h
+++ b/include/uapi/linux/tee.h
@@ -384,24 +384,6 @@ struct tee_iocl_supp_send_arg {
 #define TEE_IOC_SUPPL_SEND	_IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \
 				     struct tee_ioctl_buf_data)
 
-/**
- * struct tee_ioctl_shm_register_data - Shared memory register argument
- * @addr:      [in] Start address of shared memory to register
- * @length:    [in/out] Length of shared memory to register
- * @flags:     [in/out] Flags to/from registration.
- * @id:                [out] Identifier of the shared memory
- *
- * The flags field should currently be zero as input. Updated by the call
- * with actual flags as defined by TEE_IOCTL_SHM_* above.
- * This structure is used as argument for TEE_IOC_SHM_REGISTER below.
- */
-struct tee_ioctl_shm_register_data {
-	__u64 addr;
-	__u64 length;
-	__u32 flags;
-	__s32 id;
-};
-
 /**
  * struct tee_ioctl_shm_register_fd_data - Shared memory registering argument
  * @fd:		[in] File descriptor identifying dmabuf reference
@@ -426,13 +408,31 @@ struct tee_ioctl_shm_register_fd_data {
  * Returns a file descriptor on success or < 0 on failure
  *
  * The returned file descriptor refers to the shared memory object in the
- * kernel. The supplied file deccriptor can be closed if it's not needed
+ * kernel. The supplied file descriptor can be closed if it's not needed
  * for other purposes. The shared memory is freed when the descriptor is
  * closed.
  */
 #define TEE_IOC_SHM_REGISTER_FD	_IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 8, \
 				     struct tee_ioctl_shm_register_fd_data)
 
+/**
+ * struct tee_ioctl_shm_register_data - Shared memory register argument
+ * @addr:      [in] Start address of shared memory to register
+ * @length:    [in/out] Length of shared memory to register
+ * @flags:     [in/out] Flags to/from registration.
+ * @id:                [out] Identifier of the shared memory
+ *
+ * The flags field should currently be zero as input. Updated by the call
+ * with actual flags as defined by TEE_IOCTL_SHM_* above.
+ * This structure is used as argument for TEE_IOC_SHM_REGISTER below.
+ */
+struct tee_ioctl_shm_register_data {
+	__u64 addr;
+	__u64 length;
+	__u32 flags;
+	__s32 id;
+};
+
 /**
  * TEE_IOC_SHM_REGISTER - Register shared memory argument
  *
@@ -440,7 +440,7 @@ struct tee_ioctl_shm_register_fd_data {
  *
  * Returns a file descriptor on success or < 0 on failure
  *
- * The shared memory is unregisterred when the descriptor is closed.
+ * The shared memory is unregistered when the descriptor is closed.
  */
 #define TEE_IOC_SHM_REGISTER   _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 9, \
 				     struct tee_ioctl_shm_register_data)
-- 
2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tee: move tee_ioctl_shm_register_data to above IOCTL definition
  2026-09-03 17:57 [PATCH] tee: move tee_ioctl_shm_register_data to above IOCTL definition Andrew Davis
@ 2026-09-10  9:13 ` Sumit Garg
  2026-09-10  9:21   ` Sumit Garg
  0 siblings, 1 reply; 3+ messages in thread
From: Sumit Garg @ 2026-09-10  9:13 UTC (permalink / raw)
  To: Andrew Davis; +Cc: Jens Wiklander, Sumit Garg, op-tee, linux-kernel

On Thu, 03 Sep 2026 at 12:57:30 -0500, Andrew Davis via OP-TEE wrote:
>Most of the struct definitions for a given IOCTL definition immediately
>preceded that definition. The struct tee_ioctl_shm_register_data is an
>exception as it is placed above the TEE_IOC_SHM_REGISTER_FD definition,
>not the TEE_IOC_SHM_REGISTER one it is to be used with. Move it down
>to match the others.
>
>This is a non-functional change for consistency and to help prevent
>someone from accidentally using the wrong struct with the wrong IOCTL
>based on the struct's location.
>
>Fix a couple small spelling issues while here.
>
>Signed-off-by: Andrew Davis <afd@ti.com>
>---
> include/uapi/linux/tee.h | 40 ++++++++++++++++++++--------------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

-Sumit

>diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h
>index 5203977ed35d1..76815b0f4b665 100644
>--- a/include/uapi/linux/tee.h
>+++ b/include/uapi/linux/tee.h
>@@ -384,24 +384,6 @@ struct tee_iocl_supp_send_arg {
> #define TEE_IOC_SUPPL_SEND	_IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \
> 				     struct tee_ioctl_buf_data)
>
>-/**
>- * struct tee_ioctl_shm_register_data - Shared memory register argument
>- * @addr:      [in] Start address of shared memory to register
>- * @length:    [in/out] Length of shared memory to register
>- * @flags:     [in/out] Flags to/from registration.
>- * @id:                [out] Identifier of the shared memory
>- *
>- * The flags field should currently be zero as input. Updated by the call
>- * with actual flags as defined by TEE_IOCTL_SHM_* above.
>- * This structure is used as argument for TEE_IOC_SHM_REGISTER below.
>- */
>-struct tee_ioctl_shm_register_data {
>-	__u64 addr;
>-	__u64 length;
>-	__u32 flags;
>-	__s32 id;
>-};
>-
> /**
>  * struct tee_ioctl_shm_register_fd_data - Shared memory registering argument
>  * @fd:		[in] File descriptor identifying dmabuf reference
>@@ -426,13 +408,31 @@ struct tee_ioctl_shm_register_fd_data {
>  * Returns a file descriptor on success or < 0 on failure
>  *
>  * The returned file descriptor refers to the shared memory object in the
>- * kernel. The supplied file deccriptor can be closed if it's not needed
>+ * kernel. The supplied file descriptor can be closed if it's not needed
>  * for other purposes. The shared memory is freed when the descriptor is
>  * closed.
>  */
> #define TEE_IOC_SHM_REGISTER_FD	_IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 8, \
> 				     struct tee_ioctl_shm_register_fd_data)
>
>+/**
>+ * struct tee_ioctl_shm_register_data - Shared memory register argument
>+ * @addr:      [in] Start address of shared memory to register
>+ * @length:    [in/out] Length of shared memory to register
>+ * @flags:     [in/out] Flags to/from registration.
>+ * @id:                [out] Identifier of the shared memory
>+ *
>+ * The flags field should currently be zero as input. Updated by the call
>+ * with actual flags as defined by TEE_IOCTL_SHM_* above.
>+ * This structure is used as argument for TEE_IOC_SHM_REGISTER below.
>+ */
>+struct tee_ioctl_shm_register_data {
>+	__u64 addr;
>+	__u64 length;
>+	__u32 flags;
>+	__s32 id;
>+};
>+
> /**
>  * TEE_IOC_SHM_REGISTER - Register shared memory argument
>  *
>@@ -440,7 +440,7 @@ struct tee_ioctl_shm_register_fd_data {
>  *
>  * Returns a file descriptor on success or < 0 on failure
>  *
>- * The shared memory is unregisterred when the descriptor is closed.
>+ * The shared memory is unregistered when the descriptor is closed.
>  */
> #define TEE_IOC_SHM_REGISTER   _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 9, \
> 				     struct tee_ioctl_shm_register_data)
>-- 
>2.39.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tee: move tee_ioctl_shm_register_data to above IOCTL definition
  2026-09-10  9:13 ` Sumit Garg
@ 2026-09-10  9:21   ` Sumit Garg
  0 siblings, 0 replies; 3+ messages in thread
From: Sumit Garg @ 2026-09-10  9:21 UTC (permalink / raw)
  To: Andrew Davis, Jens Wiklander, Sumit Garg, op-tee, linux-kernel

On Thu, 10 Sep 2026 at 14:43:44 +0530, Sumit Garg via OP-TEE wrote:
>On Thu, 03 Sep 2026 at 12:57:30 -0500, Andrew Davis via OP-TEE wrote:
>>Most of the struct definitions for a given IOCTL definition immediately
>>preceded that definition. The struct tee_ioctl_shm_register_data is an
>>exception as it is placed above the TEE_IOC_SHM_REGISTER_FD definition,
>>not the TEE_IOC_SHM_REGISTER one it is to be used with. Move it down
>>to match the others.
>>
>>This is a non-functional change for consistency and to help prevent
>>someone from accidentally using the wrong struct with the wrong IOCTL
>>based on the struct's location.
>>
>>Fix a couple small spelling issues while here.
>>
>>Signed-off-by: Andrew Davis <afd@ti.com>
>>---
>>include/uapi/linux/tee.h | 40 ++++++++++++++++++++--------------------
>>1 file changed, 20 insertions(+), 20 deletions(-)
>>
>
>Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
>
>-Sumit

Andrew,

Please check your get_maintainers script, it's too old to pick up wrong
maintainer's email ID. I have updated it now.

-Sumit

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-10  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 17:57 [PATCH] tee: move tee_ioctl_shm_register_data to above IOCTL definition Andrew Davis
2026-09-10  9:13 ` Sumit Garg
2026-09-10  9:21   ` Sumit Garg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®