Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp358846lqh; Tue, 7 May 2024 00:54:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUshcfW2ZLoaq0JRiGOIb3UJaKQ/5UW68fi//L4CMkUcUzEOdAktB1n0g2rzOtFegamFOKCe/LTQoS/1OoEX/cSraYQ5OTr17/lLZkMTw== X-Google-Smtp-Source: AGHT+IF99RQVgoKHNd98Uh/cZ7G9hZgYI3Ndwk135b8Yd9FuDLyJ5wu6j2pWh1dvjUAwuyfNVg7U X-Received: by 2002:a17:907:7f26:b0:a59:bfd3:2b20 with SMTP id qf38-20020a1709077f2600b00a59bfd32b20mr5410495ejc.67.1715068492237; Tue, 07 May 2024 00:54:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715068492; cv=pass; d=google.com; s=arc-20160816; b=Jmps5MlHrUJ12yMTUYOWZfEEk5z6XXqKl8MMW6XaejeNVIt9c6MWGxHrjtmI75sGT4 QTrm1UlNMjUK3ooKZJE8pIvLwImNzzsKBF00b9+B0R0cm4NVnU8NAUwFhuR/zXnzqcN5 8/tdPPuU9nMqvGoWWEziPrkDpw/8ejD5BADnu36U+4ke88aYDEFL5m0KQlIE+PP8rdol o+QTRjj58hEL6amC5nT0fa0vdpXewjZBdtrF/+Jn00hX+92uShGp1HnCKWSzaCzfi2n4 y7F7DSzVXUY7I2dTeKFTXmh0b+0DlT817qxNqVMkB04ZWlemRtHuzSbHV16gj0MTzV1A os0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=jqUpqrpUF3nG/nH2OtSuD7lb5ZZvnTsOMfxeR/8gKVo=; fh=rkqz0Q1xIDDilFS/MAb4ByJ3tXxcFXtmT610YTbLkEk=; b=lxnG+Na2Er7KnVBcWatT1N0sYvN+ZFPMYJq4+AR8Jf7Kqdipc1NhQ8IKKwPvW+g9/1 imZE3GgDj1GrOk571OOZ0u6aqKir58qJmpcMAUuaagyDlpmOzHUdvtf+6LiIWoRbVJzM jB/ZXkTbjeB6uiN46w5UJeq2+MAXWYvfc0j+5QlWDlhUdzq+23hqL9qDVm1vF5Ff8HVp ERimqZl2Ukx19v/VXNRfcxwq+9TB0q7LaEnKVnbi+kmlKosp612vQt45+q3SFhAW4avK 0jsJE0RImE3UemhKl6+2rNeqZRwWPTP3uZGJlFIqDaFK5EYb7csCyTF/uE9ASv5Kryh0 a0BA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-170840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y14-20020a170906470e00b00a599c6ac99bsi4482955ejq.229.2024.05.07.00.54.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 00:54:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-170840-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D73701F24181 for ; Tue, 7 May 2024 07:54:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1A7913C825; Tue, 7 May 2024 07:54:46 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F120478274; Tue, 7 May 2024 07:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715068486; cv=none; b=CFQPZ05cKyYuTu7cu3vxDrfpZqId1gr1G5YQyrON8mj33/lc7vWrc3Zon5z8P/Gn7YJU24TyzPA/LCrQn/6iahuecxSw5YquMYkBnnXu7Ey3XNX2xZBoep2MdbIIcQmaCxh7XsNC87fk1hSc9sWcZY6pch9qk/0cFWewrX4ujIs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715068486; c=relaxed/simple; bh=8CS7oD1P2aDL3KsONenRwoHwZOwp845fLH6pmTSlTgQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mDIoE4WZ1fRU1QVYctxkcOLSJju43WtIIdgoBsXOYIJuHqqmTEIjYXit9FfvuyNop8Dl3jL75uWMmW1QIIhVmk2g/2Qv45Ssl7Ah89UucQA3cdlXJgrRposx0hJiLfhk278Owv2wrRzuqBe18rN2MrQGVmcnJcCcSKgM1Tl7g3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 83DAF106F; Tue, 7 May 2024 00:55:09 -0700 (PDT) Received: from [10.57.67.145] (unknown [10.57.67.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30BA73F762; Tue, 7 May 2024 00:54:41 -0700 (PDT) Message-ID: Date: Tue, 7 May 2024 08:54:40 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests/mqueue: fix 5 warnings about signed/unsigned mismatches Content-Language: en-GB To: John Hubbard , Shuah Khan Cc: Andrew Morton , David Hildenbrand , SeongJae Park , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev References: <20240505221359.65258-1-jhubbard@nvidia.com> From: Ryan Roberts In-Reply-To: <20240505221359.65258-1-jhubbard@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 05/05/2024 23:13, John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftest > > ...clang warns about several cases of using a signed integer for the > priority argument to mq_receive(3), which expects an unsigned int. > > Fix this by declaring the type as unsigned int in all cases. > > Signed-off-by: John Hubbard > --- > tools/testing/selftests/mqueue/mq_perf_tests.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c > index 5c16159d0bcd..fb898850867c 100644 > --- a/tools/testing/selftests/mqueue/mq_perf_tests.c > +++ b/tools/testing/selftests/mqueue/mq_perf_tests.c > @@ -323,7 +323,8 @@ void *fake_cont_thread(void *arg) > void *cont_thread(void *arg) > { > char buff[MSG_SIZE]; > - int i, priority; > + int i; > + unsigned int priority; > > for (i = 0; i < num_cpus_to_pin; i++) > if (cpu_threads[i] == pthread_self()) > @@ -425,7 +426,8 @@ struct test test2[] = { > void *perf_test_thread(void *arg) > { > char buff[MSG_SIZE]; > - int prio_out, prio_in; > + int prio_out; It feels a bit odd for prio_out and prio_in to have different types. I don't have any prior familiararity with these tests but looks like they are ultimately the parameters of mq_send() and mq_receive() which both define them as unsigned ints. Perhaps both should be converted? > + unsigned int prio_in; > int i; > clockid_t clock; > pthread_t *t; > > base-commit: f462ae0edd3703edd6f22fe41d336369c38b884b > prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27