From nobody Fri Oct 10 21:13:59 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 0757F26529A; Thu, 12 Jun 2025 14:54:12 +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=1749740054; cv=none; b=Vfdl7nbXEGZQbbaApyHiRxES4UNVeXGBsqv0UBrvfFKLKg+FnPuOyo9xXniIK/WvdEkl2mbC3hYLJ7/8nuGSMuWvP3lFNMtrkJeTq0MnIEDffQMitF1/9HglqFtviBiaXTgEAjWf+0iIkctXUQmmEq19WLug5xOQKzbgawl01Ow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749740054; c=relaxed/simple; bh=hqwuCbuPfDirV9ezH9vFM/1xe2bdJIBXTWJNudHdkrI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ip/9t5gbQjiVdhD3nR1nemC06pk8IJ/TSN+RxzlZX1zbZc3ZQe1CMkhpPZNSOAJRr0cIqnrPjzvOJcCHiaj5DvdZHpnthwLECDRkRlNs6nPqmOt1PdYJV16fUKnEmGDMhec8kimXf3P4glVauYX5WpEIgESVBAEi6oJsDZ7gQfc= 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=lhQE1OOu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7nWQo8k0; 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="lhQE1OOu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7nWQo8k0" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1749740051; 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=py6GP2JAARXzekNYXmGRyd+LjknrMRVM5xplKdlwTXg=; b=lhQE1OOu7xPdVXqRsztqXAcNOkH6J4VOLtkkQnQnj47HL7ISsRq79C2S2WE6q4bK+gv4i/ Q81eKVVeRDAXUfnn2w44aV6xFQM0ZJwg6t5pSfxdYxtFCSAeOKWjxt+w0bwLl6fAtpm7Kr L6ShzrgRgMaVONc/02H3H3y9WMulqQF2IHGhKs2IoutFXIUFk5N72YVTAfxIpHZbCf0Gw9 URzINDyryQDN9QdiYwyByjAIA0UOP5T3fEsMJ2AOHU2efekKxVYnETh3tmImmt+gNPq0s1 mXvRVersMMYifBh57US8UwzqDAM5RBcZ0ArpcDfhdxTyfUnob4JFaNUDnLrZEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1749740051; 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=py6GP2JAARXzekNYXmGRyd+LjknrMRVM5xplKdlwTXg=; b=7nWQo8k0YEHZYPe9LDnktyWFcPpoUzxim+t5fDu49q+jH8AeNxOGhgh5cBQQEzFT85KEkL fzVJvmZkK9cHmMAw== Date: Thu, 12 Jun 2025 16:53:54 +0200 Subject: [PATCH 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: <20250612-kunit-ifdef-modules-v1-1-fdccd42dcff8@linutronix.de> References: <20250612-kunit-ifdef-modules-v1-0-fdccd42dcff8@linutronix.de> In-Reply-To: <20250612-kunit-ifdef-modules-v1-0-fdccd42dcff8@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=1749740050; l=1859; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=hqwuCbuPfDirV9ezH9vFM/1xe2bdJIBXTWJNudHdkrI=; b=vq6kGYwsNovqkaoVCfb6ybXwuUWWL9HOQUelrJQyfLZKvryFiI/VXgmJbeDgCGi5R/PEOoxqv Z0iM1Fv37PmAw8JiAUves8du/RkgyNmT/HEvBa1kfBs8wannUWGqnzv 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.49.0 From nobody Fri Oct 10 21:13:59 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 B946E26A1D9; Thu, 12 Jun 2025 14:54:13 +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=1749740055; cv=none; b=ObmLFvxTJtO4x8QuOKvIagBUHbpF6lyaUhyoVMKGK1+mv98OuntLqbofXD/McIecL8ryHLN31S9ytKn2uvwU6k4LBZhpNbS//7T35F0KRUJ1mL8VINxZWaau7krhBwgNYtyDnIwSQr7ZStDR//FY0Xecq8PYQjtl34CB5ET0rIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749740055; c=relaxed/simple; bh=niUiIhtws9P5qDIKT0S/3drsqD7/xl/LcWtmDLJi/NI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dDrHfX6ivDQbfhmJ3mbjlM31X0B+pOgRzYlTwC9lVsYv0lfDz+Jhe/7xdBgyC6LerDgneVw486ZkToB8V9fKcdYhWGZvGVF55YZw+D+JGZBwtZKO4SZCyhhMOHP/MoqmIUCi2dGIH7j9P9RQkH+1DwJYPRBkyizWc2gZ2KsZTKQ= 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=oy9ANiMI; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=R5UGhGr5; 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="oy9ANiMI"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="R5UGhGr5" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1749740052; 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=M24rIsRf5aigxupTSgbptaAyROm7Nd6+w9ly1F0mS5k=; b=oy9ANiMIG5veIDzL047etxRtm96pYq3QBFHxKZjwjV5sdBy2HVcMG1L3EJhTgFjOofL5zZ jsYY8t5y4fKuscZSMii2Fu3SqVP6rDXi/0zTcPDZoId9Y+ozNPZ3A5EX6N3d9c+MZhXDot JYr/wv0F+srKJu31upCW5nyS7ySo87+EYWl/TlSb8g5cBQwKfqb2FOz5XAhDC/aYn8OCSO mAtljeMECuFIQeumVUg8x/NrnZyt9UJhuunC8Xwqg2o5z7UPZXFKZmvHHu6ORdl0I2xE9q ctI0B/Rsf2p9f3ymCaDfPl7S51NG866qdgIT+xa4cqGDipywfcwt0gC3WVDGwQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1749740052; 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=M24rIsRf5aigxupTSgbptaAyROm7Nd6+w9ly1F0mS5k=; b=R5UGhGr59lmgZQvwCODHBySnzl8unM4TTBfCF3I3b5E/vb/k9qrhi4B862MdoEF4A1MvoP iHWTJiBI8XwARwDw== Date: Thu, 12 Jun 2025 16:53:55 +0200 Subject: [PATCH 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: <20250612-kunit-ifdef-modules-v1-2-fdccd42dcff8@linutronix.de> References: <20250612-kunit-ifdef-modules-v1-0-fdccd42dcff8@linutronix.de> In-Reply-To: <20250612-kunit-ifdef-modules-v1-0-fdccd42dcff8@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=1749740050; l=2463; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=niUiIhtws9P5qDIKT0S/3drsqD7/xl/LcWtmDLJi/NI=; b=mI8ymmHwWtFqx8BjRr2nnmxAs9BR0y5m8Eo8Ni11pCMju++icqXM4L3yfheyutVqS4Lxtwwwe pTtj8nGAEnMA7w0Vn5n5xELf7ZRmUEQd0+LXkJSvmWCYZ2Hv6ekcQfV 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 | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 52f7b0487a2733c56e2531a434887e56e1bf45b2..7f783e71636542b99db3dd869a9= 387d14992df45 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. */ @@ -598,6 +587,18 @@ struct module { struct _ddebug_info dyndbg_info; #endif } ____cacheline_aligned __randomize_layout; + +#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 MODULE_ARCH_INIT #define MODULE_ARCH_INIT {} #endif --=20 2.49.0 From nobody Fri Oct 10 21:13:59 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 6395227144E; Thu, 12 Jun 2025 14:54:14 +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=1749740056; cv=none; b=VqozNoTuzVUdX2rWRN34ghtmHOlQvQKcDAmYvxphZ+T9mYt0yhpgoUDXC5239I+qhSqDX9kSA0UR+bHzioFxoZ6h7bEZzpLMMDMEnrZb49FPLRCucAykgxH24pXXvMcZgruOsAoh7tAxJUHNOzsoPVxTtkXo7Pv7g26biQFNOuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749740056; c=relaxed/simple; bh=wyQyoFVIz9BNAQTEup4OQAAq6QCYbrbFSp/A4F/wb34=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hfLGVAvSqM3GK/FBxeLEAzrSi0voYmLGTcNbIolG29Cyx1UzTaDtUo2GiTkYFd8DLAbUERg5cYf0BiiNydPIvtVkR3XDZiYx/qtcJ9UXnjdS9B5AtrPx1AfkNRB6zWcqvePLc3ZcRWpgUK2hW0Y09t4XIW2B9iNfPlkt5tqbSFw= 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=gnawKIoi; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sqRGwTU/; 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="gnawKIoi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sqRGwTU/" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1749740052; 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=XOK9i9v6BbXwcr/v2FjrIUA6OPZXWQvQuwVmq69EkK0=; b=gnawKIoiwmwJeVsV8wsFarTqW0Qm/BPcxZl0rLbjeUwh9cYRYdAjdiv9idVbQHdGcUDmTk 6d7SYgHyDkJwmamVoeO1bEFTBWfdyusSSCZJk+iXCos7oKz4K6IiyNcDsG1m8JvGtNc6Es /sfNijqj4xegyT1ZTXy7ygcbdBixrbNsBc+24ZvmcnXwaTUDusQfXBudfb+1PtwvqigSlS g92oi1VRhTKHgyX6UarLaC7ieztKhX4kvG/qBjo/a8zGEKzqMpHXk2VxjfOOGWjJAm04a8 EDM26lFfnleD7PHiyqgLt9OJN/528+um39fncB6t5VsEhDkR2tXKlfdV7LBuDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1749740052; 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=XOK9i9v6BbXwcr/v2FjrIUA6OPZXWQvQuwVmq69EkK0=; b=sqRGwTU/00UaOrXhO1I0UX9W03zYXmPPOBIpQWRN9phMzBdzjqLD6M0GtI4J3BCNVK5fq2 1Wy3l5tdbxzyqyDQ== Date: Thu, 12 Jun 2025 16:53:56 +0200 Subject: [PATCH 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: <20250612-kunit-ifdef-modules-v1-3-fdccd42dcff8@linutronix.de> References: <20250612-kunit-ifdef-modules-v1-0-fdccd42dcff8@linutronix.de> In-Reply-To: <20250612-kunit-ifdef-modules-v1-0-fdccd42dcff8@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=1749740050; l=1571; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=wyQyoFVIz9BNAQTEup4OQAAq6QCYbrbFSp/A4F/wb34=; b=yrzQAGCyeN2NDV3FvRNsBSGrtj0yxPu0Ps2H4BamdaD79p/ifpI8CVNjq5fONgvs2MKpWCQej yUZxNK9bT5TBnWCBCkmPQKYu88T0LJZYof42i2sqmLjcu1Es9ob7Vml 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.49.0