diff mbox series

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

Message ID ZMpZZBShlLqyD3ax@work (mailing list archive)
State Mainlined
Commit 967afdf808cf66908a55c55b8ec5937cc20676ce
Headers show
Series alpha: Replace one-element array with flexible-array member | expand

Commit Message

Gustavo A. R. Silva Aug. 2, 2023, 1:25 p.m. UTC
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.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 arch/alpha/kernel/osf_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gustavo A. R. Silva Aug. 15, 2023, 8:02 p.m. UTC | #1
Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

On 8/2/23 07:25, Gustavo A. R. Silva wrote:
> 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.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>   arch/alpha/kernel/osf_sys.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
> index d98701ee36c6..5db88b627439 100644
> --- a/arch/alpha/kernel/osf_sys.c
> +++ b/arch/alpha/kernel/osf_sys.c
> @@ -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 {
Kees Cook Aug. 15, 2023, 11:44 p.m. UTC | #2
On Wed, 02 Aug 2023 07:25:56 -0600, Gustavo A. R. Silva wrote:
> 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,
diff mbox series

Patch

diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index d98701ee36c6..5db88b627439 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -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 {