Skip to contentSkip to conversation

fddi/skfp: Avoid the use of one-element array

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Sep 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fddi/skfp: Avoid the use of one-element array

One-element arrays are being deprecated[1]. Replace the one-element array with a simple object of type u_char: 'u_char rm_pad1'[2], once it seems this is just a placeholder for padding.

[1] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
[2] https://github.com/KSPP/linux/issues/86

---
 drivers/net/fddi/skfp/h/smc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/fddi/skfp/h/smc.h +1 -1
index 991857f6a83c..706fa619b703 100644
@@ -122,7 +122,7 @@ struct s_rmt {
 	u_char timer1_exp ;		/* flag : timer 1 expired */
 	u_char timer2_exp ;		/* flag : timer 2 expired */
 
-	u_char rm_pad1[1] ;
+	u_char rm_pad1;
 } ;
 
 /*
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw

From: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 29 Sep 2020 08:27:51 -0500

Quoted 10 lines

One-element arrays are being deprecated[1]. Replace the one-element array with a simple object of type u_char: 'u_char rm_pad1'[2], once it seems this is just a placeholder for padding.

[1] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
[2] https://github.com/KSPP/linux/issues/86

Applied, thanks.