From nobody Sat Feb 7 18:15:54 2026 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 AE1C2C001DE for ; Tue, 25 Jul 2023 08:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231968AbjGYIZ5 (ORCPT ); Tue, 25 Jul 2023 04:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjGYIZz (ORCPT ); Tue, 25 Jul 2023 04:25:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F414110C3 for ; Tue, 25 Jul 2023 01:25:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93202612CA for ; Tue, 25 Jul 2023 08:25:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E56CAC433C8; Tue, 25 Jul 2023 08:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690273553; bh=Iof1axqYShcjdJEBrXSEXTcXQvW68qKtfXewR3ze5aA=; h=From:To:Cc:Subject:Date:From; b=aS2106RDUiv81n+nUOxmB6E8asyvO3h2LfYIoo7EHM0nGqZY7t7bc6uphDFcDVTsN 3ozU3RWeD45SzJ3ke/lR0Pj28cinVYLbCrjZx8/CmQh37yCzN31p8jyyQIdwhY4tCH CRUHfotD0ZPiF0ZyXrPiTM2L6AxzyrZHHkdTGEjTXWt2/p1AYuccHwqrGZQoqPMspq x7UbkJW6zhk+XKNRr9pu335KO4u/MX4/JXAnAJ1DPv5cJqLrqoDATkO4z18ruSTO/S vk/vNTKUb1ntADS8pxj6oyysRQglKIG1LeIuFctluGuJBCxJMXDJYo94RH2wDTfFP7 M5zAVOA6vg+sw== From: Arnd Bergmann To: Luis Chamberlain Cc: Arnd Bergmann , Rong Tao , Petr Mladek , Masami Hiramatsu , Andrew Morton , Will Deacon , Quentin Perret , linux-kernel@vger.kernel.org Subject: [PATCH] samples/hw_breakpoint: fix building without module unloading Date: Tue, 25 Jul 2023 10:25:36 +0200 Message-Id: <20230725082546.941346-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann __symbol_put() is really meant as an internal helper and is not available when module unloading is disabled, unlike the previously used symbol_put(): samples/hw_breakpoint/data_breakpoint.c: In function 'hw_break_module_exit': samples/hw_breakpoint/data_breakpoint.c:73:9: error: implicit declaration o= f function '__symbol_put'; did you mean '__symbol_get'? [-Werror=3Dimplicit= -function-declaration] The hw_break_module_exit() function is not actually used when module unloading is disabled, but it still causes the build failure for an undefined identifier. Enclose this one call in an appropriate #ifdef to clarify what the requirement is. Leaving out the entire exit function would also work but feels less clar in this case. Fixes: 910e230d5f1bb ("samples/hw_breakpoint: Fix kernel BUG 'invalid opcod= e: 0000'") Fixes: d8a84d33a4954 ("samples/hw_breakpoint: drop use of kallsyms_lookup_n= ame()") Signed-off-by: Arnd Bergmann Reviewed-by: Petr Mladek --- samples/hw_breakpoint/data_breakpoint.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/hw_breakpoint/data_breakpoint.c b/samples/hw_breakpoin= t/data_breakpoint.c index 9debd128b2ab8..b99322f188e59 100644 --- a/samples/hw_breakpoint/data_breakpoint.c +++ b/samples/hw_breakpoint/data_breakpoint.c @@ -70,7 +70,9 @@ static int __init hw_break_module_init(void) static void __exit hw_break_module_exit(void) { unregister_wide_hw_breakpoint(sample_hbp); +#ifdef CONFIG_MODULE_UNLOAD __symbol_put(ksym_name); +#endif printk(KERN_INFO "HW Breakpoint for %s write uninstalled\n", ksym_name); } =20 --=20 2.39.2