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: 13652318 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 B7C6D22339; Fri, 3 May 2024 03:51:13 +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=1714708275; cv=fail; b=IcVIpE1hV9FqStRnSsPwDqXagg7W7hCCATgJkxZEeOASy09NRFgybrClxVskJwpIL5sANxI8u28+o3+A2sbqmCzW8OoGlC5MKg8g+wAG3xwMZ6YOuYOQrqpN88NuoARBeBedk74Z1GGZ6xJsoHNujON9oJDsksG511t+rU1kCBo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714708275; c=relaxed/simple; bh=417ntnB9MrrTmbxeBWGwgKj5y/u954m6VJ328OcPGzQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Grv6ulagjezG9IPT8rvNc8EITAAOFvU+wr+3p04TYygnd01JvWRUGL1TXSdyQcRQcou3TeKrWaONoA5LeamGdsxxWUsgwr0+/Iq+uQUhlBKmUqPj0wAfzSx4lkLAOTCZVeBf8UYCJjQRWhQKQ5QQwAoOebtreCIYMlIq0KaF6AA= 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=O6XzoCOA; 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="O6XzoCOA" 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== 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 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) 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: 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+czxGfzqV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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+dX0KzxE11QiMHNcMj3I3hxQeWSaEaj3Wo4fg2EoT9PVlGeWW5l27q98ur3OKRvAo7x9ybdPe7yTMbsjD5AJszorY6UPjPaNzH94kbkoVPuX95sJMz14jnt38HFgAoIkPqPpJhzxFmTOz1+ofCw8iUALLA3ZzZPQ6B5H33v1WVXk1u61yyw3cehFYtd3lqUMqbnhiLb09p1dohWM9NHGxfUekAsIV8znupbOowsrNM/qu4Uougu2ITpvEQFbnCxW3C/K/K1qnWbztq8GHLUfCOH3GFVxmAPQsZRoHJpZTLpRa0nrDxnvzgRYF1GMFbv9VQtp5B5G/nck5fhjv8OC0a/KO/AzvtaIaeFootffpFnH5xHkslExbsjeZgI+CsnQlVzecyPzSgIUrbJcaD/jYgkKSkbV1cF5LV9/syJCrwrjShWvdONM45qbIIXXsZwJr3LYH5IaqTe/WqNDNpJfIhbX65ekF8yE/u5rzxhpoJeGH2Q48QBsn+asFonQTXG2aO9VRfEdVUpPFadZaqOP00oe2qQJ5lJGmtBGj2dFdp0XmaKxOoEkAKNeGElHUl5jB24G8sIcR8ZiQonZAiAmbM3aIoPkUd59f83zqC8hDuRG+NgC019rORa+4iHLrnc7tf6aq1QjaayRwS3Qn3WS5REnZa85Ke1tFpDy9p0R8zBhSrck3vscn5FFlZ/Zfv5BXbkpHVRB/M2WXycUr4ZR08BXqq9YZ1aIIEI0vbHuF+4CXN+SkgRAgRC81OD9pt1uT4yGi7TkZohItk/8sj7LkMxXjyMHfVlrB1gwN5992vTPDCXBlGIhjmiIk+3MBxhTiYmOasjmtGasf+sCB4lHFYxCumynxszfHRmZwqScTXGy32XBVLaZIgaD4sFMODgxnBW9DtRBth5Pf5ET/X51BIg14rqNfMr28UJgoc4mLNwPHJaHYBT/7QQ0gvw1pxX1nhJo21FiGM6JWciSocUKDvgX8b4cKb/ArbD15Uk+H7gl//oNBYCAuXd7akCRybzOBjOqSF+gV0TxT1qYL6yZ63z3WsxmbUGd9RvRoVJ3fB4jqVYRDGoX4ouNHZo/SII+580wG36/xBZBn62Xby9WCI6KXuk9V53AGdKPD/SsKWu851MFZIgSZksoxGdSQVjiGFPUnK12v1PeYfl2/yktYw9bTgD7vtLToxa1/d/ColuS194HXYvHkeLttNvTJOtKF3OnZsmPTWzEordDEg7hwtPNTNfy44lc5X+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 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;