Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp417208lql; Mon, 11 Mar 2024 06:46:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIyEQEYWjLGizQpkvwsTCisOi8vHCtaOyPfSg1IrFmOyGXNbTHX93YMyhPOtlGFsfiwBZUehaYzVwdCTJ97tHOANCo4Ps/JWVc96LE9Q== X-Google-Smtp-Source: AGHT+IG5u1LJVhogsoTiElWJipeVf2zCeCAuXqvJWnhpfU4BEWKC4dcvGtgLBgxXyQjjXcc3IeAv X-Received: by 2002:a05:6a00:6602:b0:6e6:905f:4ccd with SMTP id he2-20020a056a00660200b006e6905f4ccdmr325175pfb.4.1710164779892; Mon, 11 Mar 2024 06:46:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710164779; cv=pass; d=google.com; s=arc-20160816; b=A3/ULHC4QcYMiKHnY7xEamoIQh9JyzX0VYLVDXuLM8v/diEhtVyir/K1CwvId2SgWD 8YthL+TIU/dr8fuoMKTTxH0JtJnR8gK0GPx9DyHKwv8lCucWj0abUoFmQB96X8HmgEZM kA+mkFnjrShuf0XLv6VcSS+AWDEaYMhbUCMZHqs6vWJGXldmDWTihmGhNwaWpL/i33oF l0p8J56qoI3/vyEYuZutdn0K0Pevv4vI3ERDPMG1oDqJeFMeZE2BTKZVWubsyC8oSl+V 7/x/kuF4GWU6rkC7eWCODpafcqAW7voSMQVMeopkpM2udrK+YIs8RoPxckXvsLvI2sMM B5Cw== 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:dkim-signature; bh=RSlrT+2IDrrNRqEUFQFgMF+IOBL1czDMXtZxeSZV+Vk=; fh=jq0WxCFhYlOl0uuvWpfQLyEki8XCYNBJO6QrIn3u03Q=; b=tE8cVSnWTDvX0Wykgc5MJ1t0sXRCmJ9zrrPQ6eyqWPJLNJDnx1V3eZwO+eHhgnURx6 E7+G7EAZ5Bv5XJhlNHnIBTVdejAEFT8j78JAnf6IYTugUrA4V1A3QSsCVo76AEr267p6 3qfr3He8WGjZt5mTMFYedXjkZh7HT9Rxoy42LpVUxvRkkb2cAIqmGasVSVT5A/C05y9S zAzWUHL4aCAT/3FTuIdIkky4Ya8cNUg5rHeOziHrOF2GGsviDQnkiPpmozV7QNLDnU3C NRuuYJd3pB+S/tHcFGG+FbwoZ3JFS+7AAD0FO0JjxcS/nIQlmg2kyGmoNKMLaPLhknlx 8m/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UcuanKhH; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-98901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i11-20020a056a00004b00b006e47dc9d922si4815005pfk.138.2024.03.11.06.46.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 06:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UcuanKhH; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-98901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6F825B2150A for ; Mon, 11 Mar 2024 13:46:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2685D3DBA1; Mon, 11 Mar 2024 13:46:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UcuanKhH" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 28F3F3D97A for ; Mon, 11 Mar 2024 13:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710164768; cv=none; b=m9c4YuRoOju5wX8fbHby6Imkidzm3VjgJFawxcpgEqRbPQPLP/+EcaNnV7nSL/a+mCQUTW+1HVpcENrixnMgkzOPdkx9P8ob30rkOymfsBhsc2+Sa3h8YFAeVBwST3fRy5ml3mXTxyPWBgjfAw/sC0zLxNBYYW3w+5fNHiPcJQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710164768; c=relaxed/simple; bh=IGgikpxQA5YTN1TUXE1XFOVsILWNGyTkicWdb23T6C8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=A8JzEeghQjWv2EmKTz0ywRWTJgKsrGy+cR37Th4ctjYBPJXjNgVHXfDEUzeDf6xx7zVwsdINhkNg7wGYA4q65IwY5KIwlhgwl668xC1ndQUFGqXCHci0D7HZEg0MgTmhkkorL2cTfREbnmEQKfyz7U8gwfe37+2pghl8268Ax0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=UcuanKhH; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710164765; h=from:from: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; bh=RSlrT+2IDrrNRqEUFQFgMF+IOBL1czDMXtZxeSZV+Vk=; b=UcuanKhHvRybOFBWK5Dxm1FpTNCOdkrR8w+YmMLpJlD0zHPRmaV3k1VsUvAEhESbWSGmJo pCI7Ajbe3KYMie2qtuBDoa/BDeWM3uC+O/M/sdG2j+8Csd21zAtZLzvXiGYMf9DIq40ph+ kAgLogfS2oVxhWtSOxr/e9h0GzThBNo= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-GgAJRwTVPFWGTm2ZfP6lVQ-1; Mon, 11 Mar 2024 09:45:56 -0400 X-MC-Unique: GgAJRwTVPFWGTm2ZfP6lVQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 45B0128B6AB1; Mon, 11 Mar 2024 13:45:56 +0000 (UTC) Received: from [10.22.9.132] (unknown [10.22.9.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6716492BC4; Mon, 11 Mar 2024 13:45:55 +0000 (UTC) Message-ID: <2e6c684b-bfbf-4850-b484-a1ace58a4c69@redhat.com> Date: Mon, 11 Mar 2024 09:45:55 -0400 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: [tip: locking/core] locking/qspinlock: Fix 'wait_early' set but not used warning Content-Language: en-US To: Ingo Molnar , linux-kernel@vger.kernel.org Cc: linux-tip-commits@vger.kernel.org, kernel test robot , Boqun Feng , Linus Torvalds , x86@kernel.org References: <20240222150540.79981-2-longman@redhat.com> <170912480380.398.9234775487451824502.tip-bot2@tip-bot2> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 On 3/11/24 06:57, Ingo Molnar wrote: > * tip-bot2 for Waiman Long wrote: > >> The following commit has been merged into the locking/core branch of tip: >> >> Commit-ID: ca4bc2e07b716509fd279d2b449bb42f4263a9c8 >> Gitweb: https://git.kernel.org/tip/ca4bc2e07b716509fd279d2b449bb42f4263a9c8 >> Author: Waiman Long >> AuthorDate: Thu, 22 Feb 2024 10:05:37 -05:00 >> Committer: Ingo Molnar >> CommitterDate: Wed, 28 Feb 2024 13:08:37 +01:00 >> >> locking/qspinlock: Fix 'wait_early' set but not used warning >> >> When CONFIG_LOCK_EVENT_COUNTS is off, the wait_early variable will be >> set but not used. This is expected. Recent compilers will not generate >> wait_early code in this case. >> >> Add the __maybe_unused attribute to wait_early for suppressing this >> W=1 warning. >> >> Reported-by: kernel test robot >> Signed-off-by: Waiman Long >> Signed-off-by: Ingo Molnar >> Reviewed-by: Boqun Feng >> Cc: Linus Torvalds >> Link: https://lore.kernel.org/r/20240222150540.79981-2-longman@redhat.com >> >> Closes: https://lore.kernel.org/oe-kbuild-all/202312260422.f4pK3f9m-lkp@intel.com/ >> --- >> kernel/locking/qspinlock_paravirt.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h >> index 6a0184e..ae2b12f 100644 >> --- a/kernel/locking/qspinlock_paravirt.h >> +++ b/kernel/locking/qspinlock_paravirt.h >> @@ -294,8 +294,8 @@ static void pv_wait_node(struct mcs_spinlock *node, struct mcs_spinlock *prev) >> { >> struct pv_node *pn = (struct pv_node *)node; >> struct pv_node *pp = (struct pv_node *)prev; >> + bool __maybe_unused wait_early; >> int loop; >> - bool wait_early; > On a second thought, shouldn't this be solved via lockevent_cond_inc()'s > !CONFIG_LOCK_EVENT_COUNTS stub explicitly marking the variable as used, via > !something like: > > #define lockevent_cond_inc(ev, c) do { (void)(c); } while (0) > > or so, instead of uglifying the usage site? Right, that should work too. Thanks for the suggestion. I will post another to do that. Cheers, Longman