Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4267371rdh; Tue, 28 Nov 2023 17:21:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn7nkYbQFI+xZpRAl+BxGCgGlLYgS5nc61GquoehF8JPyDop2jjmMGksrDciLhxpj0YXFr X-Received: by 2002:a9d:7d11:0:b0:6d4:726f:689f with SMTP id v17-20020a9d7d11000000b006d4726f689fmr18152126otn.6.1701220917540; Tue, 28 Nov 2023 17:21:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701220917; cv=none; d=google.com; s=arc-20160816; b=ebViinCiVOGaaTwMNDyLW5nO6aZ6waNNiAqmggHRp17asF8Dq8EYuGQMnKgLYJ2o88 cCxuracvy7BZeIfjwnq76wXfzc55k3A15BBEx0FDOqrUrDrdz/SvDAwY1iXCBU+p4ivG sSsUkF2tBFtGX7/McLyc1ZxYIzvqDXDl07alwJLOjEHa+OERJSoQ07pHgJXBonpk8Di7 Lts3sENqZhyNhvrIcTvE8z105XjYzigbaNzddS198wrLMyBEky9E03WnyV6qSYlat3s0 ynpNntaTS2R6FXTRWIbK6m9bNXYpk8rFnfGXE0dbiBXlXa4Vk6LMFrLkZrslLkwG6TNT 5kCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=8xaAjFqVU5qqDjrAOLsosHck+47UkrNNUxTMBaKXJJI=; fh=nXytJfQNA1nvbAlLIVuqPYuKP7YuBi5IIqd3qmtXwJQ=; b=0WwRM2zowj91cvGBftqgmF88KukIV/3xJQ6MgMwNeec8iAfj0DFCAgd3kTzUGkGZwQ E9mUVpssQRxBbkPMwtX1H4jDGIOBHAa/cVOEnr2pds/yRQbXuIL9m6cpDRfyYnH6h35u qVI/NM8JJa42wkQmS8VmD2C+nJzCBfW0V1X4yUEVqIiDW+8jqyHDKp3rtHBBPvqhMEAK M/8/tyWf8Q1ZehOdpki4tWQEveuWt8HphV040WmPPN0FwhfQnub/FGvfSkqsLk3MfU5o +YfMcAv3/+OwtbVZ+UrGN5uN1mf1yPNTJx4nPa11g1Dx/yLiSPhz0/Pw90nafyj0PBgk 3wfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=zWdzihm7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f9-20020a63e309000000b005c1faa82c06si13002705pgh.470.2023.11.28.17.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 17:21:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=zWdzihm7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DA1FE8046BE4; Tue, 28 Nov 2023 17:21:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231211AbjK2BV2 (ORCPT + 99 others); Tue, 28 Nov 2023 20:21:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjK2BV1 (ORCPT ); Tue, 28 Nov 2023 20:21:27 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A10DE19A7 for ; Tue, 28 Nov 2023 17:21:33 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5d1b2153ba1so19544447b3.2 for ; Tue, 28 Nov 2023 17:21:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701220893; x=1701825693; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=8xaAjFqVU5qqDjrAOLsosHck+47UkrNNUxTMBaKXJJI=; b=zWdzihm7yZ+KOfeghLkuomkjljHlJRQk52R+2V8e6aqlRGP1ptAwVNCyOFurj7WCCZ 1CS8P8Vm5sSYVMwf7U6lF5gCInrTcsGXCTY3EJU4gS5Y0P98VHtR93piKJrIllyaYwgH 9U9q+pxP8vHxVZ3zKkJ2rqNuxDvwQFyslZtmWAwg+IHCMBG5TMBRLU0t/HhFtHjqAMEy UFVpe3azRCaJmlGB1M4X9KEYxYakFHzwlxkw5nt6Y3Aah++0Qj2DkjDyTMUnNgq0ki8J ubQW4AWNDpmRfLOrdkniNSkakB6reGQReUyfavA+/qnX5ZDy8C/zj2Sv+9WSFJTXs3Mj AJBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701220893; x=1701825693; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8xaAjFqVU5qqDjrAOLsosHck+47UkrNNUxTMBaKXJJI=; b=biKJxx6wsuwA4UyMiXvBB+YDzDWNE7tg7C1MwgGcduzYaoGGxGaVlJ3bWBPJQMnbdQ 7X/Cs5sbootlNwjl4yNA7yMRkTW8+/GpRuwb6M6vZ/evVs545ApxMoj7xAP4Eoqn6f4A M5J4p5EUJgMZlFG+1EvAtnCGzCFwL4Lwt4Do94ro0MEF30VL3NhpQOm+gZTm3LiPDpNO CU3dX6vk3Yz8Own+WIC7WDV1h8GvgWbFRjY2U34P95iD4htA78c6EAwN4d37jjP+uoe+ yFwDSMN55GpMoWjAVRxjBHGF748kjJNhz/AZmEvycKHzkjJE3u5+ywpXi16g4KzVW+Z1 JWRQ== X-Gm-Message-State: AOJu0Ywmsn46jkmFXDYTxDRFidPbavLNZRk9VGW59MMK5HHbCKAxxiP7 rDWqzdX/1o7nh/zd8RFi0YDWcVZ/ETQ= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:d114:0:b0:d9a:5e8f:1562 with SMTP id i20-20020a25d114000000b00d9a5e8f1562mr506949ybg.6.1701220892813; Tue, 28 Nov 2023 17:21:32 -0800 (PST) Date: Tue, 28 Nov 2023 17:21:31 -0800 In-Reply-To: <20231128221105.63093-1-angquan21@gmail.com> Mime-Version: 1.0 References: <20231128221105.63093-1-angquan21@gmail.com> Message-ID: Subject: Re: [PATCH] Resolve Macro Expansion Warning in nx_huge_pages_test.c From: Sean Christopherson To: angquan yu Cc: skhan@linuxfoundation.org, shuah@kernel.org, pbonzini@redhat.com, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 28 Nov 2023 17:21:55 -0800 (PST) For the shortlog, specify the scope/domain/namespace of the patch. For KVM selftests, that's "KVM: selftests:". And ideally, describe the impact of the change in a more conversational way, as opposed to stating the literal effect of the patch. Stating that the patch fixes a warning is obviously accurate, but it doesn't provide any insight as to the severity of the issue, i.e. what's actually broken and being fixed. E.g. KVM: selftests: Actually print out magic token in NX hugepages skip message On Tue, Nov 28, 2023, angquan yu wrote: > From: angquan yu > > This commit fixes a compiler warning in the file > x86_64/nx_huge_pages_test.c, which was caused by improper > macro expansion of '__TEST_REQUIRE'. > > Warning addressed: > - The warning was triggered by the expansion of the '__TEST_REQUIRE' > macro, indicating a potential issue in how the macro was being > used or expanded. > > Changes made: > - Modified the usage of the '__TEST_REQUIRE' macro to ensure proper > expansion. This involved explicitly passing the expected magic token > (MAGIC_TOKEN) and a descriptive error message to the macro. > - The fix enhances clarity in the macro usage and ensures that > the compiler correctly interprets the intended logic, thereby > resolving the warning. Fixing warnings is nice, but warnings are a means to an end, i.e. they identify things that *might* be actual problems. The real issue is that the test will spit out garbage instead of the magic number. All that said, applied to kvm-x86 selftests, with a heavily rewritten shortlog and changelog (I had the same fix locally, so more or less just grabbed what I had already written). Thanks! [1/1] KVM: selftests: Actually print out magic token in NX hugepages skip message https://github.com/kvm-x86/linux/commit/3b99d46a1170 > > Signed-off-by: angquan yu > --- > tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c b/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c > index 18ac5c195..323ede6b6 100644 > --- a/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c > +++ b/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c > @@ -259,7 +259,8 @@ int main(int argc, char **argv) > __TEST_REQUIRE(token == MAGIC_TOKEN, > "This test must be run with the magic token %d.\n" > "This is done by nx_huge_pages_test.sh, which\n" > - "also handles environment setup for the test."); > + "also handles environment setup for the test.", > + MAGIC_TOKEN); > > run_test(reclaim_period_ms, false, reboot_permissions); > run_test(reclaim_period_ms, true, reboot_permissions); > -- > 2.39.2 >