> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-boun...@osuosl.org> On Behalf Of 
> Przemek Kitszel
> Sent: Wednesday, February 5, 2025 2:42 AM
> To: intel-wired-...@lists.osuosl.org; Nguyen, Anthony L 
> <anthony.l.ngu...@intel.com>
> Cc: net...@vger.kernel.org; Knitter, Konrad <konrad.knit...@intel.com>; 
> Michal Swiatkowski <michal.swiatkow...@linux.intel.com>; Kitszel, Przemyslaw 
> <przemyslaw.kits...@intel.com>; Zhuo, Qiuxu > <qiuxu.z...@intel.com>; Linus 
> Torvalds <torva...@linux-foundation.org>; Kees Cook <k...@kernel.org>; Nick 
> Desaulniers <nick.desaulni...@gmail.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net] 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. So we could not use variables
>  for that, no matter how much "const" keyword is sprinkled around.
>
> 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 <qiuxu.z...@intel.com>
> Closes: 
> https://lore.kernel.org/netdev/cy8pr11mb7134bf7a46d71e50d25fa7a989...@cy8pr11mb7134.namprd11.prod.outlook.com
> Signed-off-by: Przemek Kitszel <przemyslaw.kits...@intel.com>
> ---
> I would really like to bump min gcc to 8.5 (RH 8 family),
> instead of supporting old Ubuntu. However SLES 15 is also stuck with gcc 7.5 
> :(
>
> CC: Linus Torvalds <torva...@linux-foundation.org>
> CC: Kees Cook <k...@kernel.org>
> CC: Nick Desaulniers <nick.desaulni...@gmail.com>
> ---
>  drivers/net/ethernet/intel/ice/devlink/health.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
Tested-by: Sunitha Mekala <sunithax.d.mek...@intel.com> (A Contingent worker at 
Intel)

Reply via email to