Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp883221lqo; Fri, 17 May 2024 04:47:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjTazpwLRC2mq1E48UMRrmx6eTrDzeeCgZDbf58OFPca0Yf1+Y+7SgrDYzcSvFT2Rmwacj7vnnUoHf53WpvYuQSEmhkTdflhQTv80wRA== X-Google-Smtp-Source: AGHT+IFWO+M28PhN8GQlOtFtlD3BGfsw+9Ja0Foy0Vy+TyCuabRNdYMVTGxFTjaXOpebWBzS4xJQ X-Received: by 2002:a17:903:18a:b0:1eb:7855:43d5 with SMTP id d9443c01a7336-1ef432a0bf9mr307806625ad.30.1715946478735; Fri, 17 May 2024 04:47:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715946478; cv=pass; d=google.com; s=arc-20160816; b=DEVgxRbBOjiyoTsHvbw61Vnq0dQq+dZn0NVjde5sdlG03Gmuy3ych6qc9sdVWnU/lr hYBU2Ghvq1UTCM+ZofZILmTxmi+RULqYgNzeKPlMV+NfbV7au07MpT2oeQffQEuvacPR qQRYJ777uihsM8CYhBcxd0kKTXsqQdKbNL4lSfhiuzRbAIbb+Ifllxr7hXnzz2lUwSPG GSv+ggtlASlwa3lYbSPurqxAV1U7xqcMcMP2hyLhMYFdwBrXhdLVhbx9CGU95DYU9Ghk 4wKsPjKSbST2Fj6WaLlZ5W+hHsejQri1qulQYD7wTYlR/oelsrpG78eSFQKlBaNwQ7Vg k7tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=sZkM1iIQrO/aZJM4DETef1Hb5d0Zglnn6DrGJnw3W0k=; fh=HGafBhPP3bEBrAHm345Hr48afHSWL7G5AXVCcd4JzlY=; b=tQXqP2FYVYH0c/rEkNTEAna0I0FcBCFX09yliekAWgLJfi1Ikd1j5/KaLGWh18jYHY WzbHl/yzKFAXZK/QrNhNf6Pero8cqD3K7st4L9wwELYI0TGj8fRedFPUiLVoH9Km+5Sn wzlZY/yj/cT797EbVkJuQxEDU4/uIa5qZloctwMYqbqj4OHUg6ireFAHAmWe8xRxGfBW YXwxY1A3I7AcCAxsh2MCf9gQqhSJ7x2Lp7yAVYOXjcKKsJZy9Fm74y5Lwa0klZh/XzxY PVkwms1DHkxynLonr7aY8YNgrMduzr+auhnvUUGxeqVzCG6XdOdbV1OnxGOUdXebDUTo Gbrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a78AsdW9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-182066-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c269dcesi36917905ad.592.2024.05.17.04.47.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 04:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182066-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a78AsdW9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-182066-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6B38328594E for ; Fri, 17 May 2024 11:47:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D93747F41; Fri, 17 May 2024 11:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="a78AsdW9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4F12446430; Fri, 17 May 2024 11:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715946436; cv=none; b=TqNCut4ENGLVqaxl0hZGA4Mhs0ghu14QYnLZr1gTPas9AXo4ccpag5LB0Wd2CXwj2By4JcIrhGX9SOKCVlFKKsHz0281/V63DDQOyJkmrBxx1CfBCVK0rEVLhiLhhbq9ezEya/FzIrXHaxvmJIjzfi9uUOsXSmDVD4xAmd35AfQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715946436; c=relaxed/simple; bh=UoqNsGNyzyLu7s8bzQeD6P7uutNDfTV+vmBWhSAmYEI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rdEtFGRtr/jfxKrVFX9wY065VoG0f4ofkeJNBf+kUzukhgyZpPzgKMAsZupuWwORp0ptPczS69lQ0ac/jORyLruDg5XXir00mtzGYSKPc/FbBM8u9PHl+IBJI47dZDrPEo0gw5MvDPgy7OtrJlGVQrzCe5grS1X5k7T8eluqc+0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a78AsdW9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9311C4AF07; Fri, 17 May 2024 11:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715946436; bh=UoqNsGNyzyLu7s8bzQeD6P7uutNDfTV+vmBWhSAmYEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a78AsdW997eVleC7I4mBtEYm9dUKx0MkihPH/trqPkmt0SCVZyhnkrzfWxuKmdel5 ZRMl5OVO4o4WYYz9biGJ0l+XKq316WwuLuFYxpTSlgmBGv3+l7L0/nICVxkb+U06F6 JVOhNBT1DpKF5hKB9cTJHLnN1Tqug05mdCvaGo6NSXasCcPRKOFM2/NUuKFGdPHSX2 otq4NVOyl9jGmrAMk5XAKkjaQBHoPrvokxa4leQtcSdbJD9LDGvJ7vyNYKuZO0g6RP 4f/3An+FQ+475nA2mt2P4Py9EQJYCwtYC6+bVRueDtx0TLUcl8OUxcO8N0nRX45k0p cWJXngRytIpjw== From: Masahiro Yamada To: Kees Cook , Andy Lutomirski , Will Drewry , linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Shuah Khan Subject: [PATCH 2/2] selftests: harness: rename __constructor_order for clarification Date: Fri, 17 May 2024 20:45:06 +0900 Message-Id: <20240517114506.1259203-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240517114506.1259203-1-masahiroy@kernel.org> References: <20240517114506.1259203-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Now, __constructor_order is boolean; 1 for forward-order systems, 0 for reverse-order systems while parsing __LIST_APPEND(). Change it into a bool variable, and rename it for clarification. Signed-off-by: Masahiro Yamada --- tools/testing/selftests/kselftest_harness.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 60c1cf5b0f0d..55f96037582b 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -774,7 +774,7 @@ item->prev = item; \ return; \ } \ - if (__constructor_order == _CONSTRUCTOR_ORDER_FORWARD) { \ + if (__constructor_order_forward) { \ item->next = NULL; \ item->prev = head->prev; \ item->prev->next = item; \ @@ -837,9 +837,7 @@ struct __test_xfail { } static struct __fixture_metadata *__fixture_list = &_fixture_global; -static int __constructor_order; - -#define _CONSTRUCTOR_ORDER_FORWARD 1 +static bool __constructor_order_forward; static inline void __register_fixture(struct __fixture_metadata *f) { @@ -891,7 +889,7 @@ static inline bool __test_passed(struct __test_metadata *metadata) * list so tests are run in source declaration order. * https://gcc.gnu.org/onlinedocs/gccint/Initialization.html * However, it seems not all toolchains do this correctly, so use - * __constructor_order to detect which direction is called first + * __constructor_order_foward to detect which direction is called first * and adjust list building logic to get things running in the right * direction. */ @@ -1265,7 +1263,7 @@ static int test_harness_run(int argc, char **argv) static void __attribute__((constructor)) __constructor_order_first(void) { - __constructor_order = _CONSTRUCTOR_ORDER_FORWARD; + __constructor_order_forward = true; } #endif /* __KSELFTEST_HARNESS_H */ -- 2.40.1