> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of
> Przemek Kitszel
> Sent: Thursday, February 6, 2025 2:30 PM
> To: [email protected]; Nguyen, Anthony L
> <[email protected]>
> Cc: [email protected]; Knitter, Konrad <[email protected]>;
> Kitszel, Przemyslaw <[email protected]>; Zhuo, Qiuxu
> <[email protected]>; Michal Swiatkowski >
> <[email protected]>; Simon Horman <[email protected]>; Kees
> Cook <[email protected]>; Jiri Slaby <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-net v2] ice: health.c: fix compilation
> on gcc 7.5
>
> GCC 7 is not as good as GCC 8+ in telling what is a compile-time
> const, and thus could be used for static storage.
> Fortunately keeping strings as const arrays is enough to make old
> gcc happy.
>
> Excerpt from the report:
> My GCC is: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.
>
> CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.o
> drivers/net/ethernet/intel/ice/devlink/health.c:35:3: error: initializer
> element is not constant
> ice_common_port_solutions, {ice_port_number_label}},
> ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/ice/devlink/health.c:35:3: note: (near
> initialization for 'ice_health_status_lookup[0].solution')
> drivers/net/ethernet/intel/ice/devlink/health.c:35:31: error: initializer
> element is not constant
> ice_common_port_solutions, {ice_port_number_label}},
> ^~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/ice/devlink/health.c:35:31: note: (near
> initialization for 'ice_health_status_lookup[0].data_label[0]')
> drivers/net/ethernet/intel/ice/devlink/health.c:37:46: error: initializer
> element is not constant
> "Change or replace the module or cable.", {ice_port_number_label}},
> ^~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/intel/ice/devlink/health.c:37:46: note: (near
> initialization for 'ice_health_status_lookup[1].data_label[0]')
> drivers/net/ethernet/intel/ice/devlink/health.c:39:3: error: initializer
> element is not constant
> ice_common_port_solutions, {ice_port_number_label}},
> ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: 85d6164ec56d ("ice: add fw and port health reporters")
> Reported-by: Qiuxu Zhuo <[email protected]>
> Closes:
> https://lore.kernel.org/netdev/cy8pr11mb7134bf7a46d71e50d25fa7a989...@cy8pr11mb7134.namprd11.prod.outlook.com
> Reviewed-by: Michal Swiatkowski <[email protected]>
> Suggested-by: Simon Horman <[email protected]>
> Signed-off-by: Przemek Kitszel <[email protected]>
> ---
> v2: use static const char[] instead of #define - Simon
> +added RB tag from Michal, but not adding TB tag from Qiuxu
>
> v1:
>
> https://lore.kernel.org/netdev/[email protected]
>
> CC: Kees Cook <[email protected]>
> CC: Jiri Slaby <[email protected]>
> ---
> drivers/net/ethernet/intel/ice/devlink/health.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
Tested-by: Sunitha Mekala <[email protected]> (A Contingent worker at
Intel)