From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B5A1C02194 for ; Fri, 7 Feb 2025 13:50:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2F9DC60651; Fri, 7 Feb 2025 13:50:17 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id c6l8cOhSDTly; Fri, 7 Feb 2025 13:50:16 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 476316066E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1738936216; bh=S+lsjWyw+nz+SF3V+dmblzSnVfJVJjaxzaNsfkDsaxw=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=3fP2QETLjf47Di0ap6l3XCIW+DjiOfGfqE9TYcPuZtKaP4B76jwIXvJFnNnqmR9eS nZ0T6HhXQwvQyYT5xRziKPicd+49fVEXUDVJsL0v4QepM69NvX2yYDwd0yKzQkNK8V lV1lm9EWNrrchWrIy/E0AKx+TcmY+NaIyrwz4sOJn3GBF9OdCGda7sjmSaM+FsVkXI BdcGaE3AVST5wj5BL0YlFU5WcnGqll2iFCO011ZpAYR2L5Cc7EKs2nE06MJzpqlQSt 2G0dPJlLbaBAKyb1N5PLZIFjbJYh5JL98AddodEytBDyKLAMFkRkq57HFz8Uznx43x PIb4+TrHYdiKQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 476316066E; Fri, 7 Feb 2025 13:50:16 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id 975B1E4 for ; Fri, 7 Feb 2025 13:50:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7B0A860651 for ; Fri, 7 Feb 2025 13:50:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id e5Ef13JSfpnc for ; Fri, 7 Feb 2025 13:50:14 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 96CB96066E DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 96CB96066E Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by smtp3.osuosl.org (Postfix) with ESMTPS id 96CB96066E for ; Fri, 7 Feb 2025 13:50:14 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1631A5C5717; Fri, 7 Feb 2025 13:49:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5CBFC4CED1; Fri, 7 Feb 2025 13:50:11 +0000 (UTC) Date: Fri, 7 Feb 2025 13:50:09 +0000 From: Simon Horman To: Przemek Kitszel Cc: intel-wired-lan@lists.osuosl.org, Tony Nguyen , netdev@vger.kernel.org, Konrad Knitter , Qiuxu Zhuo , Michal Swiatkowski , Kees Cook , Jiri Slaby Message-ID: <20250207135009.GW554665@kernel.org> References: <20250206223101.6469-2-przemyslaw.kitszel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250206223101.6469-2-przemyslaw.kitszel@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738936213; bh=FXMx362M+vYDOjieVoZGpLYHrbMAz5S5rLewpTVOEAk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HFYkuMg6vC1zD0GuPqaCzaNDauaBuw/Qrt9knuE1frfAL5TLawjPPrDlkeQjy7KC6 iUXTnpOKGkdSurXS2VcYv5Qx+idovVAxOBDv0UYxD7nT2RoGEXofUGJUKvq+5z1hUK Vx7+/lqBcbs5Pi4CAGCfIfgc01qZaEv7pni7cWduZrJHgXcuJH0LFk1b8eM3E7eFK7 xw0gBnoMtH7TDpWgEbvfHbEC+Vk+REP5+ytmZMkLHVWgKUcGkNV9AwWwtzyzDQQOcR Mfp8y976rFE3lveGsg9xaDo38F0zbE507epjqpHNJTXm+WHj5yTNYT07XUDn+5De1x sLGIRyHv4wYCA== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=HFYkuMg6 Subject: Re: [Intel-wired-lan] [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5 X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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 > Closes: https://lore.kernel.org/netdev/CY8PR11MB7134BF7A46D71E50D25FA7A989F72@CY8PR11MB7134.namprd11.prod.outlook.com > Reviewed-by: Michal Swiatkowski > Suggested-by: Simon Horman > Signed-off-by: Przemek Kitszel > --- > 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 > CC: Jiri Slaby Thanks Przemek, Testing locally gcc 7.5.0 [1] seems happy with this. Reviewed-by: Simon Horman [1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.5.0/ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D9F71F1509 for ; Fri, 7 Feb 2025 13:50:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738936213; cv=none; b=uZsURuN9C+zqdLvrPrQs06bdZp6Q6nHPQjPpElDUBp79V+sg+i0YEjEqW79nrRQTce0yAfecLxnnKNkjQVrBiewfbVi+URZlkzWiwxzIve79kNlPtcJFgk/VK0wbRN5pAJz3pXgu2qqmZNY+Xv6DuYAkfD8DaYOiobpxV5SgN5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738936213; c=relaxed/simple; bh=FXMx362M+vYDOjieVoZGpLYHrbMAz5S5rLewpTVOEAk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T7IgNZCIz3pohquJNTNbsU7FSjhk7pG8yDUuzxnvXdAdvPmfn0em5XJeEdvZO0W3eSF0Ea3Y0RIaSelA5J8k5Pzfmob+NLCGbRTD3iaCj2LsfUne1+6sKuzOFHE7YvVN6OGTN2J21uHLw6wYkpU938rNsCAKl4p5URqY54xhMS4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HFYkuMg6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HFYkuMg6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5CBFC4CED1; Fri, 7 Feb 2025 13:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738936213; bh=FXMx362M+vYDOjieVoZGpLYHrbMAz5S5rLewpTVOEAk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HFYkuMg6vC1zD0GuPqaCzaNDauaBuw/Qrt9knuE1frfAL5TLawjPPrDlkeQjy7KC6 iUXTnpOKGkdSurXS2VcYv5Qx+idovVAxOBDv0UYxD7nT2RoGEXofUGJUKvq+5z1hUK Vx7+/lqBcbs5Pi4CAGCfIfgc01qZaEv7pni7cWduZrJHgXcuJH0LFk1b8eM3E7eFK7 xw0gBnoMtH7TDpWgEbvfHbEC+Vk+REP5+ytmZMkLHVWgKUcGkNV9AwWwtzyzDQQOcR Mfp8y976rFE3lveGsg9xaDo38F0zbE507epjqpHNJTXm+WHj5yTNYT07XUDn+5De1x sLGIRyHv4wYCA== Date: Fri, 7 Feb 2025 13:50:09 +0000 From: Simon Horman To: Przemek Kitszel Cc: intel-wired-lan@lists.osuosl.org, Tony Nguyen , netdev@vger.kernel.org, Konrad Knitter , Qiuxu Zhuo , Michal Swiatkowski , Kees Cook , Jiri Slaby Subject: Re: [PATCH iwl-net v2] ice: health.c: fix compilation on gcc 7.5 Message-ID: <20250207135009.GW554665@kernel.org> References: <20250206223101.6469-2-przemyslaw.kitszel@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250206223101.6469-2-przemyslaw.kitszel@intel.com> 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 > Closes: https://lore.kernel.org/netdev/CY8PR11MB7134BF7A46D71E50D25FA7A989F72@CY8PR11MB7134.namprd11.prod.outlook.com > Reviewed-by: Michal Swiatkowski > Suggested-by: Simon Horman > Signed-off-by: Przemek Kitszel > --- > 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 > CC: Jiri Slaby Thanks Przemek, Testing locally gcc 7.5.0 [1] seems happy with this. Reviewed-by: Simon Horman [1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.5.0/