-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Move the conflicting declaration to the end of the structure. Notice
that `struct ehci_hcd` is a flexible structure --a structure that
contains a flexible-array member.

Fix the following warning:

drivers/usb/host/ehci-fsl.c:414:25: warning: structure containing a flexible 
array member is not at the end of another structure 
[-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
 drivers/usb/host/ehci-fsl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 26f13278d4d6..c720d55f4982 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -411,12 +411,13 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
 }
 
 struct ehci_fsl {
-       struct ehci_hcd ehci;
-
 #ifdef CONFIG_PM
        /* Saved USB PHY settings, need to restore after deep sleep. */
        u32 usb_ctrl;
 #endif
+
+       /* Must be last --ends in a flexible-array member. */
+       struct ehci_hcd ehci;
 };
 
 #ifdef CONFIG_PM
-- 
2.43.0


Reply via email to