From nobody Tue Oct 7 08:23:13 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 3DE6F2D77EB; Fri, 11 Jul 2025 13:31:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752240710; cv=none; b=a2v/OzxqGchVU+GA2QRDj+nPFNsbmzIUmFgtxI3vSCmenKwscvJ18ov2Q78ldJOB71TE0WAe/nBBgkqqY2/m74XIZwGdPrwhvyKMl8RK9UW3TsBC7B2B5bONOaVu6o35XY2mwQw1PdDj+LsZFSkGCEMcREl9fW70bSTYSp7PNUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752240710; c=relaxed/simple; bh=fz+VMXoPvVEeoVYCnv7IaR6grGXXdY88CzWfdfhiMQg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oD3rz4k9xhlk4xBMu6eyzeo1d51PYAU/IIGZeQPDvkr/xar0bOlnor7iguuaEIDk/nC944kYN5vv5/lwXqA9LPdrY24M3ST87R5xZyhawDq30TE4Nw5XVC+DW1QAzrNRBdoVIi5DK7ztCwtmJkzPdOXdjyBm+jQikk87ILjiU/A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tSqaL0dM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zqSgArGD; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tSqaL0dM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zqSgArGD" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752240701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qY6KbPjcfv5j/RTn7PjCFY4WtA7LMGhcLxijFU6bp3E=; b=tSqaL0dMrq6lsoaoqw7SCNIWz+8RBRWbOvFlSwDIWfy6o/Hd7OeFCf1Uaub/s2DZ58b1/P m+iQfBzUQlCWO9cJxb9esV+24igIMfYk2SfQgDw8fz+Prx7gZSaNMSVrerRXs4gmnX0DSX cIDCQlD4ZGMVFQr/Ndl7O7n5esC57TWUrqn91EiGzYHydzpjqi9QHuRyFGYNM4bYujvfZj uA23Hu4ap1dbHZHSAjjvG77rwH9vP8UDxnBtXI8yOUub5KFMe1CEQk9vamS8jDXv1nC/FD MMYpeE9R/nDlSafGIHTYRjslTAqi2noqldCymRD8x/dgMab5Y7mSbVMbFQOPKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752240701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qY6KbPjcfv5j/RTn7PjCFY4WtA7LMGhcLxijFU6bp3E=; b=zqSgArGDOGOzPRciLJBxk2gpdOMv4W5EwBVoSPismB9dMI+kzE9Ay0KQqlI7qolYhhobKf PC/EoZpUcWhSqiAg== Date: Fri, 11 Jul 2025 15:31:36 +0200 Subject: [PATCH v2 1/3] module: move 'struct module_use' to internal.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250711-kunit-ifdef-modules-v2-1-39443decb1f8@linutronix.de> References: <20250711-kunit-ifdef-modules-v2-0-39443decb1f8@linutronix.de> In-Reply-To: <20250711-kunit-ifdef-modules-v2-0-39443decb1f8@linutronix.de> To: Luis Chamberlain , Petr Pavlu , Sami Tolvanen , Daniel Gomez , Brendan Higgins , David Gow , Rae Moar Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1752240698; l=1956; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=fz+VMXoPvVEeoVYCnv7IaR6grGXXdY88CzWfdfhiMQg=; b=bMbDMeiJ6dkqWwg0KsST0PU3jMEIWcHi/FgZwzHLiif6steU0VulCQtf3x1kjF6e35NCadPtK 668EUZR3sjgBE9CxGC10O1jczK0rV5ffdbJrNHWfjyUZ/WGFyYYKPaz X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The struct was moved to the public header file in commit c8e21ced08b3 ("module: fix kdb's illicit use of struct module_use."). Back then the structure was used outside of the module core. Nowadays this is not true anymore, so the structure can be made internal. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Daniel Gomez Reviewed-by: Petr Pavlu --- include/linux/module.h | 7 ------- kernel/module/internal.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 92e1420fccdffc9de9f49da9061546cc1e0c89d1..52f7b0487a2733c56e2531a4348= 87e56e1bf45b2 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -313,13 +313,6 @@ void *__symbol_get_gpl(const char *symbol); __used __section(".no_trim_symbol") =3D __stringify(x); \ (typeof(&x))(__symbol_get(__stringify(x))); }) =20 -/* modules using other modules: kdb wants to see this. */ -struct module_use { - struct list_head source_list; - struct list_head target_list; - struct module *source, *target; -}; - enum module_state { MODULE_STATE_LIVE, /* Normal state. */ MODULE_STATE_COMING, /* Full formed, running module_init. */ diff --git a/kernel/module/internal.h b/kernel/module/internal.h index 8d74b0a21c82b5360977a29736eca78ee6b6be3e..1c2e0b0dc52e72d5ecd2f1b310c= e535364b3f33b 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -109,6 +109,13 @@ struct find_symbol_arg { enum mod_license license; }; =20 +/* modules using other modules */ +struct module_use { + struct list_head source_list; + struct list_head target_list; + struct module *source, *target; +}; + int mod_verify_sig(const void *mod, struct load_info *info); int try_to_force_load(struct module *mod, const char *reason); bool find_symbol(struct find_symbol_arg *fsa); --=20 2.50.0 From nobody Tue Oct 7 08:23:13 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 808612D8385; Fri, 11 Jul 2025 13:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752240711; cv=none; b=Y2CDIqrf2/VT3SwT9c0ghqW3F8URyt1+HaamIB3yg/EAB80MjQxkfjQldVZxwXiMfHkjy+i+4oeYQZZuF3JjOEAfbzRDO/0HzZT6lJjqcirgZRR4ZZARUxjJmJE9RBSHBuze/JG0JJfNaeEoguWFDH7mTzpBzQCKVeBBK6R3shI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752240711; c=relaxed/simple; bh=uyQVNtFYubQWqnDxz8kwDvaTLDSgf0EX5hdLciiSLgY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GgLA+WHQWfe5A3t0R3E0zo0HbwvNpwGfuWn0tKnydQDD41KVuGwTK96DFKp4gUIGD/7xmvA7P+T12mKCUY7AjP2wfq05ZxjFTemt1pEMMiFp7ZgwGB4HsC8GMnSX6yj7ho4TicqbWDS54HgS+OSWZFBrKnd7quVXasQ9VjF/+LM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YdaY3ujT; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8xiXc1fn; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YdaY3ujT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8xiXc1fn" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752240701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Btm723Tj3GSfpvyvzYy+PcO2md/tGoRn5TD3OxPHpsU=; b=YdaY3ujTe2EdXCWh1KPbR6S+yhC7CxtCq7v0mT31WoBpboSFB3tSPoGFq+xL09VLsyRNm0 2Pd0gWTsZaodKhwcjfw9c+j29hjwzMKqwVgIsq8MksGVC5fJQfhnXmYHdMSme4fuGL4GOV sAO98ml/cJWhdG6q7TUtVusGoaPn8jFIAH2JnaYPkx8PCrmIP05wOh2Zj7jbIvmVxubDSH I6f49PR3XyVTztEf+BCSQ/7Zlv42ruoBrHxSa9z+M/tJGmC3tlKXWeyC8jve/VaIfLYJeQ wHXc86zc+6b5lwEIe3V7m+3wdb3KD5dvjEk8irh160bp1TIIZuan36T+gWJ6eQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752240701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Btm723Tj3GSfpvyvzYy+PcO2md/tGoRn5TD3OxPHpsU=; b=8xiXc1fnbLnfJc5l/qLnjuBUMsPJ8ZRlrNgpvbfFKDAoaC4A4YIgUM7UZ4DTnEcjl9XeZf YnZMYlptbpVSrdBw== Date: Fri, 11 Jul 2025 15:31:37 +0200 Subject: [PATCH v2 2/3] module: make structure definitions always visible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250711-kunit-ifdef-modules-v2-2-39443decb1f8@linutronix.de> References: <20250711-kunit-ifdef-modules-v2-0-39443decb1f8@linutronix.de> In-Reply-To: <20250711-kunit-ifdef-modules-v2-0-39443decb1f8@linutronix.de> To: Luis Chamberlain , Petr Pavlu , Sami Tolvanen , Daniel Gomez , Brendan Higgins , David Gow , Rae Moar Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1752240698; l=2512; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=uyQVNtFYubQWqnDxz8kwDvaTLDSgf0EX5hdLciiSLgY=; b=lb+pts3Y3LJpQdZfpzs2v9mvidtFNqDyrDtmzD6zcdlj3ZqRRBaFhn6h6I/wLMh2mkMCZBVCq /3RmzO1fTe/B+K5cx3upAxr3tQvaZYdTUJ2NePubK6AXGRQ1XIlpEv8 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= To write code that works with both CONFIG_MODULES=3Dy and CONFIG_MODULES=3Dn it is convenient to use "if (IS_ENABLED(CONFIG_MODULES))" over raw #ifdef. The code will still fully typechecked but the unreachable parts are discarded by the compiler. This prevents accidental breakage when a certain kconfig combination was not specifically tested by the developer. This pattern is already supported to some extend by module.h defining empty stub functions if CONFIG_MODULES=3Dn. However some users of module.h work on the structured defined by module.h. Therefore these structure definitions need to be visible, too. Many structure members are still gated by specific configuration settings. The assumption for those is that the code using them will be gated behind the same configuration setting anyways. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Daniel Gomez --- include/linux/module.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 52f7b0487a2733c56e2531a434887e56e1bf45b2..2f330e60a7420a144abeed6d357= ac93c39a705e9 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -302,17 +302,6 @@ static typeof(name) __mod_device_table__##type##__##na= me \ =20 struct notifier_block; =20 -#ifdef CONFIG_MODULES - -extern int modules_disabled; /* for sysctl */ -/* Get/put a kernel symbol (calls must be symmetric) */ -void *__symbol_get(const char *symbol); -void *__symbol_get_gpl(const char *symbol); -#define symbol_get(x) ({ \ - static const char __notrim[] \ - __used __section(".no_trim_symbol") =3D __stringify(x); \ - (typeof(&x))(__symbol_get(__stringify(x))); }) - enum module_state { MODULE_STATE_LIVE, /* Normal state. */ MODULE_STATE_COMING, /* Full formed, running module_init. */ @@ -602,6 +591,17 @@ struct module { #define MODULE_ARCH_INIT {} #endif =20 +#ifdef CONFIG_MODULES + +extern int modules_disabled; /* for sysctl */ +/* Get/put a kernel symbol (calls must be symmetric) */ +void *__symbol_get(const char *symbol); +void *__symbol_get_gpl(const char *symbol); +#define symbol_get(x) ({ \ + static const char __notrim[] \ + __used __section(".no_trim_symbol") =3D __stringify(x); \ + (typeof(&x))(__symbol_get(__stringify(x))); }) + #ifndef HAVE_ARCH_KALLSYMS_SYMBOL_VALUE static inline unsigned long kallsyms_symbol_value(const Elf_Sym *sym) { --=20 2.50.0 From nobody Tue Oct 7 08:23:13 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 8EB192E4244; Fri, 11 Jul 2025 13:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752240712; cv=none; b=EkN3TvtiMRR6hhSC/i7MwdNKo8MEQijjJey/qIe165xgYii0Nfst4mjVkoZaiWB/6p00SYM9UTaBkWu1g92e/hFPb88vCB/LNMKjJ5f/gmcF7e/RkI7tMG2pQZ6O47gXCXxF0/er4U1Z/IS41l3Vc7IBMT27oN8Vc14k3gfjFXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752240712; c=relaxed/simple; bh=fsxqqU+GLFfZRByMUIDTR587S6mamorI8y49+UvR7Co=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f1weS7l+PZe9hCBO42QoCvW9xkIr+uTl7JcC2w/7UCTrrXN2ntFT9yQVc7TnoDTNc/nKSpA+eU8ZNI1KZeMMg5E7TLTP0acNG8MadMHv+wwS/BMv+J8BtZV3II8iODa9TDi6+wJ1+mVuC+IGU3Hmnx6pjZM96bc031rz6w+uJ84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PMidT7Do; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=AlepBclI; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PMidT7Do"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="AlepBclI" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752240702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G+3GmPUOZalI+XpNA7GfwdtSSuOK+L0NbsBb1GYhI/E=; b=PMidT7Doe6OV7izlRlc6I3t/EhZI9/wziv0NTgsjKnsG3pCJBqdtaNDF1m6JWt9Vu6J7iG KypOHQvZy7oLOXZr/sB0YIXStxwg5m4N13c9Wh9RLlBf0zTTHxSIMzjq8uiFg6w+uH869j NZhUvMnki0iPhJlhn/x+kFEq7u28//N2SB8VoGeGw2gSKI6viIcUqb0ZPxba9ZSLORE+xj OVqGXRKQSGxQTtt3lAL+4G3GskcdC4JbEf0aXySZrbe6o3Cx19X3s5chjnyElOs0FC9mfV x985COiZHLhACGN/MC97neFv/oBXXyuT1qaRbjn98Pken2vmv+r7vSwDuSXWVA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752240702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G+3GmPUOZalI+XpNA7GfwdtSSuOK+L0NbsBb1GYhI/E=; b=AlepBclIUbYNNnp/ev8B0H6onWObfDp4kkGH7fGwngwclXccuudBHm2+PIhL0jBZPD6XXM hGDvjwD6cqi4VdBw== Date: Fri, 11 Jul 2025 15:31:38 +0200 Subject: [PATCH v2 3/3] kunit: test: Drop CONFIG_MODULE ifdeffery Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250711-kunit-ifdef-modules-v2-3-39443decb1f8@linutronix.de> References: <20250711-kunit-ifdef-modules-v2-0-39443decb1f8@linutronix.de> In-Reply-To: <20250711-kunit-ifdef-modules-v2-0-39443decb1f8@linutronix.de> To: Luis Chamberlain , Petr Pavlu , Sami Tolvanen , Daniel Gomez , Brendan Higgins , David Gow , Rae Moar Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1752240698; l=1664; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=fsxqqU+GLFfZRByMUIDTR587S6mamorI8y49+UvR7Co=; b=dPp4lDVDZrzsIt8xJPMdVqN3cVGDPoE7LnfmjqbH/+YD05b9u4sCuAEalOBqwcy1eqPxeqCOE 7LXfN8QtuATCqN/5yc6VNFzsmswVmShH2nno6AfBGE0yHRW77e/5D8h X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The function stubs exposed by module.h allow the code to compile properly without the ifdeffery. The generated object code stays the same, as the compiler can optimize away all the dead code. As the code is still typechecked developer errors can be detected faster. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: David Gow Reviewed-by: Daniel Gomez --- lib/kunit/test.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/kunit/test.c b/lib/kunit/test.c index 146d1b48a0965e8aaddb6162928f408bbb542645..019b2ac9c8469021542b610278f= 8842e100d57ad 100644 --- a/lib/kunit/test.c +++ b/lib/kunit/test.c @@ -759,7 +759,6 @@ void __kunit_test_suites_exit(struct kunit_suite **suit= es, int num_suites) } EXPORT_SYMBOL_GPL(__kunit_test_suites_exit); =20 -#ifdef CONFIG_MODULES static void kunit_module_init(struct module *mod) { struct kunit_suite_set suite_set, filtered_set; @@ -847,7 +846,6 @@ static struct notifier_block kunit_mod_nb =3D { .notifier_call =3D kunit_module_notify, .priority =3D 0, }; -#endif =20 KUNIT_DEFINE_ACTION_WRAPPER(kfree_action_wrapper, kfree, const void *) =20 @@ -938,20 +936,14 @@ static int __init kunit_init(void) kunit_debugfs_init(); =20 kunit_bus_init(); -#ifdef CONFIG_MODULES return register_module_notifier(&kunit_mod_nb); -#else - return 0; -#endif } late_initcall(kunit_init); =20 static void __exit kunit_exit(void) { memset(&kunit_hooks, 0, sizeof(kunit_hooks)); -#ifdef CONFIG_MODULES unregister_module_notifier(&kunit_mod_nb); -#endif =20 kunit_bus_shutdown(); =20 --=20 2.50.0