* [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5
@ 2025-02-06 22:30 Przemek Kitszel
2025-02-07 1:49 ` Zhuo, Qiuxu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Przemek Kitszel @ 2025-02-06 22:30 UTC (permalink / raw)
To: intel-wired-lan, Tony Nguyen
Cc: netdev, Konrad Knitter, Przemek Kitszel, Qiuxu Zhuo,
Michal Swiatkowski, Simon Horman, Kees Cook, Jiri Slaby
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 <qiuxu.zhuo@intel.com>
Closes: https://lore.kernel.org/netdev/CY8PR11MB7134BF7A46D71E50D25FA7A989F72@CY8PR11MB7134.namprd11.prod.outlook.com
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Suggested-by: Simon Horman <horms@kernel.org>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
---
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/20250205104252.30464-2-przemyslaw.kitszel@intel.com
CC: Kees Cook <kees@kernel.org>
CC: Jiri Slaby <jirislaby@kernel.org>
---
drivers/net/ethernet/intel/ice/devlink/health.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/devlink/health.c b/drivers/net/ethernet/intel/ice/devlink/health.c
index ea40f7941259..19c3d37aa768 100644
--- a/drivers/net/ethernet/intel/ice/devlink/health.c
+++ b/drivers/net/ethernet/intel/ice/devlink/health.c
@@ -25,10 +25,10 @@ struct ice_health_status {
* The below lookup requires to be sorted by code.
*/
-static const char *const ice_common_port_solutions =
+static const char ice_common_port_solutions[] =
"Check your cable connection. Change or replace the module or cable. Manually set speed and duplex.";
-static const char *const ice_port_number_label = "Port Number";
-static const char *const ice_update_nvm_solution = "Update to the latest NVM image.";
+static const char ice_port_number_label[] = "Port Number";
+static const char ice_update_nvm_solution[] = "Update to the latest NVM image.";
static const struct ice_health_status ice_health_status_lookup[] = {
{ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_STRICT, "An unsupported module was detected.",
base-commit: 4241a702e0d0c2ca9364cfac08dbf134264962de
--
2.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5
2025-02-06 22:30 [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5 Przemek Kitszel
@ 2025-02-07 1:49 ` Zhuo, Qiuxu
2025-02-07 13:50 ` Simon Horman
2025-03-14 7:33 ` [Intel-wired-lan] " Mekala, SunithaX D
2 siblings, 0 replies; 4+ messages in thread
From: Zhuo, Qiuxu @ 2025-02-07 1:49 UTC (permalink / raw)
To: Kitszel, Przemyslaw, intel-wired-lan@lists.osuosl.org,
Nguyen, Anthony L
Cc: netdev@vger.kernel.org, Knitter, Konrad, Michal Swiatkowski,
Simon Horman, Kees Cook, Jiri Slaby
> From: Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>
> [...]
> Subject: [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 <qiuxu.zhuo@intel.com>
> Closes:
> https://lore.kernel.org/netdev/CY8PR11MB7134BF7A46D71E50D25FA7A989F
> 72@CY8PR11MB7134.namprd11.prod.outlook.com
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Suggested-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5
2025-02-06 22:30 [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5 Przemek Kitszel
2025-02-07 1:49 ` Zhuo, Qiuxu
@ 2025-02-07 13:50 ` Simon Horman
2025-03-14 7:33 ` [Intel-wired-lan] " Mekala, SunithaX D
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-02-07 13:50 UTC (permalink / raw)
To: Przemek Kitszel
Cc: intel-wired-lan, Tony Nguyen, netdev, Konrad Knitter, Qiuxu Zhuo,
Michal Swiatkowski, Kees Cook, Jiri Slaby
On Thu, Feb 06, 2025 at 11:30:23PM +0100, Przemek Kitszel wrote:
> 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 <qiuxu.zhuo@intel.com>
> Closes: https://lore.kernel.org/netdev/CY8PR11MB7134BF7A46D71E50D25FA7A989F72@CY8PR11MB7134.namprd11.prod.outlook.com
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Suggested-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
> 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/20250205104252.30464-2-przemyslaw.kitszel@intel.com
>
> CC: Kees Cook <kees@kernel.org>
> CC: Jiri Slaby <jirislaby@kernel.org>
Thanks Przemek,
Testing locally gcc 7.5.0 [1] seems happy with this.
Reviewed-by: Simon Horman <horms@kernel.org>
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.5.0/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [Intel-wired-lan] [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5
2025-02-06 22:30 [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5 Przemek Kitszel
2025-02-07 1:49 ` Zhuo, Qiuxu
2025-02-07 13:50 ` Simon Horman
@ 2025-03-14 7:33 ` Mekala, SunithaX D
2 siblings, 0 replies; 4+ messages in thread
From: Mekala, SunithaX D @ 2025-03-14 7:33 UTC (permalink / raw)
To: Kitszel, Przemyslaw, intel-wired-lan@lists.osuosl.org,
Nguyen, Anthony L
Cc: netdev@vger.kernel.org, Knitter, Konrad, Kitszel, Przemyslaw,
Zhuo, Qiuxu, Michal Swiatkowski, Simon Horman, Kees Cook,
Jiri Slaby
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Przemek Kitszel
> Sent: Thursday, February 6, 2025 2:30 PM
> To: intel-wired-lan@lists.osuosl.org; Nguyen, Anthony L <anthony.l.nguyen@intel.com>
> Cc: netdev@vger.kernel.org; Knitter, Konrad <konrad.knitter@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Zhuo, Qiuxu <qiuxu.zhuo@intel.com>; Michal Swiatkowski > <michal.swiatkowski@linux.intel.com>; Simon Horman <horms@kernel.org>; Kees Cook <kees@kernel.org>; Jiri Slaby <jirislaby@kernel.org>
> 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 <qiuxu.zhuo@intel.com>
> Closes: https://lore.kernel.org/netdev/CY8PR11MB7134BF7A46D71E50D25FA7A989F72@CY8PR11MB7134.namprd11.prod.outlook.com
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Suggested-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
> 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/20250205104252.30464-2-przemyslaw.kitszel@intel.com
>
> CC: Kees Cook <kees@kernel.org>
> CC: Jiri Slaby <jirislaby@kernel.org>
> ---
> drivers/net/ethernet/intel/ice/devlink/health.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-14 7:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 22:30 [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5 Przemek Kitszel
2025-02-07 1:49 ` Zhuo, Qiuxu
2025-02-07 13:50 ` Simon Horman
2025-03-14 7:33 ` [Intel-wired-lan] " Mekala, SunithaX D
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).