From patchwork Fri May 3 03:51:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13652319 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2076.outbound.protection.outlook.com [40.107.94.76]) (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 4F7EC2C190; Fri, 3 May 2024 03:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714708276; cv=fail; b=Kob3eiYCn7y7xCyXyx4wJajx+XjqsRE8fYFqFjdPa9rWkbp7JyeGP1by0AWLxh0s4kdqMx57TE7+gdWriDoX/CkMnZRNDjEqTYtenq3Gop2rjhFWAdI8OymBQLja0bwD7neXxVreyEzP+oKgiABZ+gzi6i9NXctgQjFVXHVQe50= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714708276; c=relaxed/simple; bh=7yhe1LCaPrHq7LU4lyvPlRHGEsFGtsVIA2JMq8j8BvQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=k9ehNbHi8FqFrYpz/qDjPjBVEIS9p//JhQtOIjizEiJGIneySM4gtcqpmuna8MmmcwMInTGA5EZbUJ0pfQASiZJ7ESMZLDP2Ona3omxTxYMX5loWZ1La8IYRrJ07XKy2ydW/hmWEzt4o+JeeucbLPRrG8AcZsIMw/YQoSfZFZXQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=qBQ/QICL; arc=fail smtp.client-ip=40.107.94.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qBQ/QICL" 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== 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 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 To: Shuah Khan Cc: Tejun Heo , Zefan Li , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Waiman Long , Yosry Ahmed , Nhat Pham , Chengming Zhou , Valentin Obst , linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, LKML , llvm@lists.linux.dev, John Hubbard 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 X-ClientProxiedBy: BYAPR05CA0077.namprd05.prod.outlook.com (2603:10b6:a03:e0::18) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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/HOaXZ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5yMy17XCsH6PZFECGGteMInJL3QHPxRwLgYdNc/b69cqGcCBqXLgY2BqTUVJMEQ5ihdaEhappG2vGKZbVVGcY1Ijne2n1FguBvHMg96/3HNPUrrpKGw7u4PqaqQiHXTW8t+twwyJAUU6vSE4XmAnKOik2yhMn9wpqzj6ivckR0G69OPSavCLieNAX2gAu9D7LsP4rRxtyi5MPr7S1cCd9iQTFqfkrpPsEuK5yqJPvzfxvDFCkhLDaq5BsZuIjR7114Di7E7J0n8RTzjlyroUo+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 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 Reviewed-by: Roman Gushchin --- tools/testing/selftests/cgroup/test_cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();