Message ID | 20240503035105.93280-4-jhubbard@nvidia.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4699AC4345F for <linux-mm@archiver.kernel.org>; Fri, 3 May 2024 03:54:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D66AF6B0092; Thu, 2 May 2024 23:54:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEF956B0093; Thu, 2 May 2024 23:54:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1B956B0095; Thu, 2 May 2024 23:54:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8BEF06B0092 for <linux-mm@kvack.org>; Thu, 2 May 2024 23:54:16 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 51A1912092E for <linux-mm@kvack.org>; Fri, 3 May 2024 03:54:16 +0000 (UTC) X-FDA: 82075716912.20.15F648E Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2076.outbound.protection.outlook.com [40.107.94.76]) by imf24.hostedemail.com (Postfix) with ESMTP id 6A01F18000C for <linux-mm@kvack.org>; Fri, 3 May 2024 03:54:13 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b="qBQ/QICL"; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.94.76 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714708453; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=c4BRcRLbmLAuVmb5goOiogq51kSab7J9azMKA4MN2ZE=; b=znFLDk57ixgJzdU+dhC8AxElGvhnv484jANYt7ls4ISWFIm5BEdnVTuv/IfWPThJUadEn7 VUhiYM7Ag6TJ4fYbGMvhnwGxdzt3dxo3AoQA3DV9XxoPyCtcMGiRGks2FxQeuwn93jL/d/ bI6LShlXqGEfIcuiuwrcdQIR7EsNPtg= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b="qBQ/QICL"; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.94.76 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1714708453; a=rsa-sha256; cv=pass; b=G52nBTyAo10LM3znHJdd4F5cGtLs7i7Br8fQhorJxqKRt9QMhCFe/S6cqfwhPgGYCOSxbA O7qFZ5sXU20j+IqA7OETQDIEI5588U2Kvt5yu225uW9fSpAFhW6wtE7e3Y7smy0N9VZQv1 OrWe4OxLqKsYwVPZ5hHIyDO05q7SZaU= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fg6NslB4rVTXV++znvdpS9FQU84fXsx52d+5JTLM0juwtEh7NZUSH6gW0LQG4PQEhhT6J25H5HYmXLGgFWlJGgr3GvQOabnCux3sE/j9kYez9BczPA/3PFpmS16GxEtmnRX9r6WmZ3soCOPokN2URFz8pIcHHrP9McfbWN9b7YtyRkjB2SEnCWli3wdn6zdDentGmCUFd/r7mvy+cwD4avOziwQYe9ooKXz/JwA+ecZ+PaVLrwrB7jqUSUE/T/GfDLC61MB29WIB61Ea44rY5JCU8QgaVHFr7RzJwWOsqVk+goOzZc9OpQ6eG7ZcEHlw2DRXLpzy4wf/UaXroy091A== 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=c4BRcRLbmLAuVmb5goOiogq51kSab7J9azMKA4MN2ZE=; b=iGDVlFuT4SZTZ+CHGCuLDuv/Di2aPvrsJ+WvEqNxM+19tOqtYegwU9txLizlvVFmlr2wsQzP9eVyfrQMGldMI6iYt8sXEngUzvxqqa9CH6QS9/+LbqFX1FAD8KSZxj1QIXLgsQAedhoLsl3YWQVwA+7RrZjUVm88HVE4bqp+79cZzvASx5mPB9QoV3F55ttj4XfGhnQkA4e+zSySqZyMBavlas09jrva2T9pNqfoqEBOddTmWrPPI/ArNsMZ0/Cecn6hjxjU0cPWlm3NtUZeXErP02f+bEW4qWUtgY1TQrJ0JtlB3dV8+F5kZJ0Yrt94CXCqDL0ZMbsCgAk/77bHBw== 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=c4BRcRLbmLAuVmb5goOiogq51kSab7J9azMKA4MN2ZE=; b=qBQ/QICLRz4v8WhEH20tpPo5avMLqydq7efBKM6yeJ0h03NB6nWHpDzBJqHB5X+fBJlZjgw4hlH8Qw/qsHMPCS5MoFFiW2DjJxErapO0LQbFn8jxBE6106RZWF7A/V5iGofSEN+xYsvD8d5WW+xhHnkkTAb/euxVDufh4CvZ7gBHmGMKjcWfGH4COWwaarQOae+EAIHaEtrDr3dpxlqWbXILs8V1abtblhdKc8kHfcpbU5jYFdPM6D/OXiivWFE8hSFzJW/iqz/gHyJluQXflb7TO1JvxyI4x2khQ4xZe8h8XF4kRew9DTWUZCcp6esl/fMKa4CRkPtHJ0VQT0IPLw== Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by LV2PR12MB5941.namprd12.prod.outlook.com (2603:10b6:408:172::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.28; Fri, 3 May 2024 03:51:09 +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.7519.035; Fri, 3 May 2024 03:51:09 +0000 From: John Hubbard <jhubbard@nvidia.com> To: Shuah Khan <shuah@kernel.org> Cc: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>, Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>, Roman Gushchin <roman.gushchin@linux.dev>, Shakeel Butt <shakeel.butt@linux.dev>, Muchun Song <muchun.song@linux.dev>, Waiman Long <longman@redhat.com>, Yosry Ahmed <yosryahmed@google.com>, Nhat Pham <nphamcs@gmail.com>, Chengming Zhou <chengming.zhou@linux.dev>, Valentin Obst <kernel@valentinobst.de>, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>, llvm@lists.linux.dev, John Hubbard <jhubbard@nvidia.com> Subject: [PATCH 3/4] selftests/cgroup: cpu_hogger init: use {} instead of {NULL} Date: Thu, 2 May 2024 20:51:04 -0700 Message-ID: <20240503035105.93280-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240503035105.93280-1-jhubbard@nvidia.com> References: <20240503035105.93280-1-jhubbard@nvidia.com> X-NVConfidentiality: public Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR05CA0077.namprd05.prod.outlook.com (2603:10b6:a03:e0::18) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|LV2PR12MB5941:EE_ X-MS-Office365-Filtering-Correlation-Id: adc75903-838d-4458-3b95-08dc6b2444cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|366007; X-Microsoft-Antispam-Message-Info: bqLcYowkM8TO1Khj8s3wt8AQJbe7P9RkXIWvJZVit5vT0SB7L/aySBOj4jIIt017x9t6hoks+bJ0nm4INFDf29Nb4agHWWfSFfyY8BIR0hlw3gez5abnl+/bW2xR8RbuNr7/33ZKeOgnUt34fiLDoKqqzu40mtjVQaN1lRXLTxOzb0W2h57WgW2Mx0WqxsjHhJnoPbPhDTVR2q1AN3LNjULz06pXlzSFACp3uDOemfcTd9E/5ZSasTOQhx8jWsALZc0mNWrshYWMDAsOS6JGZ7SzKn7N1I3Eg347pAXP2D3egx+jNVN7530lL4fsT2OlYU1ibLCbE2atLxsdPNR4JrEJ/HOaXZz44qT3ArzswnJSsJrdaU/9PRSyh8YT7f/8KHsY5yLALTrHngEUQFGTlas1oygU3l1ChBuysI6Ra/O77h5uGcaXOAFhkyvf4YM0sjDPdkbPugK1RGw2Q3UpeXsZ0pH6msAt5VC5HTELd7a7vhUHugmnF8YlhP6iv8KuIMcc1HG0+GbfLSxkhvvzl1OklrVthdtLFyB2BqAF+5//ZpZFlHJr2Nsx6kXCymclPlFRDVjLgu+KfoI1xw9zOO7kAfR5hzRoG3m8kBaNEx9SecOKZHzxwsJAcIT4tgmbWQD5so2r/XRE0Dx/zDQx2phMMZLlvrTc5lsG7reEwskFP/eDfRtSaCvXgpMF/4NV1+RZvQewhqHdkYUtJgAU5oI7sb3eLlGFRF55ZQEh6+w8q7rtUSSH/vTYiGgjpbRJczQxakgyr0gG6aT5Y+Q48riA6HDZLTITSJMVu2xE0IgQV4ykKFxw5NQ3N8dGBdjbRbGfwZw1l6JXOJAYubcvXUgejYqc01vCmSkHPadK8h9R0un2tF7Z9gJmheczVPPyNjuZoCCO61e0LxzaHTuTgnNegXyZsIZhLe+zE0MO0Z/PJQumV+R9mTW68nGNY1Q8JChYz4caYfFeegSe4vCgd2D6HOFhkHHmZekfYz4QECbvae8JhrirJximdCI7/IVUbbf476YxI/UARsq0ydrXnOhJvCXXWhtYc4SAZqy4UDbHfeeeGr9lbdCrMF0y/KvdFxRUVGl+hQtJE4tqYQXV7/zx7ij4eayPQgoRK9G83WTYrQWTlXAnUSdLeHjuYs4d/y4+K0BGD9Xf5mxWDyzTKkHJEG3FSOkK0iwvzVNVDoMcJ//jXYOHGGXiY+t7miaLozLEokIhfmeoqiF1dT6TqG75itE9UOo/bkk5QCKFu/PtAIkzn/XzPf/mgSXVjJ0/y3QpaSnekQEGWv7LU3NKqQ== 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)(7416005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HPVS13N4f+A1ZrICFCT4X4YIEMQApEhLDdT9i1uXiSPZnrAdrki/CmD4H0/fjCiOM/iOiHJsz/mFG40wdCzu4j2GAPLFNhM6cYMsZ/R02ZIRcd6mejUEqsl34UxEafM1qGMQNN7dydS5Um72WttviN56dbbgAK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jR7114Di7E7J0n8RTzjlyroUo+2NhV90koEodWyEsQhResn09t8thPv90byXYLdKoHlbtRbC8rK2MxJI322Amy6FsqZZHl+94F/gyNO72aJK8cOzwF8EfrKiN1iuvD2+IIMYpzw8DuM3SPEYpBN5VYphBbcksakn8HuJNtyPaNAZcPU7qIJpYcijKG86Cl1yhfAK0MKpIONOe19ry1erkf1W2iksdU+XmKV3cP0JzICwzSrUn/CJ1vfnn2NRv87qWK4ZFShBUGuLr5VRS+0G2y+pZSyvSF0DcqS1Kn1KlPUGzE+xexpmijbTV+2igjzaGTJQV2a4ESDT75AyMmXR6f5mIUqN5g9N3GwLfCP55LPdCx3TP9Xc5Ac X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: adc75903-838d-4458-3b95-08dc6b2444cc X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 03:51:09.8077 (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: JlYkCjR97NgTPkKqJ+DeRF/LoO/Mw3mO7lkVV2WF+HJFqK7tfrD5B1bQ9g6h47AqNCCDzFwP7kqTB505PocSNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5941 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6A01F18000C X-Stat-Signature: 4qzcnfmyfp7zhub1saznfxfc5479ciat X-Rspam-User: X-HE-Tag: 1714708453-209864 X-HE-Meta: U2FsdGVkX1+Kp7MaFlBHHnslhs+wkblzSjkyoMS6Qkr53QPFiAougMe+wY7cYuuBSbuWaWSuoRmdr6m43TDpGkf4H30pdv7lAnmieyq39AuNrP00KscGzwTtwV3dfzaG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uqnALOCYG3MsYVuf31bigxcOgCxgJA4UrVHfG9rhcar2rb+dmwgasokokZpI77Mb9jHPa7OqHjkWWxMbw0KkdOive9kxMGf/WWkXgPA/8i5oFc7u0VuMPiYYyNgnGPQ0qdqCrF9CZRHv7P1qG352JuLt6622nOKV1jy7cpjO+dLFRy6A4hb7X0DU3rx6qxQhrCXZmp+/xmciaOpwngzODZz+9BLrT3BRV1izpVzVTYxzTy7S6vlB7BN+0VW9rhw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
selftests/cgroups: fix clang build failures, warnings
|
expand
|
On Thu, May 02, 2024 at 08:51:04PM -0700, John Hubbard wrote: > First of all, in order to build with clang at all, one must first apply > Valentin Obst's build fix for LLVM [1]. Once that is done, then when > building with clang, via: > > make LLVM=1 -C tools/testing/selftests > > ...clang generates warning here, because struct cpu_hogger has multiple > fields, and the code is initializing an array of these structs, and it > is incorrect to specify a single NULL value as the initializer. > > Fix this by initializing with {}, so that the compiler knows to use > default initializer values for all fields in each array entry. > > [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ > > Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
diff --git a/tools/testing/selftests/cgroup/test_cpu.c b/tools/testing/selftests/cgroup/test_cpu.c index 24020a2c68dc..e4266b60e5ac 100644 --- a/tools/testing/selftests/cgroup/test_cpu.c +++ b/tools/testing/selftests/cgroup/test_cpu.c @@ -237,7 +237,7 @@ run_cpucg_weight_test( { int ret = KSFT_FAIL, i; char *parent = NULL; - struct cpu_hogger children[3] = {NULL}; + struct cpu_hogger children[3] = {}; parent = cg_name(root, "cpucg_test_0"); if (!parent) @@ -408,7 +408,7 @@ run_cpucg_nested_weight_test(const char *root, bool overprovisioned) { int ret = KSFT_FAIL, i; char *parent = NULL, *child = NULL; - struct cpu_hogger leaf[3] = {NULL}; + struct cpu_hogger leaf[3] = {}; long nested_leaf_usage, child_usage; int nprocs = get_nprocs();
First of all, in order to build with clang at all, one must first apply Valentin Obst's build fix for LLVM [1]. Once that is done, then when building with clang, via: make LLVM=1 -C tools/testing/selftests ...clang generates warning here, because struct cpu_hogger has multiple fields, and the code is initializing an array of these structs, and it is incorrect to specify a single NULL value as the initializer. Fix this by initializing with {}, so that the compiler knows to use default initializer values for all fields in each array entry. [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ Signed-off-by: John Hubbard <jhubbard@nvidia.com> --- tools/testing/selftests/cgroup/test_cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)