From patchwork Tue Jul 25 17:20:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13326147 X-Patchwork-Delegate: brendanhiggins@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B742C001DE for ; Tue, 25 Jul 2023 09:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232545AbjGYJV1 (ORCPT ); Tue, 25 Jul 2023 05:21:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232774AbjGYJVD (ORCPT ); Tue, 25 Jul 2023 05:21:03 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A6301BCF; Tue, 25 Jul 2023 02:20:30 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4R9BMX3KQ9z4f3xbF; Tue, 25 Jul 2023 17:20:24 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgA3n7LXk79kz98TOw--.50512S2; Tue, 25 Jul 2023 17:20:25 +0800 (CST) From: Kemeng Shi To: brendan.higgins@linux.dev, davidgow@google.com, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org Cc: shikemeng@huaweicloud.com Subject: [PATCH] kunit: replace KUNIT_TRIGGER_STATIC_STUB maro with KUNIT_STATIC_STUB_REDIRECT Date: Wed, 26 Jul 2023 01:20:51 +0800 Message-Id: <20230725172051.2142641-1-shikemeng@huaweic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E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvj TRCApnUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org We mix up KUNIT_TRIGGER_STATIC_STUB and KUNIT_STATIC_STUB_REDIRECT in static_stub header. Just correct KUNIT_TRIGGER_STATIC_STUB to KUNIT_STATIC_STUB_REDIRECT which is documented. Signed-off-by: Kemeng Shi Reviewed-by: David Gow --- include/kunit/static_stub.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/kunit/static_stub.h b/include/kunit/static_stub.h index 9b80150a5d62..85315c80b303 100644 --- a/include/kunit/static_stub.h +++ b/include/kunit/static_stub.h @@ -11,7 +11,7 @@ #if !IS_ENABLED(CONFIG_KUNIT) /* If CONFIG_KUNIT is not enabled, these stubs quietly disappear. */ -#define KUNIT_TRIGGER_STATIC_STUB(real_fn_name, args...) do {} while (0) +#define KUNIT_STATIC_STUB_REDIRECT(real_fn_name, args...) do {} while (0) #else @@ -30,7 +30,7 @@ * This is a function prologue which is used to allow calls to the current * function to be redirected by a KUnit test. KUnit tests can call * kunit_activate_static_stub() to pass a replacement function in. The - * replacement function will be called by KUNIT_TRIGGER_STATIC_STUB(), which + * replacement function will be called by KUNIT_STATIC_STUB_REDIRECT(), which * will then return from the function. If the caller is not in a KUnit context, * the function will continue execution as normal. * @@ -87,7 +87,7 @@ void __kunit_activate_static_stub(struct kunit *test, * When activated, calls to real_fn_addr from within this test (even if called * indirectly) will instead call replacement_addr. The function pointed to by * real_fn_addr must begin with the static stub prologue in - * KUNIT_TRIGGER_STATIC_STUB() for this to work. real_fn_addr and + * KUNIT_STATIC_STUB_REDIRECT() for this to work. real_fn_addr and * replacement_addr must have the same type. * * The redirection can be disabled again with kunit_deactivate_static_stub().