Skip to contentSkip to conversation

alpha: Replace one-element array with flexible-array member

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Aug 2, 2023 – Aug 15, 2023 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alpha: Replace one-element array with flexible-array member

One-element and zero-length arrays are deprecated. So, replace one-element array in struct osf_dirent with flexible-array member.

This results in no differences in binary output.

---
 arch/alpha/kernel/osf_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/alpha/kernel/osf_sys.c +1 -1
index d98701ee36c6..5db88b627439 100644
@@ -97,7 +97,7 @@ struct osf_dirent {
 	unsigned int d_ino;
 	unsigned short d_reclen;
 	unsigned short d_namlen;
-	char d_name[1];
+	char d_name[];
 };
 
 struct osf_dirent_callback {
Signature · 1 line
2.34.1
#1 lore raw

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 24 lines · Gustavo A. R. Silva

One-element and zero-length arrays are deprecated. So, replace one-element array in struct osf_dirent with flexible-array member.

This results in no differences in binary output.

---
  arch/alpha/kernel/osf_sys.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/alpha/kernel/osf_sys.c +1 -1
index d98701ee36c6..5db88b627439 100644
@@ -97,7 +97,7 @@ struct osf_dirent {
  	unsigned int d_ino;
  	unsigned short d_reclen;
  	unsigned short d_namlen;
-	char d_name[1];
+	char d_name[];
  };
 
  struct osf_dirent_callback {
Applied
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

One-element and zero-length arrays are deprecated. So, replace one-element array in struct osf_dirent with flexible-array member.

This results in no differences in binary output.
[...]

Applied to for-next/hardening, thanks!

[1/1] alpha: Replace one-element array with flexible-array member

      https://git.kernel.org/kees/c/967afdf808cf

Take care,

Signature · 1 line
Kees Cook