From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 923061878 for ; Wed, 29 Nov 2023 01:21:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="wuzAKavw" Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F275E60C08 for ; Wed, 29 Nov 2023 01:21:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F275E60C08 Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=wuzAKavw X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -9.601 X-Spam-Level: Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8hwI-_d3Mrc3 for ; Wed, 29 Nov 2023 01:21:34 +0000 (UTC) Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by smtp3.osuosl.org (Postfix) with ESMTPS id F30C860BA1 for ; Wed, 29 Nov 2023 01:21:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F30C860BA1 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-db49a6b9be5so3913434276.1 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=lists.linuxfoundation.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=wuzAKavwilfTTcDI8S4XLUfyghFvQWvoX4PHgk6P36kRSnYea4ZMvamzeYH7T4ATz3 6n5hz4+gV+ruJa6Un8VxFRh5ejq17mFhFoZc33edMEddI25sj1XxxkuNsaUXpNA/Y8/i KmBhWEvrNbZAhSYOPsp4EHpHElNZdft4fq9rxwiUadV95ln+IjBEnSvaMiNZHwBtBRUN UEcfR4q5mFrKi0i2ScTpy6cBTcnoNoxm2Jh11XTanCVVC4GutL1SBAnW2zNUGbYdlH9l X1/SI4mmm1GvKbYWNRDQXcUqEFCiBCPLMMHij4RLzWEL5mUsuGkZuGessgLbSWwkJpcO GJeg== 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=PPTstSOccKg8CyPkVRsqoxfLdiwchfa3T+dGLAKC4Ho0F2vYfPfnJ53w6L1fBNenA1 9uSRDUb5pOEc5ybQX6MG5VMfFyp2RWoIxVQSwGUWvVUArQuscMk2meExbJ1Bw7ChoNVz DU+op+O51YoSCZBOuYW4MxdODc6I+xpyrRm5Edcc2dTZn4OXlkV8fTPjO+g7DbD5MP6H cJetyd1gCxeg328YQABlEvixxhtFPD5JhrFm5b5cEyCuGsF5oAF3x6IwcFcZjUOJuIso qjUFTezPp+IGrDrvMYwKaS6s67OZIsIETWlDihW/yZGEFLe1z5z9Ygvcbi8clKVFoX3K jVnA== X-Gm-Message-State: AOJu0YzZYnFgssnD2HnQhRr24qtiTFAgarSUB77tHZFq0+Q/+IGy4lhg jych8aWbtO4BUvnFZZgH/Smig4MEl+k= X-Google-Smtp-Source: AGHT+IGpd9WstVZO70Jt8U6PKwHv8oE/6qIUi7h3VLJVSM8jUfzJpaYP6i8qC329knKj6ZItVSI11Idz3Bs= 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> Precedence: bulk X-Mailing-List: linux-kernel-mentees@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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" 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 >