From patchwork Tue Dec 16 21:18:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 922 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919932; bh=YkKKbl11QTw24bmJzTS/QpTr7f0pPhN+k51OjcZdUyI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=FmNqkVTp8vxSSY0GAP4wLyv7ANZBCI4mIrFORA9f6xf7PV7Z1y+WCR+l+g90Whxu9 YPMZ8lmx4lO+VpMTOgwnfk5ub8Eww+u6JwFsJr6GyReDUblg715/hDcManHHQbwArO /hmyMiaiJmg3Frn1iUipGm98jHkhaIYoQDJ8u7Pxv6l9fRLPSmZwUOytAMWQ7Wx7SB KacIsfg0kKkUJ1Gr1dMcgrdpkHJcyJtptZx4OS/yTO6CAJw3SDXu1Tz+XASaaMADdO AIvV5VRte52P1b5evzx1tM++Hoj0zCNLFIaqMPxQchu+/fdI8VlUjSYo8B0147g76/ 6RVP7iHRDXK2g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 41211689CD for ; Tue, 16 Dec 2025 14:18:52 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xXObU9crGHdM for ; Tue, 16 Dec 2025 14:18:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919931; bh=YkKKbl11QTw24bmJzTS/QpTr7f0pPhN+k51OjcZdUyI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=r+YkMamVUuOuhKiPhH3Ro5Dlc2oZg2mAFekpBbGHJhYmtaogiuI/pEsA5GPYSn55f aBQbkrkClfWC7ny/pY9Wm6qU9eZsmaDFTO0j0eBvhFunEy+fvqpbfgH8/ncQRHyIdC zUrCwHwLD1KRhWsG1R0me+DyzR/pAu2EPq+jmPdcNkVTBkIEL1jZonoMLTzGJ6NDv5 lJhkHBliD6Dmm6Y8tTDz+UWI4QVHheaML7FZzBWfbxILIDZ1lIWArwbatQcJg77RPB X1FUlOTjJFy5IGzJ4DbYbEGKARokfn4dpCrmG2aSrGcEjtDdSNuVfo2VFoB8hYIL5a xIL8oIRZi5CxQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8FED968B8F for ; Tue, 16 Dec 2025 14:18:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919929; bh=aR32CYBuBb015ngkGmqDwICO4K6SN1JK32/AvuIcdf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XMuhgdBrfmSGvCtpAgNsoeDPRp1yX3DZczJNWG79HLU7aD7+iyUxfuMRBaDbEIfcf CE1n8NLMCkd20cLI3ffO16nF5klYSJjv1WO2Y+Ez9Up6+VSH+NAxXtJdNKFoYj4r1Y Q6m5Q79yzU4oTPlSOcFYyRpPOmTEMJXmQq2udyeyeT0PsE9DNJGK1nERIdU331HWrT KGAZXFaiJSphLa3HK5XsVHc/motZ1yUnQbbiQrS8rbVjEolDHLt9GxCh6tUfrZK/fH SlVOx/RQsX5fqAavlj/To1/raoNbJLQ7c+tZgLFmT5AHZdGIYNqaE938+Bga7rO+ar hHMWVxESms/vA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BD455689CD; Tue, 16 Dec 2025 14:18:49 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Yans3mV9-nir; Tue, 16 Dec 2025 14:18:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765919925; bh=zt0v1NOztMH3pAZrMMkBHKWxGHWbzgUOIZlbPsvoQ1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UuuS+97kmYCUOqpFRVimqdJbgKeeTPEnPwj0seuD6t4tIRbKZTaXhves5jN+E20MJ CF8345XyjKVCneM9D+j0c0OMxAadahTmd3CfignAzDxNjAgcHc/I1ZcbXB1NdJB8Bx wB3GBY0PmEEUPsRUffZWf9blAAsp2ZlJ5rDsQxt/FGO10xKaZ14yImo7acNpULn1gy Lg8F9mDTtzHIJAuTOMac6W7uoswEBFhQ3ZCJ3Ttx5Wwf4H2cvw390qfpe8DtyTYrqG f5fwWmbXmWaglvcBZQW9S/+JvsupQRY4zj19XMYcSer9t0F5Qqk/6ASgqAbess1Z50 00+ybniwbhiTA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 76C2568B84; Tue, 16 Dec 2025 14:18:45 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 16 Dec 2025 14:18:08 -0700 Message-ID: <20251216211817.4131167-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251216211817.4131167-1-sjg@u-boot.org> References: <20251216211817.4131167-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: N3QL7BDEB4QBA6DHQIS3Q4VXXEWEHMWC X-Message-ID-Hash: N3QL7BDEB4QBA6DHQIS3Q4VXXEWEHMWC X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/11] ext4l: Extract module declarations into their own file List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Create include/linux/module.h with stub definitions for kernel module support. U-Boot doesn't use loadable modules, so these are no-ops. Includes: - THIS_MODULE, try_module_get(), module_put() - module_init(), module_exit() - module_param() and variants - MODULE_* macros (LICENSE, AUTHOR, DESCRIPTION, etc.) Update compat.h to include module.h and remove duplicate definitions. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- include/linux/compat.h | 16 +--------------- include/linux/module.h | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 include/linux/module.h diff --git a/include/linux/compat.h b/include/linux/compat.h index 28207fb96b8..3bba18d637d 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -126,21 +127,6 @@ typedef unsigned long sector_t; typedef unsigned long blkcnt_t; #endif -/* module */ -#define THIS_MODULE 0 -#define try_module_get(...) 1 -#define module_put(...) do { } while (0) -#define module_init(...) -#define module_exit(...) -#define module_param(...) -#define module_param_call(...) -#define MODULE_PARM_DESC(...) -#define MODULE_VERSION(...) -#define MODULE_DESCRIPTION(...) -#define MODULE_AUTHOR(...) -#define MODULE_LICENSE(...) -#define MODULE_ALIAS(...) -#define __module_get(...) /* character device */ #define MKDEV(...) 0 diff --git a/include/linux/module.h b/include/linux/module.h new file mode 100644 index 00000000000..ba226652144 --- /dev/null +++ b/include/linux/module.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Dynamic loading of modules into the kernel. + * + * Rewritten by Richard Henderson Dec 1996 + * Rewritten again by Rusty Russell, 2002 + * + * Stub definitions for Linux kernel module support. + * U-Boot doesn't use loadable modules. + */ +#ifndef _LINUX_MODULE_H +#define _LINUX_MODULE_H + +struct module; + +#define THIS_MODULE ((struct module *)0) +#define try_module_get(...) 1 +#define module_put(...) do { } while (0) +#define __module_get(...) do { } while (0) + +#define module_init(fn) +#define module_exit(fn) + +#define module_param(name, type, perm) +#define module_param_call(name, set, get, arg, perm) +#define module_param_named(name, var, type, perm) + +#define MODULE_PARM_DESC(name, desc) +#define MODULE_VERSION(ver) +#define MODULE_DESCRIPTION(desc) +#define MODULE_AUTHOR(author) +#define MODULE_LICENSE(license) +#define MODULE_ALIAS(alias) +#define MODULE_SOFTDEP(dep) +#define MODULE_INFO(tag, info) + +#endif /* _LINUX_MODULE_H */