From patchwork Fri May 3 03:51:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13652323 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F3CAC4345F for ; Fri, 3 May 2024 03:52:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B1B046B0088; Thu, 2 May 2024 23:52:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACA716B0089; Thu, 2 May 2024 23:52:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91D956B008A; Thu, 2 May 2024 23:52:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 70E466B0088 for ; Thu, 2 May 2024 23:52:47 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EAB381409D4 for ; Fri, 3 May 2024 03:52:46 +0000 (UTC) X-FDA: 82075713132.06.40C4015 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2053.outbound.protection.outlook.com [40.107.94.53]) by imf06.hostedemail.com (Postfix) with ESMTP id 51D30180012 for ; Fri, 3 May 2024 03:52:40 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=kxhNz49+; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf06.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.94.53 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714708360; 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=KEch4UNGf2xILDLML6oCjGM+UDhweOuYpthwBkU35mQ=; b=vr33NG9DD2UM73j94sSvROa8qSGddxPmLEc3sfMNo5AinlydeJCULhyy8oqr79eKGe1oAA xzZqHQeKLcbDFiKZKxhVgC3qQVPD6NbddDf9fJ2UA4TQRMYDu5DM88gviDt7AtGbxZc7D+ b743bhDTjtII8TtJloyC3AbUCNvcF1I= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1714708360; a=rsa-sha256; cv=pass; b=UvGJIKR0HBhifunp72PLiE5riHkuEOBwkiT5o0eBM941KrTevFijFAwgoxzwf6SHsI7T/8 xC244abKzSnuuyLvpklI0zg38wfbWmfxcKplJYlx4Wwbhlk0EhxayWrxHTaOoRfuTTIZM8 fKNoKRTnuU8HUiuNGlWGvWjMNlvVRjw= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=kxhNz49+; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf06.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.94.53 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a7fyyNIFak7+4+Cmh7vdgPScUedLSSrzpbzFr3g2eMhZm0gzBU2we7b4I1SEkkD19hRqC4ko2Rb3fqQLLDU/ygSfC4bXLFRbZY7NEMd9wg0vP1wdJc5GH5bO6kPqX8nB4hE0vRCJimaZCdAjHxpryN8DA5Bx6QeuHCgAcDusK0Fob+wLMN45tk4PQDEVXvwQR7d6ihyPjoPqbRvdxrnNsd/qasCsUxYSnZJC7Iy5tu9+UW+vUyBu5A2qPkQe4owkzz4SUgMO0UJX5keE+q5+qvI/uV7qOj/7aUNjdwtxSyvEkzbK7d9W6dZX2X1dbYBhEmCJRMSByFC7mDT2i7ANMQ== 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=KEch4UNGf2xILDLML6oCjGM+UDhweOuYpthwBkU35mQ=; b=BBFHLePVVt7iHmsptB2kotddC4xk1au4KDTGEPuFKF5LEiTZFbunW97R82iMYkd9jqP975mFnjzMZmIfEHiZsQBmb5mfM2+scIJpmHXdEwvHjNv092gH7GAvljaFvY/U6ps1JfOVUzNJa9SYDo+wCfH5tHrxeAaEW2j96f53QDOYHLtsRgZVlOa7SEW2Og+nSoFXOBBwBImnAWAhY/zGsmIfKb7Lf7pKV5SFLk4dNBVgKdhD0DgX9Ue7hO1xdG4ah3hbvpqy/jK5e+eTsFySkX513+oW9qAWi4Y/ietgz9xTNvE0pQxDHklFC6WNmy2Tw3A0/rVrr44EKlFUYXT4RQ== 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=KEch4UNGf2xILDLML6oCjGM+UDhweOuYpthwBkU35mQ=; b=kxhNz49+DQ/ANRn3r9AB54GThyH4BHgRfrC4+28kJZiHEHwAOKgQTw6JrqiRHypF4W4s7ksiJvKJGOhkf4iQCq6IalPjWfM27ZE9tFA1BnTP15WShjdQJKkUUEt5UhyCNK1qidPdBF41V/uTM5m613zeFtJSGQaH75uhQtxbknttkmVoIfqfYcscUt7Z1Jsg0wjjHIQ5qXpjmM5WDWvGC+mBP2u8gZHpPNTz2IjWTma65e7bNllvEe1DQoMOs0O1UFg9KnY9zT/YrqDyl6dHJSX6JWhid3+CgQlD3ZtC77iDB14bEfrpCC0DwIbngGEiDd/rext0OXMduejbL2zy0Q== 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:08 +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:08 +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 1/4] selftests/cgroup: fix clang build failures for abs() calls Date: Thu, 2 May 2024 20:51:02 -0700 Message-ID: <20240503035105.93280-2-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: BYAPR07CA0093.namprd07.prod.outlook.com (2603:10b6:a03:12b::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_|LV2PR12MB5941:EE_ X-MS-Office365-Filtering-Correlation-Id: 98063537-2a31-410c-dec2-08dc6b2443f8 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: Z8MRn10j9YzQK/8/9/X4QnqiKspr2jmUQudqWjU8Tpo1+J1SizQZXZkXR46CwZO3EdJ3TSTnhLVD48eTJCgo0R7fMQG2BB8FFItci7uyvv0xD9dCiRHrSVuGcdqlN2EsgeXb6MXWCFbEHdOyeYxwv59EuAfMJjD3YuLXrP4UEwhv8ZIgfe7e5gNBWVQP0swd/NzfcaQ18XzfOI5O5l4PJerKjb0UEg5ZM6Rh1aDY4nclr77iYG9mDy4a1SPMY1nEVQgZ5u0nMrP12e4f+9oy8mzAhMbI0YtSbu87Fz08sHIEUZdLCYdfXdGnwD/wp9XT+4xngrYkNyjfl6I0bquoYg23eydvdFi5MqcjpkCPJS2ZSfZ4hqMPKgwtKO1NhMPj3R8RR8Mtw1K+EfwIXlsOGMdfEy9xssNBu1Czny+AhaVZ8LRhnjSOX9VHqF8kZ/DiTXCrq3KdHTP9N86609Z+dMabfsOd8LK7ATqUYZ2/HjOs/c35bYtHApLAr6ck0Jcr72RD+2YKKoFxD7ZjTPvMP1E78AyeD+4QX+ih0M6M55pjFrUa27XHh8gbpLtRkiBSnvp7Bl8in6JvqQDU4LMCTUGsOwe+57WYwF9MR5+MH3RwKJta6iVXJlHzwTkuzdPKiYoQPqC+aERcMgu6AUzWPpcfDKdzVKK7OMcmRD5rd56CxJOCtKfDHwbsZc8U8+LswdLExkrTeTU88jqD4Rg5B/Lz06x7met0lPqsr78Y9lNlLtG3cgyMpvWRy6Blcxg8SKZ+bZ4BV+Hjn5gv8ezZgmeOG7QWT/4uFMa3gfwdISOVU8jQVMhG1UvUzuTPrZ9dfRNTQUmsEMl1tP3q/ypla/zvb6l5MPVbWWlxZU3/1AIVoX+mefKVxtMjXftZAewQQXnSUstR9Np85QA2m9MUkIaPRceqZ4GaqpIWOsH0JJmfKkGEKhOkt3/pZJpBFGzZ0R4ioFANeq9GpZQUOJekPSwgI8QW6JwppEFSIkAqGUqBiI2JCUTE9EUpLm6TpXPMJdI2/bwrbegaBvaSQrH/XJsg8jeivF0VTUeq40cK6QqdjFDhC4CNs5GeHWZfACsDojsaC7dvJdbQkCLV6Iv0LUSN0TwMOvcACV5gv9TqBseMWXdww0m1nJHVVmZh8yYschcjrhKD6cnJxplX2h7fSJFHn42yfkcs7C9/33DvvjklrYdklhDhR29mOv7vtcNSwdxFE3vv8vWEG7CyJM0QnrIF4rGXonhQhadgMbGWyJHQ4YG6AmqobnDdaJLyo10SyIVYTpxcMV+p46/lrRXDmg== 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: 7ubpC2pyVaLTxM5vJ9f7dePekbuqg8ZF/BdVd35d4CtO6oT14fv5SznDTu6OhH+U0YqHc0Deqyvldp+5JwrPG3z0eig5UsmPSMk/OtcLDUupDJvm7fGzqT9MsprnsFVOAcXSoelQikPXrjliECIuMHt1RK4ecMGb1N+1l5ALWzMre/Cfh6VqE5q1Xp/rS8d33VuiovV0Qi5syR0fA9vI4ArqmWtJhua8e1lyLcWFU/MkzTsPE5ivDUI/SQXOVjuwdw2Wql0Zt8m6mqdYnw0Vueye5PO4eTh5/50UAzVL/hpnXTfdNOU/rjZ+Mfdh1N450gIAhihNyRuuTPNZIPydSnZURRni15bIzx28DWcb4n+8+yt37p6IwtfPNtVbAw+bd790opMggvCh/ow18ZSVCXhQWujLKnAuuKT5Wksa0dFQK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A6EBj9/dtkyDnPfqTd7jCNm1FvBqD/tnKGH3PJzgr2HILiWhvaSJVHg5NX1k8Bf1TasjeIJlvNpMwWyGuWGq X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98063537-2a31-410c-dec2-08dc6b2443f8 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:08.4339 (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: 0nI1iNp9a37M8EirS5zBXkpxrc7wIQEOd7ZqeBqH/7Cr/Sqmmfx1wer1RlWsHURm35c5DBYe/Oto4ulvBU+u5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5941 X-Rspamd-Queue-Id: 51D30180012 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: skjgk5p3tctk9rcdiiqwzgd5khhf1beb X-HE-Tag: 1714708360-82145 X-HE-Meta: U2FsdGVkX188AYn5j9IQVFYRNhhjL3dhFj8hVrQ+XojVZ6TpzpZcOixf9cIJKqg12C/sUw36NXecoQEtBuEM5fGDDJ7PtNqKxxJtmIGBnu673THg2CRy/gGNUUhJ2fK7Dr40bUXZgantbkxhRtTHOkicI/Eg4XiZymm0NNI74vJiqchgUhCIGMSlru6eoYD5txcranBoVSwjwc2WObgt6r76vB/rvJ+bD0dgBLinDwCzvdoB3Pdon/mPtc5Db04rAHdghPlbupFblq4vmOot8HI/1cxHRlapOzX2lIgD70xg17gjpjkU4Md8HT8KrP+7gjWIEnT9kGtjlRmMGR2zIYjB62HIi6wWkcIRvB6MGDVXcszk2u2NzfuPiPQol+BOsgLGyTSelWsBt2xvLE8mLTHQkKG+T3TyA6vE2c0U9sKu3bmv3PS/nVTjDjeMu0CxLNfD7g+WiC01XWhzJ6S8TNE/gauXSSycRiPPHHzcViMzqSOdIQpmgX5wZMI6voYZAx1IxwkgKe0VvVTlPrPzLziTA/cIwEP+Ij7lJemklXmZa8jMfMZX8pIvkPGKN51ha70drGoqTDP0rWfNnG2Ql/Psg9+J6fXf/SOwkL8Nwe8GXLgMygZepxOWniuXrhYHia4gBG8PotuoVIoAXaHgnIYtudaJAyPctuTTJiJzs+aOSsxCOCBcGzyS39LTJ3Hdmth8iiCBIt51WZo6EJaHD/mvE0jUlNG29eOCtXwmdTSx6IXhQUYTxni09pTEBBCgp+/GrhKf1RNryFk8vJg4E7vZ+IaPynF+bJ6JaFHm9b1aSLYxLjiDJl0VhdyEz0FEHsykro+3TEa1Wofsxsd14YF/e1GV02p2iecEz3eoAPaD/QuWJzuzkFaBMHQysXjzNDQ62A8H3+FfKw67ErFTHRNOpkzgDy8U41CZpawZYkCABZAl3riLlAxUcnrFmDOlZp3yjoBDC0efzPlmkaB wRdK0yAe k4SB4Q0W8hlk9a/JR5cCYxjczsSAoUHYEHNMYAGgM9HwgjRNUJWZNCglT85I4lLMb94yd8MeLUEhRjekNsXjtcAw6XEetOYNQ0WE2bELrAeJ1xi20Spzw+18X6h+A6VegBIaVpgf7xNS/RhXln+ikLOjBfkqEianZkYtUqGq4DiuG4FtBzdBifCMoBroXBpYajrIa3u3gEzZid+X6RgPsyta/4JLL8xT/wmYv9lMIyH7/oAVxxT+UemAYxEHsBaiC5phwbAY7SsvxM/tLdigo82RbihkzEv5nGNlJJPxXyWE/hRO4BUSjg9sQjkLAePlMGpPxyL5C0xdDpaEjXfZQIEu36n7VL1RS0OvUIDn0oMfdmSlDA3DKnJcqXvBf9wqNhBLA1AZiPvaoo2EAjunlIeuPkw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000721, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 is pickier than gcc, about which version of abs(3) to call, depending on the argument type: int abs(int j); long labs(long j); long long llabs(long long j); ...and this is causing both build failures and warnings, when running: make LLVM=1 -C tools/testing/selftests Fix this by calling labs() in value_close(), because the arguments are unambiguously "long" type. [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/cgroup_util.h | 2 +- tools/testing/selftests/cgroup/test_kmem.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/cgroup/cgroup_util.h b/tools/testing/selftests/cgroup/cgroup_util.h index 1df7f202214a..239633e936df 100644 --- a/tools/testing/selftests/cgroup/cgroup_util.h +++ b/tools/testing/selftests/cgroup/cgroup_util.h @@ -18,7 +18,7 @@ */ static inline int values_close(long a, long b, int err) { - return abs(a - b) <= (a + b) / 100 * err; + return labs(a - b) <= (a + b) / 100 * err; } extern int cg_find_unified_root(char *root, size_t len); diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c index c82f974b85c9..d21d3d280ca2 100644 --- a/tools/testing/selftests/cgroup/test_kmem.c +++ b/tools/testing/selftests/cgroup/test_kmem.c @@ -192,7 +192,7 @@ static int test_kmem_memcg_deletion(const char *root) goto cleanup; sum = anon + file + kernel + sock; - if (abs(sum - current) < MAX_VMSTAT_ERROR) { + if (labs(sum - current) < MAX_VMSTAT_ERROR) { ret = KSFT_PASS; } else { printf("memory.current = %ld\n", current); @@ -380,7 +380,7 @@ static int test_percpu_basic(const char *root) current = cg_read_long(parent, "memory.current"); percpu = cg_read_key_long(parent, "memory.stat", "percpu "); - if (current > 0 && percpu > 0 && abs(current - percpu) < + if (current > 0 && percpu > 0 && labs(current - percpu) < MAX_VMSTAT_ERROR) ret = KSFT_PASS; else From patchwork Fri May 3 03:51:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13652322 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA259C10F16 for ; Fri, 3 May 2024 03:51:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FFCC6B0083; Thu, 2 May 2024 23:51:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 461D16B0085; Thu, 2 May 2024 23:51:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28C7E6B0088; Thu, 2 May 2024 23:51:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id F30916B0083 for ; Thu, 2 May 2024 23:51:27 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 78E9FA02D2 for ; Fri, 3 May 2024 03:51:27 +0000 (UTC) X-FDA: 82075709814.09.68AB534 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2087.outbound.protection.outlook.com [40.107.94.87]) by imf05.hostedemail.com (Postfix) with ESMTP id A80F410000A for ; Fri, 3 May 2024 03:51:24 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=O6XzoCOA; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf05.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.94.87 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714708284; 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=VY5K6QS7gWPPRtUIjjZpOjz8cFslahzMJZL8S6Pxl24=; b=xnNPIUtqupT8znCAFUaRf7wpv2JWBaswKT47b0lqlqGVJAdLWhfxdLD9Xn7rXUJB2UAmGs gXX3ZNk5YFTzVt5O1KKNoA9lD19ILsmEP1qe4su7Dyd2n+J1q9F2l4HCVE5WwL0eyhx0RD 0Dj3bEEBJ0KD2ZSP5X0Rr6IDCOQkOFs= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1714708284; a=rsa-sha256; cv=pass; b=jg5FT2MQaEbbU5/XbvjdVO1s81Aks/KUNvTzJQrf94EFOxMUMdWep384V6n03TRS+SPhA5 nS/zNIRbuBGySus0DSEbYGl/zvgBpqckxz0FJtjit9qRGKyF5aBcUq91FLnlJkSAH3MBOm et8STPpPQpsfscXOEg7brPp9UWnGCqI= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=O6XzoCOA; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf05.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.94.87 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g2A8uwtfYWrbCBFI/gIfs7LEWlDnWdeaNMrDFRsxuMR5Jk9Z130MO0ZRu4pv+jcec1KcerpW37MBjGI75FgSqX6igJRcw9rqscyQfXV1L0WCdJgmRhFNnKyvn5ftylhuT+ueaBTVkHLgZCDdJB/JIoF4RDCZBRqoWE+yTSShDNd1fc/xe0/s2MPe6uUqFXK2OfGfXLsF5twImqOK2YGhxVAFPG3/Tb8v3eWBQL642SlLUM++gfACbWT+Li5d3ny0E7PL4ZM6yzX023uSehzZcQUZ/3D6F6tMLM8U1HNjlcfTFmevZHYECGatTHQNd/9B9rySYOfhe15P9liOKald+A== 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=VY5K6QS7gWPPRtUIjjZpOjz8cFslahzMJZL8S6Pxl24=; b=ctdswpoJ5bLa585NuZLtihwtYwk6AY/m3fe4KUripKhcNgB6rbPGS6c+9q+YZ28/aVPrdFeePuuLAtlf9R3tfZpc3gMHDeflMp8nXGofsF92rfTo2iGJVZJ58UYCxy9OXh7jQFeq07BHigGVAEVN0CfRJlY/GRyhc4aI0E1fIRaVuk4TX7qJkYR3EvhQMro45AI1tFz/r8RwwP+y6zyDi5u+n4Nu9YsDw8SEMAl6vZZfzpPmnAn8HW/qvSBbEiRwDybc4C0uPkIPcuJ6jHtcz/6OqxpSSNYMfeB6vpS6j/Snrxpz9gTH4q24qgih9snW56phcZiArbEz5n7o9Ci31Q== 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=VY5K6QS7gWPPRtUIjjZpOjz8cFslahzMJZL8S6Pxl24=; b=O6XzoCOArNHSkXGWe9CU3OkEAxm8Zay4V4O9hYnTbq7HMssI20xcxXRAxgseDWZcsyqAuJ4D4VX7WFXdwAEAt1HxEtemxiElBr5787kBxdRpkBEl7J06f0Rkaqyrol0bvD9e36iczQ+fsETNdxg+CrkQiYxpkO6OVeQ8s4za+jV4LH7J0EcTi02zrF/n9S5ODX915xYYipYR9mBtc1iELvocLUP7myfijEB31vMsrVdyrpIXGwOtYnjHdVv4zwg4R7pGSB8gEu1vxsOGtSiaKZP7QyewXhn++ynM8DHEeApI4D8c+z1k3VZa7mJZxg6gWzDCHFVIruVHGcT3Z9aIkQ== 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 2/4] selftests/cgroup: fix clang warnings: uninitialized fd variable Date: Thu, 2 May 2024 20:51:03 -0700 Message-ID: <20240503035105.93280-3-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: BYAPR05CA0105.namprd05.prod.outlook.com (2603:10b6:a03:e0::46) 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: 6bae8b1d-5763-45a1-3c81-08dc6b24444b 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: l9cyRRJOG9mKldp+jsF38ZxWuk4dOqg+iYqYSo0zzp+zjpfOzcZEzCy4Ln7LdVFQBeQw5AMdUBcsCVaPo3wF6SfPTRwYbi0h9FCYbL1mqeSemcEQFOIfwoRroEG0nyKehhISs4fUqwc5BsIyNZgvS4vmtqS1Ty/O6x0xqETIbRqhbe+eQ4+gsRrq0Q7P+Ujq5UwnKas5uYd8EzPkx7dDd4+fyeMKxwqwAgQhwwTP574HVWeReZpkwB37XgSEm+VqoVTniK9aEofEIo4jC0xf1GzSPT3qKOtTsiW1n6vT7g4Dnek/Tg+Tnk2xrGbi9ARuqssavNzK4X4QyAFVp6ikxm+czxGfzqV9NOX7clU9J7evJLC6IEuavlZ61eJpyjjalM7SCWZzVq0CNLHIQKihv+pA0+PSpcRRci7f+hmYwCjh7b5sE0V7M/btKFiO76Q5Z33UlYGNOG9wQuuZo9SeawkpnZ4un94B2VsI6Wp0gH4lwmG7bDM3LxLhqozIz/JWk2oWvwILoPoIFKzpeYTOQjSNW/zbdfEERduwPSfFdYMVgJFfehAX0YP3flgMGgUxI1c8xD7wYox/a7wxBB9aEnKdz2bMFRVw6H9RqLYGyUBUHhuDnNjvaznQ5pXt60U1C3mi/wdExfTYsJr+RGal3Mr7n+VxrvVaapwSNHLrOYfwmomQWhngssntpV8Kyo2n13yX1/c5+oIPqRUAm0JBGgLUZyzXuDhYlyU9hVHAQOtxWupuMUQltRt7X3HzmoaGi/FYjl1YusTBxmICsM+txFAQcaX753Kxr0B2QZ6iEQRjswgL6BR+sEXjWEOqo/1b/W5qsqWAkS8vzQ5MZgPn1VRD8BHFOXxuSKvxNCtro/DQEDT32mcnZhDV7TKUJYXRrnE4DA24oWkE0+EHKDk5VEAzArBWQQjtNJ2L6PorTkorQaSrPFJkiZSN0fr9KLZqmSNMp8phSF/QkR5uOpcLbyw6c46/IHK6eNAEu/r+8lF+wGO3pg8ZzJQ+esxQ72Wfn+XrCqUY1BL0jBpzaDmFgvenQIBJVkxsuvngyctm9brYwIrpXKoWC8yH7Pi2HHzge9a9IZVcrP6pia01PYTQtw777k6w7g8LkClxj5rCD2pU1ipTlI0pIOVy+b9cqjDdK2mmp7vFcylAakkfiTxohlFCawndDBWojqxpWPsMmtaUAe5QAMYrxmLAbAnMHYT1Wwfq0zW3X+4YJ8yFGTcmgwzUyoTCS+fUuQw9b5wLpDH36UAR5BwLVKWUcIDiiwbyjfwXCsS+ksLIsRsOMs+lhQ== 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: qcR21lO+rXzh5N3sssXtCrSuInWzjZwa+YnKBnBRvyKjVvPhSMyNthOGIJiMK4vKRE3ceN7yGzIW+kyZpEd4jaGmMrzFTcyml+kIGYybfFE7qtpS9KhS7zwc6tQAIu0w5vAIF84CekclhMhJn5vTiYewpCcOpDhxpzrczT1hyKLOvQfQ0vb9Jl+Kb1Aij2ew4REk12f+Pl8JybJW4v5WcplQIzI/vQEGDUDo7y3aHVGokILooNMzUM0D5/e1xwLg3+dX0KzxE11QiMHNcMj3I3hxQeWSaEaj3Wo4fg2EoT9PVlGeWW5l27q98ur3OKRvAo7x9ybdPe7yTMbsjD5AJszorY6UPjPaNzH94kbkoVP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YvHkeLttNvTJOtKF3OnZsmPTWzEordDEg7hwtPNTNfy44lc5X+eobEphSm2+uHtef9AnWOlwv7WESHKiVHsamfvbLVgBDTo46LN/AkNsRVdqGN30xN8W5nSsQq+KeXH0KUdUxBDMSMgVvf X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bae8b1d-5763-45a1-3c81-08dc6b24444b 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:08.9521 (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: SfcXSMxPWHCeDzvWHyhCglLwyDZnepBQW3R1X5GPejEG2Zwt5J1rF01HtWYw4YgRZPKC9mfo7EQwfYjIRNjTcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5941 X-Rspamd-Queue-Id: A80F410000A X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: pgzocnze1npaiaiywbxwequb1dnscz4q X-HE-Tag: 1714708284-206411 X-HE-Meta: U2FsdGVkX1/UH5FkQeAOQ7PtoXvxhz2Ve43nstWruXDOc7uDAFWC+Ul73wLJvlXlkL9mS+jTfdtvsmcsdT0qr3llpYmEv6SKKS3oqs8dn7S0C5qeN4xc0zvN/nBzR/VUvA663nqUCmuE+ELJFmc60gSnYwLVTGfG+DFe3hVjwxkexm89VVez9AxkCkruRTzO4B8ZagdOk+xNPsCt2ZrqH0yEnBxAwZzYzSBgS9HFKOtZHs78reIrEsiA1Wr8B9b+El6ozPwTGHqyzvFKgJH1fArvkZ2hQ0MqJBsaN0U2/I1MUvnaqOuf5+tzl2nQ70L4tG6VIlnkkw5AVe/OKrATtcUPgfCEsaYGJQUhnUd23oNO1VO0xyjIbnvAKtDeXUHdb66XzjgzVa4VtjgRXn8tIOVM3xcBvXnW/vhf7o2+qsfqAgrnnfmSMcUe9Aorfr+VNsiy4ryf6iqWMPeVQ3DViSkhe4Cen9HByHFwPbae52ujIjzBidtd6s72xc+l7q7O11ZpokWNx5Z59Bh6HU0rPDtKxCsG0YPDx11fthWPqiD+H/ydETuwiaoIYHZ5IPTvtTE6tozzvHPV5b4x/BiIkgBfPM7YzTB3M+V4jUc49hj21uQAv4OEpCN/aY8bCvyKyzT3JRfDBm3yjzfvl7svNQNSurC9iHaB4DmpVeJ4J6y/SXzTbe/pdOfXq9oO4Z1h/k3mwEmcF0JkhRdAMZ5PjKqUJuNXRpZsYe1SM8RXmFNCZ18gkFVn0dKQQ1J8A6dul8JGRYhila38vYce/xdgw8/E1IvLrKZQvWzdkamFv2xF0srGf73Mz0AEObzw7ruulX5J2zlTYxnpKt14vFRvIKlvR8YBbNZk4y0StOuirUPvsPb4bGsDUkWS2dbyOmh53ekhOyoRdeec3JklEjc4mjzHt4zQJT3oQryTJmExkV30QYq4ZvWmJwzSXU5Lo9cGkt67dJMMwLFztrVI7nj mIFUxOth yxTPAFmn/zl04e5CRJ2xX54mwtghadprLJvYMVfOyULKK+GNyEQqfdfzUFvcrdUgm3JPD0Grv5s2x4MztUxZWovo/uVPiRPfk+79bedNKCieRhciGIYlf3dmltD86nMBhGxx17gV2CETQ5jrVLCVz8Pwwdnirt5whghCD03jC1ZDxeqi4TVyWhuayguxTmtnVDJfmtgoJqdJwyAPhzG0qRKNbHb7p3j6cjmOhrhSS6jM91BAmxukXi+VxW6/1samGLC7XzR/dV+3Ttvqu2uG9MKKKTld/jSo1c/UF 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: List-Subscribe: List-Unsubscribe: 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 warns about fd being used uninitialized, in test_memcg_reclaim()'s error handling path. Fix this by initializing fd to -1. [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_memcontrol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c index c7c9572003a8..a97832b0c1cd 100644 --- a/tools/testing/selftests/cgroup/test_memcontrol.c +++ b/tools/testing/selftests/cgroup/test_memcontrol.c @@ -716,7 +716,9 @@ static bool reclaim_until(const char *memcg, long goal) */ static int test_memcg_reclaim(const char *root) { - int ret = KSFT_FAIL, fd, retries; + int ret = KSFT_FAIL; + int fd = -1; + int retries; char *memcg; long current, expected_usage; 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: 13652325 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4699AC4345F for ; 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 ; 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 ; 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 ; 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 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) 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/HOaXZz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yMy17XCsH6PZFECGGteMInJL3QHPxRwLgYdNc/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: LV2PR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RMzt6b1iheFZdnqOUMFwazsDSwtlBqmt/ ODfkG/9F njm11DBDQnK2JE8A0e337EKFnmGRfUwNExo1iIY0WXI2LHSIO4xEMAr3Z1c2RW5/2J0TsBp0vdWiRHNwYfb3uJp0A49llFGVnoWiQD9fbPiNVnf7mcrfmzZGtx/0wY3CLyVDdrxWIaWu9HV2MPztWICDQs+akt9IcWf9QAjzp0SHBuM5DeqijT02scaZUA8BxbSzj2M39JC2ZjwwjuqnALOCYG3MsYVuf31bigxcOgCxgJA4UrVHfG9rhcar2rb+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: List-Subscribe: List-Unsubscribe: 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(); From patchwork Fri May 3 03:51:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13652324 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BBC7C10F16 for ; Fri, 3 May 2024 03:53:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA12D6B008A; Thu, 2 May 2024 23:53:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2A3E6B008C; Thu, 2 May 2024 23:53:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2F806B0092; Thu, 2 May 2024 23:53:00 -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 808836B008A for ; Thu, 2 May 2024 23:53:00 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 38208804EE for ; Fri, 3 May 2024 03:53:00 +0000 (UTC) X-FDA: 82075713720.03.A44AF8C Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) by imf16.hostedemail.com (Postfix) with ESMTP id 6C6A0180010 for ; Fri, 3 May 2024 03:52:57 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Yk3uGBVN; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.223.70 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714708377; 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=g9WR5gBtXv5RhOqz26Rn5f7ugl+K5+DGwc1J+hEvwes=; b=gWvX96KKfzXlxa44GU/1E/Xcn+djQslS4q7DwAdrssTW0dx/2SEBL2N5r+TpvQkGUN3uk/ 4/+UoinEq6A4CW9LNUqRQpDmkCFXBJkjaH2Cloh4dMi/CDrYZPOQZFnDYozADZZ29pSU+S Pm4auJpExFPMvD0OehSKGc4N5ladPAw= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Yk3uGBVN; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.223.70 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1714708377; a=rsa-sha256; cv=pass; b=QgiKBvPTN5nfMrbEeVwkLSwHrsn4W4TabARBYfp5sgzKS7oGy0KG5TVY8HtLv2HmCG4lL2 gChVmubAa2YI7zGZyNCXex5idZ0bi1wJdDK15ZyFkiU2pBsEim1/QnTnjcr+f4XJWPk6cM PYUMJ4yoWVMxdD6Bk7+SlcR+gjYraSU= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KGONHHzWBWqkI1SEm+3gK7UxfNAO9NqGarkuCpUYgS8OMy6ZxF2HOSbeMzqtmLqe19RUY8Le3UqoZCQyjd77OeAv5luXWUN8zaX9IaWiVxw8UMzqFZ+NjlfSoxgmXqCjIqU6VOWl9yt5NPpeEd/hQ8OCwVMnruShJ2GiizhmdGrBe4rlxfbSK6HIOfzkhvKxOEjWgfh6/w+hDSjiNSYreDKe41rK2C7hDwVb2xEXSTs6pcX5uC4kphIVwJcTtjcgTifjRooCUAyYO8liwwPVC93nTNV28ak0ToRPNjfWDhf4Gypj+57CTQ4WJcwAkbQUwFRPXY3ay/1OgaucLM0WHw== 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=g9WR5gBtXv5RhOqz26Rn5f7ugl+K5+DGwc1J+hEvwes=; b=Ll3CZIY1gMUC48rNUQQ5rjmVTrNWWNRdeL56f1l+gjSNawDj+od3Kzns8/qmPBQYjiyjutMbi4RuZBSIKq/mdbWLEQBi0wLU1D/Dl1Vu3tw+jZA2ePXkUH11ragCt2PwAKLHsUROBTkM/yEEkTnJi20CAjjz4j7dJBwZUlHwLmguUQFTMyGyX4k8CozbTFs59GwSt93lhUODRECvpT7KEOnU6lFECxE8XpVY8q6dXQvn1m/EIb1PFkM+OfpWrS1W9/Gubm/9PD3eAL1ypdboJLWV/lY8aqbU9LYXsO4AdWRhIvTxLEhbcyUwS+1R62ilXJ71ubW390sIehTOJNYPZQ== 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=g9WR5gBtXv5RhOqz26Rn5f7ugl+K5+DGwc1J+hEvwes=; b=Yk3uGBVNIMfHmMQ5t1wFZTxIH83eq3VYcXLgKOIRSTR7PZg5PpU/vU2BV8LGLalDZmPtFSiswE9GlvEcHdQY/vpSsMmDgvKqmI6XnURfr8UXtkrDaqrymoLEwTwJqcNMhs4kvI108Bvil1mHkxPY8XFrISztJZOEUVfBBeeLN6Gut6R9V+yhRXYjZOnNFGWe/lq874IdYDyySrN9wH5yzQ7C2gO2Ulv0MjpI4x7U1Mb4fdS6gwoMcRxISuJJpLXFIbaxhlriyPzHM+U9v2OroMoQA2r2gd2Ws/o+oS/LE7qGE3fmtQudDuhOrA7jaNRvKVuFPKIEKwQPel+9dfsSCA== 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:10 +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:10 +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 4/4] selftests/cgroup: fix uninitialized variables in test_zswap.c Date: Thu, 2 May 2024 20:51:05 -0700 Message-ID: <20240503035105.93280-5-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: SJ0PR03CA0066.namprd03.prod.outlook.com (2603:10b6:a03:331::11) 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: c6f64795-4aba-4d09-1df1-08dc6b24454e 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: qpMz3QmN7eLRPcMERVe6qgqYo1f0dz/W1jEWmdEHTW02fp79KTBcOYfyDPBSxNHVrlqgOUoutaTyj2fXFjbRjiqQ9ART/BGssEqcHsbQNQsEYEL0Vtxmryq9b3pAtKzKJ8C2DLiD52NrWFdb9zffXRb7BF4dcEyRxmB0mu4fwvkHG+yDUC73JQGUkpC1FJo8P48UJtaDEUEK+Kkg+Hn1dK2Coj5w4QQxWCwKc9hQnvkxFeGITW9STro2pLnZfoTh/58HQiLFXdWGm2xIiIzoo9Op64C99dKBeZigLra9gNaJFmzEaXsw+k3DB4H2OMkwmO/2+jjGAjNYdXsajnjIpXfxu2SmyUD6Zumfe3PCpKW7+WbYb2uvUkhrrCIAPmzO9+Lb2Y9jqRRQaIZGQe6tFy6ZCnbYSXOKLexfeVDxi1PENWR1S7psHmLAI86kS1sHKDMf0EJUxy/qgx31W5CWRWmPeWMhXDTy2BzX/d1/pz+XoJW9QyAPUCWv07MMG2f8lZGgnJuEhgqlUVCfg5wy7sjl0PL5MHSdwNWsADiYpYV6Gu9IFtN5KgcFr6HgE616hlI6HE0N3vieCbxTXi7Go31bcDNY1sycrxPa7pFugDG+oLYT7zJJyejj6hGhp6zQGceMyawKmqR3AjO1ZBI5Y0DGRf1BY4GLFLXy7mQ2QAHBl/7ekNC+7osze0j47lNXDaVYCqTPDETPoGJAhgob7S+jIrkbALGJypw/bjgNKCk1SNLA3IAdntPlqsDWCxXsVZeGuXyQUDq/+FUQ0vN0WL2qLZ/rZ0UzeltnuEJqTxPLxZpcdilPtn3j1yRVt9W3t1hIDqeeXOdGABuJ3FKRqUqs4YbiMeeRwlwAIZNBWsLZsNfaPkuQe7tm1umx6vWBFkWLklhBgbT8V61bDlHll17q0na3Sm7iTywEd5pIItl+O4FFruacC07EZbDtIpYd+MZBSQt1k7JQYG2iMXuT+HpwfdfSyX9vpyVRY2azfgsYCfoA4o+C2mnj0pdXBMVzmGI19HQTglJsF0CHf1bnD/K26zqiAhBbyfZ/r16UY9gT0jCAgGBvpW330nS1shmEwYw8fNWpFjL/o9xJLDJBwqsbMraFsEV3OeO07vjIhlMAFQ4ADhARZfJLnSfyjqyHkEtDd449EKFNxZr/SCnLW6iAT2rgxjUSqVLWKu+L28PaeaMTZuYmxN4/7aEo+jkTuy6lb/03GlOQUYa9ULoR2sBtVNOKfdkKOoNBODUBzRmbIqRXohUt3/vFRl+ewBkGCg0n/FbQJGOmdh1dqVL8Wg== 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: avnkGjO8HoCCrykirEHUS+UmO20eAbBTCFn1MrRuhw9kPgyTjaVGZb8BiKoXFvgFibPdesHYUsFmEMTnQqXQwg98El7Ork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98hC0UD8Ydj0yf7T1yZcbTlP50W8AAD3MAaP1lQqzLb7LyNXOFVt2Y5JQKYcowY3JvVIO+ifNMWGz4f4xAS40AmS1RntDKbNJ+tU2AtY+3lOMrxHbDv+svZi+vbkfSIjh+zYsuQLU3pQVCIqjDByxKZtVovBk3Z7oEjfSfqb6oQS9Kc5hoN4+DV58KTT/0EJFnisvG4Syb2ty6jaxmnIIPDL1UTnEpLhsNPb84yG/wLZHK9brf6JVK1UfsfzScTma2K7ZobYvm0PnwnAiFvtmVzhmNnfePK9qJlPvfWNO2GEuscT6eBu55+bXj0DaDwIfDE/T1eJARcQXJnlBRjxfSX6MwtksUv9w1HhekK7rKbKQZ4A3OjGm0CNnj2/Dzc5am6bZ5/SQmEs1nOWmC+q/UKyRD2fwB+XW66xDlbDeHmxg/so51 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6f64795-4aba-4d09-1df1-08dc6b24454e 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:10.6566 (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: qzSnx0lCpzoXUcIapPFYR8xB+3Yu2Ak3eEWST3lH/p5cBA6cRK0sWrJnWhtvEOjWuqJ7IjQkReFcYGV/d+DddA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5941 X-Stat-Signature: fb4zm5psjpusz8a441ss8psq773cx5rm X-Rspam-User: X-Rspamd-Queue-Id: 6C6A0180010 X-Rspamd-Server: rspam05 X-HE-Tag: 1714708377-81875 X-HE-Meta: U2FsdGVkX1+vEU9VnstAwxn2nqM98678XMOvZij4RvuFnM1Zh2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fWFPBh/MTBmtpX84nB4LLX/RANT3eGJNAWYwNaOIzWCYE2tB2LrlP5IezpfxCedqlJqOKeCPgP4D9VTQjFCk2FbPgrNqf5+ISbyflMPJUxq75ScMMY827JsImc72Kyuc4Plk49bkxp3Kg5FRnomgUSg+ObF3+aJhpcbxbozYTS4Mvpyw4yXq+ZYuA3bWtBfAx6OzOL4EPnEGZv5omAt8+b7yC9yxEXFLI+NK1FLnJnWo6gaENH16AzGC9V5uTvzetl1OdJrXYLzpxQkFuelRC4tHYDfCuv3AXHQrg18+FygXH49xDx4xakATGi1v6vlk+CwAmF/T4= 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: List-Subscribe: List-Unsubscribe: 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 finds and warning about some uninitialized variables. Fix these by initializing them. [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 Reviewed-by: Nhat Pham --- tools/testing/selftests/cgroup/test_zswap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c index f0e488ed90d8..6aac80eadc5d 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -257,7 +257,7 @@ static int test_no_invasive_cgroup_shrink(const char *root) { int ret = KSFT_FAIL; size_t control_allocation_size = MB(10); - char *control_allocation, *wb_group = NULL, *control_group = NULL; + char *control_allocation = NULL, *wb_group = NULL, *control_group = NULL; wb_group = setup_test_group_1M(root, "per_memcg_wb_test1"); if (!wb_group) @@ -342,7 +342,7 @@ static int test_no_kmem_bypass(const char *root) struct sysinfo sys_info; int ret = KSFT_FAIL; int child_status; - char *test_group; + char *test_group = NULL; pid_t child_pid; /* Read sys info and compute test values accordingly */