From patchwork Wed Jan 14 22:56:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1513 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=1768431496; bh=xZkNmOh+Bsh1f+z62KjUAl1JtHieP3hdbnrSt871mXA=; 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=p2veal7DPsFHYvg08yu+5om4Gity2fgB6gMq+cpbsfJ37MqGNFsC8/4/tzFy06z50 7FV4XRAJrk2PvJjxli3d0Czc6OBIb/py/EOm+hxxVWfnCTcRS0pdcK0UOxRTanEG6O BNQZ+RFdkxQvq6fr0HRirob64LaLC37fpMeBV6gmd7ETkTL+HfMOVVP8tEHP3OeIqu Hymwhq/SeJZvxQfsbTd1trHZGKi3VCUQIqbupUcELGhFfy3c4RoHex4LsQorW2D3QK YUxONalzTX5URDuCSaeDm7UR3N6R0j4am8Qnhrm4tuLPaVFdcz0O4zBWPw3HL7LzDA UKCS+vTJOwmQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 23A4069368 for ; Wed, 14 Jan 2026 15:58:16 -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 cFd_pz1dCso9 for ; Wed, 14 Jan 2026 15:58:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431494; bh=xZkNmOh+Bsh1f+z62KjUAl1JtHieP3hdbnrSt871mXA=; 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=cnnO/IDyA0q5XGXG4Np0CCrumEh/3/ddyaUYW+c0Cczmc1vQapRFNjlzU1gMsoRSS IBES6Swp3/6sVKvT3UTbFrP7r0SHeEVa89VIp5nYD0Q8a25UtCVtvoFiIYOZrf5LRB 5tyaCOgS6fwQI5DPIdrwgfTWBzhUovKGvjR2k4xnG50pkkvvP1C8DWRWmCnnMbHB0U nukCYHzgHTR47xnodjJ4/1t/1c1VWxs35wacu5GUO0KQLCDcm+1zcvRzw+RezOa0VN 69PPrMNcJoblSQtoEC9uwn3VwSrrISlHLuBEyES9VNJ6hYfUBNAV1Fo212xOfJ85E2 /qlN9IE3BDdIg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 32A556934D for ; Wed, 14 Jan 2026 15:58:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431492; bh=iVtwIqYK+vJ0RiZMLJkpdUShY9QzILJf8E46JRd+4EA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p2zVJVrjzAH96egO24wcP/EZxeP0JfnfqiRZsqlA5XjoTrvEsPqKpVRxr0SWQkH/R 5pXFHSZr+84vueaWSAfAWb12GiWXNsBcs0toBApRerqe0GePOWUca/hF1CA5NXufqa PaWcfYw8UL754t1pyrgzfvI0kekwOv5N1FCQDcmQ0mewgpO+b2hL0QT2WImiBt52ox i1Vpx7mEkxd2DKB1sPrTaji1xW2U8mEFP9ijE3LCQPtDbjhlV144QsRooJQHWPnONr mpUbO1I4813bPbKABtbVPSSfx2UVcsA93XNWzYvTS4noX1KA6ffhD4r/GyMWpc512A smuIh1GXUDimA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 52666692E6; Wed, 14 Jan 2026 15:58:12 -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 36IxwmGzr7t8; Wed, 14 Jan 2026 15:58:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768431492; bh=i5MgDn+AJ7cIaYSJHgW+19HFAn7xfnbkhPB3xDIBMwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V27kmdP/KufnysCLeFFjvPoR5TKGBvld97+PfPvlQ7d5HkGOKyI1h9PnPX47VGGkH 5s5WdRXARJbkQjDEq0hIvoKREZTlv0XGnXslPJmIC/1HRYudG1z3G+gBcsRr7vhbYM LueydQJ1KX7tQkmvp4LS6nr9nrg0FqNoieaslCKIErxpt4QzXsISAy3EjnchEB46w5 z54qliz2CjLkv8prUyXVMenTMckjZ97HSoqXnVv4tJYhri+OQGv7JlJKvwuNUo1+fe /9+kWviI2KRbSW3+178v2LctPgMcKZsJJbPCMiY4pxJwdWFMkvPKqY5lFBHh8JJCUX 5TvyBlVNeHscA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BC2E8692EF; Wed, 14 Jan 2026 15:58:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 14 Jan 2026 15:56:09 -0700 Message-ID: <20260114225635.3407989-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114225635.3407989-1-sjg@u-boot.org> References: <20260114225635.3407989-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AGYFKFFF4FQVW2UPO6GBA4MNWBS222BZ X-Message-ID-Hash: AGYFKFFF4FQVW2UPO6GBA4MNWBS222BZ 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 19/34] ext4l: Move printk variants to linux/printk.h 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 The ext4l code defines pr_warn_once(), printk_ratelimited(), and pr_notice_ratelimited() locally instead of in the common printk header. Move these macros to linux/printk.h where they belong with the other printk macros. Also add additional _once and _ratelimited variants for consistency. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 8 +++----- include/linux/printk.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 253f09b73f9..1c58f64ba2f 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -936,7 +936,7 @@ struct dx_hash_info { /* BUILD_BUG_ON is in linux/build_bug.h */ /* WARN_ON, WARN_ON_ONCE, WARN_ONCE are in linux/bug.h */ -#define pr_warn_once(fmt, ...) do { } while (0) +/* pr_warn_once is in linux/printk.h */ /* lockdep stubs */ #define lockdep_assert_held_read(l) do { (void)(l); } while (0) @@ -2435,8 +2435,7 @@ struct folio_iter { /* xchg - exchange value atomically */ #define xchg(ptr, new) ({ typeof(*(ptr)) __old = *(ptr); *(ptr) = (new); __old; }) -/* printk_ratelimited - just use regular printk */ -#define printk_ratelimited(fmt, ...) do { } while (0) +/* printk_ratelimited is in linux/printk.h */ /* mapping_set_error - record error in address_space */ #define mapping_set_error(m, e) do { (void)(m); (void)(e); } while (0) @@ -2635,8 +2634,7 @@ int bh_read(struct buffer_head *bh, int flags); #define free_pages(addr, order) free((void *)(addr)) #define get_order(size) ilog2(roundup_pow_of_two((size) / PAGE_SIZE)) -/* Ratelimited printk for journal.c */ -#define pr_notice_ratelimited(fmt, ...) pr_notice(fmt, ##__VA_ARGS__) +/* pr_notice_ratelimited is in linux/printk.h */ /* * Stubs for mmp.c diff --git a/include/linux/printk.h b/include/linux/printk.h index 00452944c48..7c075ae9bca 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -84,6 +84,17 @@ #define printk_once(fmt, ...) \ printk(fmt, ##__VA_ARGS__) +/* _once variants - just call the base function (no actual once tracking) */ +#define pr_warn_once(fmt, ...) pr_warn(fmt, ##__VA_ARGS__) +#define pr_info_once(fmt, ...) pr_info(fmt, ##__VA_ARGS__) +#define pr_notice_once(fmt, ...) pr_notice(fmt, ##__VA_ARGS__) + +/* _ratelimited variants - just call the base function (no rate limiting) */ +#define printk_ratelimited(fmt, ...) printk(fmt, ##__VA_ARGS__) +#define pr_notice_ratelimited(fmt, ...) pr_notice(fmt, ##__VA_ARGS__) +#define pr_warn_ratelimited(fmt, ...) pr_warn(fmt, ##__VA_ARGS__) +#define pr_err_ratelimited(fmt, ...) pr_err(fmt, ##__VA_ARGS__) + struct va_format { const char *fmt; va_list *va;