From patchwork Tue Aug 6 10:52:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13754664 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E59B6C52D6F for ; Tue, 6 Aug 2024 10:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Izogh++1rhttLO6+hnyp9mYYf6FZ1R91KNiqgjg7x8c=; b=eDyMyFlR1EpJHAwpLsAaR+eHSS D6b/k6KEhCDIPWVzx7ZfpBmlJgLGQcPrC0PsKJqT2zp0kycy4E2N/i6z4lKJirlo71Sv6+fJ04r3J g7nnQYnk8sQpp4yjaR4mqOTbQHwA/7Ele79QnGiIln4p16jvx0+iNB+74bvcbtHbgwqAel7Qmyd3I agVb6DjXesYgaaKDvwreJ/VfEVeCubBMbnrey+toDkqKErkYYlhilFboUHnNyWEVeMYic+Y2fxs/j 46y9CLxnLYK59VXkYYWTafBE3HQChbqISYQhY5MUIu//pBzYZwvSosDe3olWM+dgyuGUkoRh4ZAmV Q6KAIZ+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbHoc-00000001HON-3gSb; Tue, 06 Aug 2024 10:53:18 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbHnX-00000001H7e-12Fs for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 10:52:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 6503FCE0E50; Tue, 6 Aug 2024 10:52:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A801C32786; Tue, 6 Aug 2024 10:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722941528; bh=+al5FmN+16P24jfwWkecabgEd+xqc7Jwsjs9HXuUbLk=; h=From:Date:Subject:To:Cc:From; b=V84xQF8WVMRn5GhPF31w6xnhf43JeB3DthohuV5AVuCLVj88AtBm6+BTKq8fkyReE WcaMuePO+aQn+mODpPaKBKFG9zt2JiIQAUyWJ3sKq2mYfNALh607fH+UiGmnKcJZqZ L5fVHFawgDE0fJuMMaVCfv9cSqv5HC6dE067ZlC5hYzi9rpucGdBHHMzsBVDWjzS/x 5980q/y7dTm7s9ez/ZKetHlv6XXTMPaKq0oTcH1oeO2BZOfUdm7zOl3C6+3F/aA5wi RWkMvfsDJm6VcP5e30cMNBLYyAuT9dTo5CVlRbxSZJU++lzl+RT7sRehkuy1qjn4F8 UCiro8FbDQiqw== From: Simon Horman Date: Tue, 06 Aug 2024 11:52:01 +0100 Subject: [PATCH net-next] net: stmmac: xgmac: use const char arrays for string constants MIME-Version: 1.0 Message-Id: <20240806-xgmac-const-char-arrays-v1-1-8d91ec885d45@kernel.org> X-B4-Tracking: v=1; b=H4sIAFAAsmYC/x2MQQqDMBAAvyJ77kJMQyP9ivQQ49buoavsBomIf 2/ocWBmTjBSJoNnd4LSzsarNOhvHeRPkoWQ58bgnQ9ucA+syzdlzKtYwWYoJtV0GIbYz8Pdxyn EDK3elN5c/+cRhAoK1QKv6/oBrfzMJnMAAAA= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexandre Torgue , Jiri Slaby , Jose Abreu , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_035211_735077_69AC09EC X-CRM114-Status: UNSURE ( 9.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Jiri Slaby advises me that the preferred mechanism for declaring string constants is static char arrays, so use that here. This mostly reverts commit 1692b9775e74 ("net: stmmac: xgmac: use #define for string constants") That commit was a fix for commit 46eba193d04f ("net: stmmac: xgmac: fix handling of DPP safety error for DMA channels"). The fix being replacing const char * with #defines in order to address compilation failures observed on GCC 6 through 10. Compile tested only. No functional change intended. Suggested-by: Jiri Slaby Link: https://lore.kernel.org/netdev/485dbc5a-a04b-40c2-9481-955eaa5ce2e2@kernel.org/ Signed-off-by: Simon Horman --- .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 69 +++++++++++----------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index f196cd99d510..cbf2dd976ab1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -846,42 +846,41 @@ static const struct dwxgmac3_error_desc dwxgmac3_dma_errors[32]= { { false, "UNKNOWN", "Unknown Error" }, /* 31 */ }; -#define DPP_RX_ERR "Read Rx Descriptor Parity checker Error" -#define DPP_TX_ERR "Read Tx Descriptor Parity checker Error" - +static const char dpp_rx_err[] = "Read Rx Descriptor Parity checker Error"; +static const char dpp_tx_err[] = "Read Tx Descriptor Parity checker Error"; static const struct dwxgmac3_error_desc dwxgmac3_dma_dpp_errors[32] = { - { true, "TDPES0", DPP_TX_ERR }, - { true, "TDPES1", DPP_TX_ERR }, - { true, "TDPES2", DPP_TX_ERR }, - { true, "TDPES3", DPP_TX_ERR }, - { true, "TDPES4", DPP_TX_ERR }, - { true, "TDPES5", DPP_TX_ERR }, - { true, "TDPES6", DPP_TX_ERR }, - { true, "TDPES7", DPP_TX_ERR }, - { true, "TDPES8", DPP_TX_ERR }, - { true, "TDPES9", DPP_TX_ERR }, - { true, "TDPES10", DPP_TX_ERR }, - { true, "TDPES11", DPP_TX_ERR }, - { true, "TDPES12", DPP_TX_ERR }, - { true, "TDPES13", DPP_TX_ERR }, - { true, "TDPES14", DPP_TX_ERR }, - { true, "TDPES15", DPP_TX_ERR }, - { true, "RDPES0", DPP_RX_ERR }, - { true, "RDPES1", DPP_RX_ERR }, - { true, "RDPES2", DPP_RX_ERR }, - { true, "RDPES3", DPP_RX_ERR }, - { true, "RDPES4", DPP_RX_ERR }, - { true, "RDPES5", DPP_RX_ERR }, - { true, "RDPES6", DPP_RX_ERR }, - { true, "RDPES7", DPP_RX_ERR }, - { true, "RDPES8", DPP_RX_ERR }, - { true, "RDPES9", DPP_RX_ERR }, - { true, "RDPES10", DPP_RX_ERR }, - { true, "RDPES11", DPP_RX_ERR }, - { true, "RDPES12", DPP_RX_ERR }, - { true, "RDPES13", DPP_RX_ERR }, - { true, "RDPES14", DPP_RX_ERR }, - { true, "RDPES15", DPP_RX_ERR }, + { true, "TDPES0", dpp_tx_err }, + { true, "TDPES1", dpp_tx_err }, + { true, "TDPES2", dpp_tx_err }, + { true, "TDPES3", dpp_tx_err }, + { true, "TDPES4", dpp_tx_err }, + { true, "TDPES5", dpp_tx_err }, + { true, "TDPES6", dpp_tx_err }, + { true, "TDPES7", dpp_tx_err }, + { true, "TDPES8", dpp_tx_err }, + { true, "TDPES9", dpp_tx_err }, + { true, "TDPES10", dpp_tx_err }, + { true, "TDPES11", dpp_tx_err }, + { true, "TDPES12", dpp_tx_err }, + { true, "TDPES13", dpp_tx_err }, + { true, "TDPES14", dpp_tx_err }, + { true, "TDPES15", dpp_tx_err }, + { true, "RDPES0", dpp_rx_err }, + { true, "RDPES1", dpp_rx_err }, + { true, "RDPES2", dpp_rx_err }, + { true, "RDPES3", dpp_rx_err }, + { true, "RDPES4", dpp_rx_err }, + { true, "RDPES5", dpp_rx_err }, + { true, "RDPES6", dpp_rx_err }, + { true, "RDPES7", dpp_rx_err }, + { true, "RDPES8", dpp_rx_err }, + { true, "RDPES9", dpp_rx_err }, + { true, "RDPES10", dpp_rx_err }, + { true, "RDPES11", dpp_rx_err }, + { true, "RDPES12", dpp_rx_err }, + { true, "RDPES13", dpp_rx_err }, + { true, "RDPES14", dpp_rx_err }, + { true, "RDPES15", dpp_rx_err }, }; static void dwxgmac3_handle_dma_err(struct net_device *ndev,