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 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 6B298CD98CC for ; Thu, 11 Jun 2026 09:51:01 +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:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UAc1xAuqrqBbaNGTCiUioRckoU10tWBV0WzMjQokYxU=; b=PR2jWrh6LZNDQECqS85C0tvU/v yScW9wy9iPGSjtvxNHWaMDdjJwyekGSOw0YSdBvcU3um9m/W3Vi9/QhDQ8jN6ep4rZrG7uXjP989r 4SuqV8ygvuzHHxm5CS7XIfN3fVU9aUq2soAda6mF0ge1PA6HgpLxn5v64jho6lFP2Wik2lvTvs2C6 ZZ8qOc8zwNRl+d8SFO6+sUcfrA06Zb8cZjqwm1Jfr9WDs/uvLhc3VZy6Ab3/c1DwiJvtRVHKPLe0Q bp8Y5slOP7nTT3rC34Nqr09unv9rSOCgWyOAZeN65CsccbMEfuSF6CaVaeiMf7Cyw55dO81ae/sqr /Qm9dqsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wXc3p-00000009AML-47KU; Thu, 11 Jun 2026 09:50:53 +0000 Received: from mail-eastusazon11011030.outbound.protection.outlook.com ([52.101.52.30] helo=BL2PR02CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wXc3n-00000009AL9-0pWu for linux-arm-kernel@lists.infradead.org; Thu, 11 Jun 2026 09:50:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xr0YeN4JlUgdFJrf2w3/aKqypgyH/Xh0qstXQHD/mIxVjNJBg0TirOTW0dROiEwOHin19iJ0REnuzpAfLJbaJ8XSLKeQWB2aSOz6Q0T0DdCup5wzb+dJK3D1a/IJBvCZVcSxFM846+fMU5w8tyBIoh7xxQQJpshvupYEF1dHdQfFLodFj4+n1/dPho7bD1YkG7bOcKjnrZC5HAa9gMpR3hB5XNT8wOOccc8wEJjTQrfB3PjDo1mWW0fgi29eH+L/v6fQ22FC3IgksF3U/u/MDIiwv/1Zf0LuRR2OQGkjJb0zwcjnAwCcHmKXMSCje4tcvefbf8BeZpTh7WA7xwEIZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UAc1xAuqrqBbaNGTCiUioRckoU10tWBV0WzMjQokYxU=; b=NZIKU3mghruES33sQTK9Rh/PBviqK4N3jhbQI5bqKhdwTw12fqVsnRNaDP2eLJMMQDVKr2ivsPpp5ssy6XptpBjL1qj9P9iX1tgJXeAzEZYEOey8EfClzKr4tnt3Id+aD19bT0cu4YwFW7snnO5/rdSHxhxLBNCF3vStKfCdxu+dro0Ni4KLQvmYPqSI380O+unqtqqc8x0twkF5JD7tRk//oDyY2/fn1UYGF1gPckt1VGK12bHNIAbWhoBO4xb9yr9KmTXXRMJkzKZW4UveUKOyKE69Tsz8nmfHKr2bmh4qeKNJOLW37dpIc8kZIZS711GKRsy79AcfBnZFIHznJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.23.194) smtp.rcpttodomain=davemloft.net smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UAc1xAuqrqBbaNGTCiUioRckoU10tWBV0WzMjQokYxU=; b=IvxR/5ZcDxYYJWtVirZehZpeTBtPVq+7mAMTNr/91DoTvb45vMXcIqmQN4GtDiKYIOauBX1XYEH5l2hpo/at4ZVrwmBOAEPcLwY5WiJKyqQx7Z9TR6+BU6f6Khw2lT6O0ijNNo5br2GEXXmcs+N3CHOET0J9IqoPMvs5agCAJZ8= Received: from BN9PR03CA0987.namprd03.prod.outlook.com (2603:10b6:408:109::32) by CH3PR10MB6884.namprd10.prod.outlook.com (2603:10b6:610:145::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.13; Thu, 11 Jun 2026 09:50:45 +0000 Received: from BN1PEPF00004681.namprd03.prod.outlook.com (2603:10b6:408:109:cafe::17) by BN9PR03CA0987.outlook.office365.com (2603:10b6:408:109::32) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.113.11 via Frontend Transport; Thu, 11 Jun 2026 09:50:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.23.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.23.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.23.194; helo=lewvzet200.ext.ti.com; pr=C Received: from lewvzet200.ext.ti.com (198.47.23.194) by BN1PEPF00004681.mail.protection.outlook.com (10.167.243.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.7 via Frontend Transport; Thu, 11 Jun 2026 09:50:44 +0000 Received: from DLEE209.ent.ti.com (157.170.170.98) by lewvzet200.ext.ti.com (10.4.14.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Thu, 11 Jun 2026 04:50:44 -0500 Received: from DLEE211.ent.ti.com (157.170.170.113) by DLEE209.ent.ti.com (157.170.170.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Thu, 11 Jun 2026 04:50:44 -0500 Received: from fllvem-mr07.itg.ti.com (10.64.41.89) by DLEE211.ent.ti.com (157.170.170.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37 via Frontend Transport; Thu, 11 Jun 2026 04:50:44 -0500 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by fllvem-mr07.itg.ti.com (8.18.1/8.18.1) with ESMTP id 65B9oir9091847; Thu, 11 Jun 2026 04:50:44 -0500 Received: from localhost (danish-tpc.dhcp.ti.com [172.24.231.152]) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 65B9ogTL014470; Thu, 11 Jun 2026 04:50:43 -0500 From: MD Danish Anwar To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Shuah Khan , MD Danish Anwar , Roger Quadros , Andrew Lunn , Meghana Malladi , Jacob Keller , David Carlier , "Vadim Fedorenko" , Kevin Hao , "Markus Elfring" , Hangbin Liu , Fernando Fernandez Mancera , Jan Vaclav CC: , , , Subject: [PATCH net-next v4 2/3] net: ti: icssg: Add static_assert to guard stat array counts Date: Thu, 11 Jun 2026 15:20:34 +0530 Message-ID: <20260611095035.852370-3-danishanwar@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260611095035.852370-1-danishanwar@ti.com> References: <20260611095035.852370-1-danishanwar@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004681:EE_|CH3PR10MB6884:EE_ X-MS-Office365-Filtering-Correlation-Id: 07d075ca-1a8e-43f7-b11a-08dec79ee861 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|376014|7416014|1800799024|23010399003|82310400026|921020|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 2OLlC1Fj+bFbLIrPdqQd314tDPCKhaW1KQkm2VwYeqHu89hQAxKVUkJFFNbXSAxmSb6do0w86KMvF4pUZ92DiYBKVPf/qnGgoRNXQAT4oh1cSaI9cQxENDlmdaKhMoGnrv4ZBNyIHeMNhQOJTuI8OXUikafQPQhYD5vN1BAyGKD9OwErWw8DuoWF43887Ww1/VLGzXlDwUhSycYNY1/zNXlotXsPi9I62JXPXY1sadnA6kugPQX6RHbSbt3lsdOcgvvWdKpGkJ7HRv8dd2wZcsnQE63GKd7R34OiLsnTvODrcv1iMkrMRL0eg5aRPN7vuStoBCnd/zAy91XB6ZvlYKqoxr3VgNGWOfh3c9c/lsNQhqaGfA+dwBO5d7UdDJ59XJfn1hnrEKQbWZm7sVENCHy6M58uSZFBzqC8rncO4vKzwWC1dvJipMW8tx08T03Sojz3hRxSRhIiYLK5xzIozC8ijsjtpj4nHwasWGHrqTwH9SVjBXLa1MgN2qpX2RGVUegVlo8fcboTbIUsN5V/CzyQm1/5ZL5dcs4vD9jxejDCu/U6e0aaLXo2GsvK6Bo6JLnfI2CAXNdZAwg4yVz5IkGPaQuSiBe73Xtfi73Yf0UhHn1bxc8CbRsYGH8CKBaIs7ZE6p7JaPaHl5T/X7HcJ+FoaEyG9fWRcSQz9AyeFr3irwhfWv8o0xbj/9tsDgaXXLYYscUyXoxoQu+tOJcDOFeRAEDy52bgjOaJ7mq/oDpzwni8UZr7UXG4GzC3twpaY2Jyg18+jjYDTvVQp0avJw== X-Forefront-Antispam-Report: CIP:198.47.23.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet200.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(376014)(7416014)(1800799024)(23010399003)(82310400026)(921020)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6Imi1F9GrBG8amyXBkC8lStWxBMyvCZGLXt2TX7WJLrh8nuP3QITBeus8uqi6TbtjPoqujdkjgJPWby9Ldu64y9YTsQMNANkblWkrhns/LUXONb2CCaAjrPmsWmkTsr5QsSgs36+XrwFNkVQZeUeEeFc7GRwoU7LMEueJI0gjBRl2lHwCDvOTBrGqskfHisuh4Ys1zQ1q2KEklyvhwoeKC4d5nB0ISk5rd7XOQw2jKMXq365r8/OssIJ8IbHQIeUZ8ADJhccaA3BR+THOSCi34eULsEe4zngD5V8Mm+b4U/+wg+ocMzpLKqsR+GER4f1z8FDxRYVC8u04RQtArtivP9olod3HWo939QEx5c5/2T/smV7meFQguvX8T4pFwXMBmmZ5dUVUl7UNKTTnUF00tGdQ4sr+0h7SwEkpeauQ5LM8iSEuIfF0c02JlZM7M5Y X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2026 09:50:44.9429 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07d075ca-1a8e-43f7-b11a-08dec79ee861 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.194];Helo=[lewvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004681.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB6884 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260611_025051_240182_8B95A0FC X-CRM114-Status: GOOD ( 10.39 ) 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 Place static_assert() immediately after each of icssg_all_miig_stats[] and icssg_all_pa_stats[] in icssg_stats.h to verify at build time that ICSSG_NUM_MIIG_STATS and ICSSG_NUM_PA_STATS stay in sync with the actual array sizes. This turns a silent miscount into a build error should either the constant or the array be updated independently. Signed-off-by: MD Danish Anwar --- drivers/net/ethernet/ti/icssg/icssg_stats.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/ti/icssg/icssg_stats.h b/drivers/net/ethernet/ti/icssg/icssg_stats.h index 5ec0b38e0c67d..6f4400d8a0f61 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_stats.h +++ b/drivers/net/ethernet/ti/icssg/icssg_stats.h @@ -155,6 +155,8 @@ static const struct icssg_miig_stats icssg_all_miig_stats[] = { ICSSG_MIIG_STATS(tx_bytes, true), }; +static_assert(ARRAY_SIZE(icssg_all_miig_stats) == ICSSG_NUM_MIIG_STATS); + #define ICSSG_PA_STATS(field) \ { \ #field, \ @@ -201,4 +203,6 @@ static const struct icssg_pa_stats icssg_all_pa_stats[] = { ICSSG_PA_STATS(FW_HOST_EGRESS_Q_EXP_OVERFLOW), }; +static_assert(ARRAY_SIZE(icssg_all_pa_stats) == ICSSG_NUM_PA_STATS); + #endif /* __NET_TI_ICSSG_STATS_H */ -- 2.34.1