From patchwork Sun May 5 22:26:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13654697 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 795ACC4345F for ; Sun, 5 May 2024 22:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=LylvZzhssh75+jdrcceCrPdB2KLwRx3UNsa4exm+Zpo=; b=MPZ3kSHntcJR3v 8P5ONj/zMmonDL+Ao1RAmPJV07Nhgg3ZQyXyAIllAm011apYhfx4jbBEo+cnK78uC16ai+qGVvgqE swSfDvDVO7ouFXUmZ+to1otW31FfGu1pbtmu0KTvEyeQpIaVIgf562cm2w2YXClRZaWE0Un5VQgNe MvZFcL8cIKZcEuVX+tnBgSnnszplOs6XCT96tATa+JKCxjY6i2kU/eM35u8x+hA6hinkLzXxyLPgx 2jbhWonOGHrR4Iv4fcKd9pj0n1/33JF7WmcFdI3scxkF33kjpXHxVx1D9tf8p1KECBLmlfJEvyUsX 4SxXbh7tS8E9WmqgK/xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3kKC-00000005Qyf-37gh; Sun, 05 May 2024 22:27:16 +0000 Received: from mail-dm6nam11on20601.outbound.protection.outlook.com ([2a01:111:f403:2415::601] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3kK9-00000005Qvh-19y9; Sun, 05 May 2024 22:27:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wp2z3bOoIJAiuw5CkEhD6Zw1F5x8th80U/GnAyXg3pZGn5M5EsGlLGR3NuSmPIlbHTmw/iUFq4upwPDWy3venD3z2ixhcu+NdUdnJIAnmEKp1aCWHhTGMNf1Ob+mMU/7dZhmnrScJlLz7CeZfUDZb5A8ZWmsQu6i833Sntg/3x3cB76sNgXJ3+uA8drE1EBHqsfdBaWvOLmFlMurlxq+pYjgC2dGvoKjhd423ncFQDN4tYoztuENF1jOxoQSLdsOxMuN7bUMQTdq7UdoNFEGgXkcW5Py7ASchS6GNbgvWF0UAm+217i+/2U1DzvAZEDrACxI8ufcOKymtEw2Z5XZmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=6+6rQ82Asznxuxs1pwuTWwPA2rHPf2EwWRBjGwrBVwA=; b=DAedQ02qg0yBNPAombGEqCjkQmvfbnjSKyDyr8j3HXLRHkMw6fzFEImPT7BCKwaIT+ERMyRi4g4/OJLR1ys2aJYh+eXj9gDSJmUGGmD90sGC+svMHR2msE4Z+3AnP+Du5KGmcqOv7rI11D0w+IvJBdHCy/+huhFDcjOHfyVsmhbqewPF8dYUVXUSI3+ZcgUhn4Tos/D6ph50LU9mIdslLNozabtKDulBc1b7yEhwCUcaM/KCx0KfK8U832POEZ+vy141c5bZES0/QOfdie57POERaw67l6bCnfYcMY0WsataB4iOfGiyRcGLtA1hUXLkXCOLZgaYzEACXQbQDr0LHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6+6rQ82Asznxuxs1pwuTWwPA2rHPf2EwWRBjGwrBVwA=; b=e9wNgF12EG37c+PY7JyXrRB8v4QqGONXVNoavvSZb5cMHDNroiCtIgT8YRol4/53Vlp1hSoDlpO47yHjgBHEHNXSQtbuN4mmWnupTYwvgoroF+x6YAKYzYbnM6dP3CiVfjIeUVxzvVG71wWqVg/qpUQz+2FmKdTO2FpGXetlYuduTfRPIQerNxnK+z+qdD5UbcSty+aACqmPTjiZNSxGgABe6JqrAC8kpJ8muwxZnBzy5ZQQBp5Aj+ePiuXAeu39PUnZibXSnKUahgH5relkYglVF2c6nMjDAvicd5xG7WmRDXCWOXGavQ2X7nkTPjyzugKfDprILU9XrCNZHyLDwg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by LV3PR12MB9265.namprd12.prod.outlook.com (2603:10b6:408:215::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39; Sun, 5 May 2024 22:26:52 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%4]) with mapi id 15.20.7544.041; Sun, 5 May 2024 22:26:51 +0000 From: John Hubbard To: Shuah Khan Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Pravin B Shelar , Willem de Bruijn , Alexander Mikhalitsyn , zhujun2 , Petr Machata , Ido Schimmel , Hangbin Liu , Nikolay Aleksandrov , Benjamin Poirier , Sebastian Andrzej Siewior , Dmitry Safonov <0x7f454c46@gmail.com>, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, dev@openvswitch.org, Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, John Hubbard Subject: [PATCH 1/2] selftests/net: suppress clang's "variable-sized type not at the end" warning Date: Sun, 5 May 2024 15:26:38 -0700 Message-ID: <20240505222639.70317-1-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.0 X-NVConfidentiality: public X-ClientProxiedBy: BYAPR05CA0093.namprd05.prod.outlook.com (2603:10b6:a03:e0::34) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|LV3PR12MB9265:EE_ X-MS-Office365-Filtering-Correlation-Id: b09bd21b-1e1d-42f3-5ebe-08dc6d5275d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|7416005|366007; X-Microsoft-Antispam-Message-Info: CjaI5GgeGp6NuTwWa+esuIXfke8fvm3a8jCO9Ld4dMSkY32IvD/2yiJS7fZvovyZ3J1pfns9eYjZP74aONXBR2sVA64J17Zx66h4Q4TkXUzGKrmvq9mzfUzP5GxZ+SfFEA+dfeTwvbUViJnGtYuMUlMQUM9f9kYJgbq6sIFBcySujkYb1S+PpkXWxdWsWIQBQK0XgVn5hOe/77Z7QZhYRt/n64WK0+WxZEV/Rki/+Njt28Y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: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4OqZA8n8FWetYkyoP0j8dLnh2Vg0qJP3GVoeojohSz3PKdTOC6iXwdg8YSNm/I8JdW2dQoj5JJL6DqGXhXZNUKnIFFJ17K9NEjYhP8KSEay2oAFcSzDpD905bmD7FMd7gla1BD/NVMKYC1JEbhmz2OUBYrUokN1BUfdnNfq9ob9DjS5KOW+h2entV54m5koNQky47wNViqxDc6x53FZ8KwNmV5JmXJ3n+EAEAQYbr/Tusyb2JrS9gvh5D/GZMaQkCQKcHRMqXSAglBTxVi3Gzg1KdfXB+kgI0nPJ233CKgEG1aDVLjhzexxXqpFpXZSw+JOilndzQ6nS0o8LwW5jIWXlSUbHXiiEorqlElEubPcp55IJKSA9RBLJLOYFVgayCYyYowxI2TJEevvtgWC06Gjvj4pL30FZmlIYGNcEOZFuv9eGVfw95X6fzdkkt1wDuPq96BvF1d0jjBgqqQtJsczK+1OuozRCwQcgfZugLxYildjThDWCYaMZ8Ppo6v+LYwAUzEcKBE7GbUH4yPhQp0QONzbYCJQQbuJFaX2FelCHZncGtENsINM/Z0zWCuDdaHzCMVFtA4RYgww6tbJ5QGJxav0JjthJb+IPhqcQMtQUB38SNUnMMmKFB/0Agrh0N9ZeynneccfNmkEnV5UcfgXjKBSMmIc8zots6oimfqz3nqXu9Z+aneOg8graq1hO4CH8SSyeR2W/yX4/Qqftl2hJAtgZO0LYYEI2I+JNr+jJJzV0mCr7af9okf3ZZSH7Psvgre/ba/AwyY4sMejHuxMYUsCT+BJRiX2WDa9DueKzK5JPhDwyTOg0mzSSwWHAU05OxUo1nIIKPFv5LCsWDceFjVgpWjL3kTlcPbk30syuRwqTlWigk/0cCBUZAlJfwEsNL0b1O7ev/IxKxUe4MWVJ1cLmqxU/mXVZ0T2V4Yfwl/puUVn8nUiBHpXCqA8LKtDW9WSqpimAhwN7sctBIvjLuqVv11dkzX4JKTvvk/90BB/TwZ7x/hyLKVqIiqaj00MuBwcnfTAAcM3JE9VKszFGTm3naT6sUN3G+8NAuUttDmHv+1HJDZm69SU/DOSMozx316bMjMKbVf3h4xKpyGplDqRBuOCfSB4fwHLk54sSo6ViU6Drj8zG/9fCyVcBMjOBD2G0OjAlO766JretRzPdVbiIQZDZZr95vFlSXtgPLDznOQw8onuY7LQtx4WX5Uulg0HN0SgAwUnkYtACml3vc592kHjFfQoV7he2l0oPp26lEcTPm3U2h3vX++JH90xjo3tUalet7GrAMbEKD4FyWsB7vlMeh+QWS2v7F7QsS1QudAb2JvZo6hE3N1XlT3FW2rNt16xILUVRYey7jNaWfIM4+KWLb1/PXy1JQQIX3aPOLhIyzeyHa7Zzxhq3N+E7qVn8mEDkcUNLZGdbhOFRV4tqSYxKEowLLntk4I/0sFt7hqLxPAVuS1NVjdFxoXsswH9TEAKe129Dv17RHGoohsg2xcsnu6uMzVk6nsWxIaut4+i/+Jkyj/rhS5qzTQzWwjCt65gnxFCxh7/t7c2L9IWWKwtCpoCekA83iVFvJTN0qILn8WjeOt8Gf6IttUA7+IHD4YdkJf91CWlOZg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b09bd21b-1e1d-42f3-5ebe-08dc6d5275d0 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2024 22:26:51.2072 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T+i8CCS7lo/5x71hzNprfwQgpxYIWN4z6cEWNEWZ1BNrP/cuO85CZ6B7mwwDuaTUxGZ+gLYLOfn1i+/jUD9feQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9265 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240505_152713_336101_B3B9B2F6 X-CRM114-Status: UNSURE ( 8.25 ) 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 When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns that "a variable sized type not at the end of a struct or class is a GNU extension". These cases are not easily changed, because they involve structs that are part of the API. Fortunately, however, the tests seem to be doing just fine (specifically, neither affected test runs any differently with gcc vs. clang builds, on my test system) regardless of the warning. So, all the warning is doing is preventing a clean build of selftests/net. Fix this by suppressing this particular clang warning for the selftests/net suite. Signed-off-by: John Hubbard --- tools/testing/selftests/net/Makefile | 4 ++++ 1 file changed, 4 insertions(+) base-commit: f462ae0edd3703edd6f22fe41d336369c38b884b prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27 diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index 7b6918d5f4af..956481174783 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -6,6 +6,10 @@ CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES) # Additional include paths needed by kselftest.h CFLAGS += -I../ +ifneq ($(LLVM),) + CFLAGS += -Wno-gnu-variable-sized-type-not-at-end +endif + TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh \ rtnetlink.sh xfrm_policy.sh test_blackhole_dev.sh TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh udpgso.sh ip_defrag.sh From patchwork Sun May 5 22:26:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13654698 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 124E0C25B4F for ; Sun, 5 May 2024 22:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=rmqlkY9l9edQ4EGmXRQ6Fl3dxXQ/uf/T+EUOt+FnUdg=; b=LMjhJ0irr5/Rcy l9CC2Jzr24s5mSkiFT4s157Ib8cWcmxVHlFRpqDL7Wg7NAKlwkEbZ/RCZzbRNWN+xz13XWKd0pgkb xZ38Gvdguor69OSyfcn+J2aVg6HMNB8fNhST2weffpsnmjC6c8B/P3novbXDJqAuWfJp9bWbEE6Kg lQEkIsBGRmvMz6WjzVGge35aEMg1k91HI9aNHDKRrM/4bPfjluenWdb8Rqruar60bNQt6Xc2ovXx9 k89ntsgphzutfNrunADgPZlwUROJ+L+14QIit+ugIsNvVfH9b6eWPBUGtBPgAQ5s792Mc6WgH0q/D t9fsbwGODNf17+Rf8VLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3kKE-00000005Qzy-3mUX; Sun, 05 May 2024 22:27:18 +0000 Received: from mail-dm6nam11on20601.outbound.protection.outlook.com ([2a01:111:f403:2415::601] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s3kKB-00000005Qvh-0CUm; Sun, 05 May 2024 22:27:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NUEbmV68KqYXYDhjqDvhqN/WNKUjsI5tydxyRSt6TgIBjfsVuH1dHwusXqIUzO55X9oOMEiLxrw1NGv1onwoiL9aEynWfJL5byBqmTIlPSBoXZ+JbBeVEcoTiN/UkK0E27eO8J+4SVqAx/UErtOM9mtsxQgGhTm1jJ3eKsaHTZ3rWOw839Q3rI1+0ACIQSfziyfsQv2BK/HOwZ+lHEgfvtvLoKzAc4YMMgxGOZTIXWnT3da7Xu8cYbJFGtacdtQRlSlBLUFYHBwsRql+uKB9uqCARijGF+V4lEC/LVZErivRGS8BRwFziy8HWfq7pr7PaoDkouJvihoe1FCln5EnwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ZJFaU0fX6xsAABqscsOe9hOEw5DXjUg4rvL5JAjutjA=; b=Z8ZERVODRtexbnTOW2w90twebV+85Gc/cNQ1NiNig0c/0FQtVakjboobI1dWu7rvVyVtCbsNn3tChdsY2Q9cueuIFbjf0awQZSri6JdIkPvGHV3+lli9GW42OdDocihk5JJ8/KE2MXKBTNSVog04WdUXZvAI9l3eVSjj/s4XKsH5d4K4zXqjXX2fjGSaaChRKfeJVTblYn3ZIus5OH3hlTebRxOTH3Y1xIbSVz0E92F8FTE6vYAVfjxMUV7o/5k00BqkKBR3J/mu2FGc0hJnWldee+Nl8Uls/UjCFxDsCaOuSdHVez06aI2dF7cZw4VuCcw4d6ZNHHDrMbzBOCUIjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZJFaU0fX6xsAABqscsOe9hOEw5DXjUg4rvL5JAjutjA=; b=kgpnvpL/DA1+kuySK/09KFIbovfyBKGEFd9bt1R8jqdIZfEnKGUdGySSAeZZh5gvCXcE0+wQpz1+hjw7Ew2ciyfLgguJvuyNyhsQWjgWvh8S0y1MnC2mGdv6he12vi+0Qt0b2CUPXWpWSTLprPJWdGLn63ndzjo4krIyHOpgVWE2t/6KmFKvREYKqlBGUChTh5Rg2pwVS0U7Slfo4bhHuLVCCjCSl+JjRkHbPmIZb/eEzPA4yYMWDqdXQU5aW9zOaMnA31vfeWCfDXLW2spaWj+OMu/NUC5fiFr/wpo05K+8DrkWnR+PaK1dXp7KDC1yb/Yxf3qMjGiOH9p9sXHUWw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by LV3PR12MB9265.namprd12.prod.outlook.com (2603:10b6:408:215::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39; Sun, 5 May 2024 22:26:53 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%4]) with mapi id 15.20.7544.041; Sun, 5 May 2024 22:26:53 +0000 From: John Hubbard To: Shuah Khan Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Pravin B Shelar , Willem de Bruijn , Alexander Mikhalitsyn , zhujun2 , Petr Machata , Ido Schimmel , Hangbin Liu , Nikolay Aleksandrov , Benjamin Poirier , Sebastian Andrzej Siewior , Dmitry Safonov <0x7f454c46@gmail.com>, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, dev@openvswitch.org, Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, John Hubbard Subject: [PATCH 2/2] selftests/net: fix uninitialized variables Date: Sun, 5 May 2024 15:26:39 -0700 Message-ID: <20240505222639.70317-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240505222639.70317-1-jhubbard@nvidia.com> References: <20240505222639.70317-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR03CA0080.namprd03.prod.outlook.com (2603:10b6:a03:331::25) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|LV3PR12MB9265:EE_ X-MS-Office365-Filtering-Correlation-Id: b94f5363-a362-4b80-c5c4-08dc6d52770a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|7416005|366007; X-Microsoft-Antispam-Message-Info: 2OavAG9Y17gAEX8zwo3tzyvSRVry9/4lIsEM6kTCQfgdgDZLcJkyta1E/Y6M0nTQNJV7/ChKoEray2pJox5QnU9HPp2hdZjg8Uz/UY86zd7ilzX2KffM3uIB7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w3aL6PeG/wO8V2zysHQveKxXOaPkJtXPNZfci+RO41F9ACTWZdOIJgdgRZIK7O2RAK4gbrHCuyDMJUJ2+8zibzr7aX85FIZFjTk1km9GF3Yfg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: //lCP/aehVyyQezTpkiEsQ77cISxTTa7r2KVLjcxSZqiBKUkon7fuzAhMT6hRLxE6O8lYkjFIr5zinmrrh4UZGMxF83U2vJ190YBbw5e7v9Q3Gw6An+B0n474HcyIB2zaYOYVL3V9lzIXJSWegPJ4Hie9O9Js0g/OKyuGSkoqyLfKELa+pVcoz7yIeSLMuspcoI8lFNp7CJdqjgSfXcrb8/3ubguk4sYMB73rKdJ4GZmm2s10lqc9TK/Qft+9ojx/UZdCRTcdYDnLwUye/DZ5bGUyH4QoObHdmthtimvBlz76XIRTilIcFqF5n13EkW7LHQQ/2cisYXQXiyIetTSNTlWG+NCek9oid7MY+1EY59T8hw8E6VCo5G85yZu8wX/uImg6/KhS9Zq2ZHPm26K7zC/29rMKVbumZS9phEEG2ztXnnejAWbCrN5FIv3FAfR7aXZFr4rWbe9ZOsiAlpKoFgjfH9zqK9cKLVJJ4/n1r0NjL+xysf4zF9tjgNTrPOxXRjPcsm8OVEtA5plKFSCSAvcZvW6+e56ATSk0BGXroHN4N6udrq7I2IMJqBIZKxcjFpOQy4T3BuF2Xf8zZzLdMPVyd7suLbTsekzq1NIPK42HkQ3PzlmXY04ZMB7h12m1hNhiOLyqhYC8ILrKmJC+tA4BhBFAs4RKwE4C06jMI8eT3kBk9ha1Sn746rAFe0/VPLFTzNzKC4Bl5vYI87IsLdqxYtJ2ESiydjuZE7lTc7FtfUiRiagw97OOyUZK0OlUk565xXV+m54rDzWZ2Js9fxf2k9rz3sdYzQQOyHW6rFi14XwXk4op0uI7NAaullUDlrpLYeG8uwCnqLX7yCFUnkXBUBfe0vva8v5Oi6brOeYwu/5Ib4H3gCnYWZWaYJJM8tCLdXTj2BaLtfcuURJhMxaRQIvMp8M0CSFNbhE4byUWh83xmrw9oBLNWhIK3vnpXSnNavQGzCyjpJfnH5FKtvNtk3JrLGMT88Z7ahajZJGfd7JdXL/W5mFJSEChEeFUvyCfQOccel+M9+VVya/b5UBPL3NW+myPhmBAaQKqAiw3IEBBZtifZOjFfTMit3IHJsMCrlRi81AmQP8NwYQhqBwmlNzVQNQcT+YlaZ9AJtti0VFv/2GJZSfbqUF7HEGwHtZKVobN4XOGLmCV6iHiJ238I/qa5Swa2J+dt/YJyHNNQJRFIvDl0d2Inikiibt8n4u7xYQ4SDmN0EBcXZLdvmbap7VZngEFKLBfpb79ZRIrYZZQyqM3KNm+kzqRvHNBi5gHifQLvx/AcYRBIqm+wgxDKh4Gv9p0hXKIktwEgyV5ehoOC5jXeQx4SXP3uw6AMDvSxysgjazGuRXti5lVGMjuKLyMeN9aHf4cRsqCco77KXNtQmIH9L3GRJHd1d/U9q7nxfz5TAPA9OBqTZhnOAupD1TDScpcFMyJTjlxOwxju2tkfdk4IErnp7VahxSBzjVEpCYtEfGcNsMyHHgFiBM/oz680OYYfq90Xla7w1s60v6+7GOsa1aYtzfPIPNkv60ZCvmEN1uit6/a0hLdNs6X/zp+MfTYzhIW6EdJIVTEwJRnzdpdrCGKSDz6t7EoRqWKXHKKdYYJukDuUD+Rw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b94f5363-a362-4b80-c5c4-08dc6d52770a X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2024 22:26:53.2672 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: a06CbJcNcMRNi+W+xpdXAIbhbLvp9iBDHlnLDxtMxpFajFT4804Lfqz0eo3U95pxmqVRI97SlDnuRJ5Ky3FAYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9265 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240505_152715_138277_05125233 X-CRM114-Status: GOOD ( 13.14 ) 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 When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns about three variables that are not initialized in all cases: 1) The opt_ipproto_off variable is used uninitialized if "testname" is not "ip". This seems like an actual bug. 2) The addr_len is used uninitialized, but only in the assert case, which bails out, so this is harmless. 3) The family variable in add_listener() is only used uninitialized in the error case (neither IPv4 nor IPv6 is specified), so it's also harmless. Fix by initializing each variable. Signed-off-by: John Hubbard Reviewed-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/gro.c | 3 ++- tools/testing/selftests/net/ip_local_port_range.c | 2 +- tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/gro.c b/tools/testing/selftests/net/gro.c index 353e1e867fbb..0eb61edaad83 100644 --- a/tools/testing/selftests/net/gro.c +++ b/tools/testing/selftests/net/gro.c @@ -110,7 +110,8 @@ static void setup_sock_filter(int fd) const int dport_off = tcp_offset + offsetof(struct tcphdr, dest); const int ethproto_off = offsetof(struct ethhdr, h_proto); int optlen = 0; - int ipproto_off, opt_ipproto_off; + int ipproto_off; + int opt_ipproto_off = 0; int next_off; if (proto == PF_INET) diff --git a/tools/testing/selftests/net/ip_local_port_range.c b/tools/testing/selftests/net/ip_local_port_range.c index 193b82745fd8..29451d2244b7 100644 --- a/tools/testing/selftests/net/ip_local_port_range.c +++ b/tools/testing/selftests/net/ip_local_port_range.c @@ -359,7 +359,7 @@ TEST_F(ip_local_port_range, late_bind) struct sockaddr_in v4; struct sockaddr_in6 v6; } addr; - socklen_t addr_len; + socklen_t addr_len = 0; const int one = 1; int fd, err; __u32 range; diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c index 7426a2cbd4a0..7ad5a59adff2 100644 --- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c +++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c @@ -1276,7 +1276,7 @@ int add_listener(int argc, char *argv[]) struct sockaddr_storage addr; struct sockaddr_in6 *a6; struct sockaddr_in *a4; - u_int16_t family; + u_int16_t family = AF_UNSPEC; int enable = 1; int sock; int err;