Skip to contentSkip to conversation

drm/amdkfd: Replace zero-length array with flexible-array member

PATCH In review Felix Kuehling 3 participants 3 messages Feb 16, 2022 AMD KFD

lore
Share & tools
lore

Felix Kuehling

author maintainer
#0 lore raw

PATCH 1/1 drm/amdkfd: Replace zero-length array with flexible-array member

Reference:
https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays

---
 include/uapi/linux/kfd_ioctl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/kfd_ioctl.h +1 -1
index 6e4268f5e482..baec5a41de3e 100644
@@ -673,7 +673,7 @@ struct kfd_ioctl_svm_args {
 	__u32 op;
 	__u32 nattr;
 	/* Variable length array of attributes */
-	struct kfd_ioctl_svm_attribute attrs[0];
+	struct kfd_ioctl_svm_attribute attrs[];
 };
 
 /**
Signature · 1 line
2.32.0
#1 lore raw

On 2022-02-15 7:38 p.m., Felix Kuehling wrote:
Reference: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays CC: Changcheng Deng <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Philip Yang <[email protected]>
--- include/uapi/linux/kfd_ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index 6e4268f5e482..baec5a41de3e 100644 --- a/include/uapi/linux/kfd_ioctl.h +++ b/include/uapi/linux/kfd_ioctl.h @@ -673,7 +673,7 @@ struct kfd_ioctl_svm_args { __u32 op; __u32 nattr; /* Variable length array of attributes */ - struct kfd_ioctl_svm_attribute attrs[0]; + struct kfd_ioctl_svm_attribute attrs[]; }; /**

Reviewed-by on v1 1/1
#2 lore raw
In reply to Felix Kuehling

Am 16.02.22 um 01:38 schrieb Felix Kuehling:

Quoted 5 lines

Reference:
https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays

Quoted 17 lines
---
  include/uapi/linux/kfd_ioctl.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/kfd_ioctl.h +1 -1
index 6e4268f5e482..baec5a41de3e 100644
@@ -673,7 +673,7 @@ struct kfd_ioctl_svm_args {
  	__u32 op;
  	__u32 nattr;
  	/* Variable length array of attributes */
-	struct kfd_ioctl_svm_attribute attrs[0];
+	struct kfd_ioctl_svm_attribute attrs[];
  };
 
  /**