From patchwork Fri May 31 20:07:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 801012 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2052.outbound.protection.outlook.com [40.107.223.52]) (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 7B35217E465; Fri, 31 May 2024 20:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186088; cv=fail; b=BEMIuMygvr07mvwbMPqnKflbMCXTRXTp0pmlGVZbJxAMVdxHQurKwHAqTlv8bVAbbVfmdm5I71jrGzjFdWCU/O889nmL2yn/tHBLrzQEtrryecM6OmzJCAc2m59YQYjgBwFbEU24pJnctyjlUmDq/ygXp0OX4NFynRHkDGZTSv4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186088; c=relaxed/simple; bh=lyrdU9ywPV6tQblRjHQpbjKpx0OqtvVmhYvFxRDitw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=kNmYoLxNKstqBNu5v86ZMUYrRf0H3lEc3/wAK9Vl86QfJDzatZa99rYa5Bu2J2KPi1lfUHjQOnHvOm1TNuMBUgE6fAJQJ+Gs8rRQjK4Ko6JP2YvEunJMN4xdhf/2UVN4hfIMnQUyU7+4n7ksqyfaeezqX54BDUwRjW/TmaeQY1I= 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=YARHF+WK; arc=fail smtp.client-ip=40.107.223.52 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="YARHF+WK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UqQtzuin7yHAgHd3/0yXAAVPF90Tw0jVGtLh8KVCGcXGqjRaAFn2B67B+7Ot22q4AYhcJeF1R8pqkkgfvwOSjLotvrR7vLyBL5FPlmNzQbUFTANDMpRCrbm0cxySuO5uFI3YOrC8mEpcxMmNQe2KEe3KizcuOq1av2bqw20hbSgwGcaODofTHwL30n8e0Qg9u+buTlap9HlTFGdsrp2qS+QDv1Pb8wrjs6MIohXj27TlvLTBzHparqUM7Q0XEQ1iLF03hm5e4eDK4VojUm+9bgq4ZkoQPTm0JuBuyTDHVfLhaPsTGqEspnJGhvreuS0inqUuJSqBj4QsnINR3JcILg== 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=OJoxXBNzAu3/ZxgJhtTMelWsXD27WupqI8v837F8y+U=; b=ZQueBP7SPCj0sByQvwpJBFQd1KSoQhZhlHVOZRbpHwXmKUSGnL9WEk6f/FLw5L6ZQ+qE+dHII/HrntNRfEEGYsI539PLFVGk9cweTX9bQK68aCOvi68EM/BM/D0f0ZYFiIq7dCqCMF99DwYDpUHXC3Oj4VgmtZM6ZqdYBPF0iVUq+00OyGwVkXA7OXrWJMSjNBIlh+P0r//AoHbr0TRfiWG62B9A7l4S15eo1JWKKWd8FJsdYyJfUrsytBPlXT+QWJoJKm41gphCZNhriW1kvCgDCZXT5Jgl+dZvATZuvBnArUQLVa6btm3Vf/2L+d6qcozaaUGxWbyeBTxqDagIpQ== 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=OJoxXBNzAu3/ZxgJhtTMelWsXD27WupqI8v837F8y+U=; b=YARHF+WKLGM2KgyJktS/2MrEiYZ8eePa5RUGKQBidwUcVqsmDCZRFtS95PGNQV3Al+3bGOOVbZsbPKNU+Cotxie7Ndzmz9qbrriVJNOiLJ1VhSYsvsP/BxY7y7/t3JE6PImy6Jhd0JRR48yEV30t4+ctVkAvizFl/5AonvbZkeegwTOV9haLb1yGR9Z+YpNQVh6gDfYuYEXfLW+U3/ZtEd0UjmM53E3/gqfOa1ym/sxnJPFePOpH/+TIxF/LaKuVmgvyQurQvo8XixteHDYtc7ZAF+EKMo5gl8r4OJDojzfim/k/vztLM3xqqyv5Jxt/S3/d+MMxxO4HavGlg1Xp6A== 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 CH3PR12MB8880.namprd12.prod.outlook.com (2603:10b6:610:17b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 31 May 2024 20:08:01 +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.7633.021; Fri, 31 May 2024 20:08:01 +0000 From: John Hubbard To: Shuah Khan Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , Edward Liaw , =?utf-8?q?Andr=C3=A9_Almeida?= , "Nysal Jan K . A" , Mark Brown , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, John Hubbard Subject: [PATCH v3 2/3] selftests/futex: don't pass a const char* to asprintf(3) Date: Fri, 31 May 2024 13:07:54 -0700 Message-ID: <20240531200755.128749-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531200755.128749-1-jhubbard@nvidia.com> References: <20240531200755.128749-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BY5PR20CA0018.namprd20.prod.outlook.com (2603:10b6:a03:1f4::31) 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_|CH3PR12MB8880:EE_ X-MS-Office365-Filtering-Correlation-Id: 25abace0-c4fa-47f9-f76f-08dc81ad5f4f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|7416005|1800799015; X-Microsoft-Antispam-Message-Info: IUmLS/nyXtCYPQQ5WH5s+07fXIEyD0Th33l8/Ins8F5JnJSdUvvgGZkL+B4Zf4+Ep3e3oM2ZlngO5e7fd0WdCrv0ey3DVhGsqj40NB7maLFeAxuksPKIPVZk70GazZx3f/RRH/MTygWDzcOUGOyXv5peWJi5pWFywWjnzABhAlOo/MKfFA13FBaOkmM63QeaN22VpgP/IECVzhnjS1Si/eaolaPj1NzNcN9HuknGIxqh8PPqotVU+opjfRc0CQaHKIpepiTpAJA7omD/IwlinB5z68hAIaCfZQKNMnmysZwIQb+AfgkgVKxSpEJ82Mefi2eNEplgeJn7ulTqk1mbhGpwJvxiWCIjuBqzyfwlh8fhmvFOirR3VJOhPkOSqHryORTPP0NRc0Os8twe/7Uqi4Y079jRO0XOiT9Hf3gT2qpRl4+VQlR7H6HcEiG1hdCpM79bmL8q4MVkFYW4KHjTPMRxPtwh0lmg+Axfxv/+KEDdhVy0h77cWbJNlaYPwSzGuwo4OUm2Wqqi9ayRGj9RLjvZo5qkELqlDxWZ+c04xSpi5R+rq4s9acyK6iZ5qAeElb48Z4udXlH+1gY+Cx73VGYArtJgFGmvb1WVJOAF7UhiFMZIsjEkxCP1xtMG02wbUhJGM7PZb5q7CxgIxM4tIgWhmN1qo6PNLpHLJXxVwgtua028krFhPsEX2sREx3QuC9rYymbvtlxg3NKk5UcHfGiuOTk8ACZe2116Czz74nPYEacelWqdf/DKF2nxohvkPHizUMJgJaU8ZQqei2REs42+mnrVdx7LpGaq4YZLAkhR5gh7VQNz6CzA+OtEeDnhdTji4UTm4TfHRFJff7K4qyIL1teKqFYb/b+oAgLbhTiCnifgUfsXEys+fpUr7olT1JDB7Ww6qzqNLiuPZegVcFiuQMsCpaP9mF52tzR4jHynzYj7EJOuqatO37Mhzbm/r+Q1vDjpnEIWpt/anENTnX8nQ0dtOqqhbhjv12vTrtGermbeVgCKxpcGYkKRKF7fmg7+Q73fmtY/B3FTyleZUtXF34rSGjVS3LuZq9ZRNsfhE83WdVMkhsTI5qnyyMPE0GL6KwHjOMlDhp6okvwryPjPlzdz0k/hLcVwOKb1LedXBtAKsFtH6dEpnaUhyP19QSetmXkOYkoFzCbCfwHtU1c4z+ueAAKbigvA8PyGAoeD2qTqmr6NHCMz49LKwe3GVAQxTD2ifYLDEASalq1C+qsqzzHZ5ZRqvLsSkUJFkvVA/cTx6R9cTdkcEcGQYwo302DQvbK4T7VpkeMrSB19jg== 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)(366007)(376005)(7416005)(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xXZw/p+jxXTsbfeKTGd2wrx3waVR5HlAzDA7+sw8j1DdC0rF0j+5FkGwr0ncvbiPsoErUsl+M7LRZFNibAT6c073hcYkXxsE7b1i3feopi75KqAGP/OtoYzj959wBMD/BqGvsc96+Tuy84SHG506Q9pukMphld0L4Zuu3mJADpIVWWwKuud6ahJpliY44GmQyIoN/P4efS5vowjLPMk98StJlKfKWk666J2y9irdWKZLwqix9RUuN/arOvtZcXIZkHQzNWprx1FvwFH5fk/cnQN161y6tS2F6i9EjW2NZ5T76MgC+7qAUZyqWJp0ICsBOIz3tcSOvFrYx7KZiO8pZbWCfE0paBDN0F1WrXBykSpmrI/MPjYAFaR7U6ved11aBe/2Bns6gmkfU7qk2Urkj86C5cFxzBHE1loSKGuqkTrH3lqu2DeK6rYCm54Hx/6//jYpuMtBIBVSpPGGEyCI6T76N7EHj0Jsbncq1LAa4OaQfEeoOnyU5VnYRQdHFgjTg3VHiw8iI3PsQcCaq7kOhMfSmqEwssr3zboeUYSrJHa+w8FImdlxbTyYPIFnJ8YZPkPYt/85zbXWWbGQ1Iv0q X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25abace0-c4fa-47f9-f76f-08dc81ad5f4f X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 20:08:00.8825 (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: LyGXHVkiLc0Y2OEzE5pYKh5cIJNV0BBknrupVB/3HPsJb8qgaIGfmnzWP8bZ4EXmjMqBfHTptkLlhG9jT7eg6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8880 When building with clang, via: make LLVM=1 -C tools/testing/selftests ...clang issues this warning: futex_requeue_pi.c:403:17: warning: passing 'const char **' to parameter of type 'char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] This warning fires because test_name is passed into asprintf(3), which then changes it. Fix this by simply removing the const qualifier. This is a local automatic variable in a very short function, so there is not much need to use the compiler to enforce const-ness at this scope. [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ Fixes: f17d8a87ecb5 ("selftests: fuxex: Report a unique test name per run of futex_requeue_pi") Reviewed-by: Davidlohr Bueso Signed-off-by: John Hubbard --- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c index 7f3ca5c78df1..215c6cb539b4 100644 --- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c +++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c @@ -360,7 +360,7 @@ int unit_test(int broadcast, long lock, int third_party_owner, long timeout_ns) int main(int argc, char *argv[]) { - const char *test_name; + char *test_name; int c, ret; while ((c = getopt(argc, argv, "bchlot:v:")) != -1) {