From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] include: rename printk.h to printf.h
Date: Mon, 6 Jan 2025 10:19:05 +0100 [thread overview]
Message-ID: <20250106091906.3435166-1-a.fatoum@pengutronix.de> (raw)
We also have <linux/printk.h>, which defines the pr_* and dev_* family
of Linux logging functions. printk.h only defines the base printing
functions as well as the printk macro, which expands to printf.
To make it clearer, which is which, rename printk.h to printf.h.
No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/cpu/mmu-common.h | 2 +-
arch/arm/mach-imx/bootrom-cmd.c | 2 +-
arch/riscv/lib/stacktrace.c | 2 +-
include/asm-generic/bug.h | 2 +-
include/firmware.h | 2 +-
include/linux/barebox-wrapper.h | 2 +-
include/linux/printk.h | 2 +-
include/printk.h | 63 -------------------------------
include/stdio.h | 2 +-
include/tlsf.h | 2 +-
scripts/include/asm-generic/bug.h | 2 +-
test/self/idr.c | 2 +-
12 files changed, 11 insertions(+), 74 deletions(-)
delete mode 100644 include/printk.h
diff --git a/arch/arm/cpu/mmu-common.h b/arch/arm/cpu/mmu-common.h
index ec24f5c89f2b..d0b50662570a 100644
--- a/arch/arm/cpu/mmu-common.h
+++ b/arch/arm/cpu/mmu-common.h
@@ -3,7 +3,7 @@
#ifndef __ARM_MMU_COMMON_H
#define __ARM_MMU_COMMON_H
-#include <printk.h>
+#include <printf.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
diff --git a/arch/arm/mach-imx/bootrom-cmd.c b/arch/arm/mach-imx/bootrom-cmd.c
index 76455db301fe..afdf1302254b 100644
--- a/arch/arm/mach-imx/bootrom-cmd.c
+++ b/arch/arm/mach-imx/bootrom-cmd.c
@@ -3,7 +3,7 @@
#include <command.h>
#include <errno.h>
#include <getopt.h>
-#include <printk.h>
+#include <printf.h>
#include <linux/bitops.h>
#include <linux/bitfield.h>
#include <mach/imx/imx8m-regs.h>
diff --git a/arch/riscv/lib/stacktrace.c b/arch/riscv/lib/stacktrace.c
index b678ad7d5241..7cf102a06fe0 100644
--- a/arch/riscv/lib/stacktrace.c
+++ b/arch/riscv/lib/stacktrace.c
@@ -8,7 +8,7 @@
*/
#include <linux/kernel.h>
-#include <printk.h>
+#include <printf.h>
#include <asm/unwind.h>
#include <asm/ptrace.h>
#include <asm-generic/memory_layout.h>
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 0277527491cf..389327adfc5d 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -4,7 +4,7 @@
#define _ASM_GENERIC_BUG_H
#include <linux/compiler.h>
-#include <printk.h>
+#include <printf.h>
#define BUG() do { \
printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
diff --git a/include/firmware.h b/include/firmware.h
index 361ff2f8ae52..d7feae13719b 100644
--- a/include/firmware.h
+++ b/include/firmware.h
@@ -7,7 +7,7 @@
#define FIRMWARE_H
#include <pbl.h>
-#include <printk.h>
+#include <printf.h>
#include <types.h>
#include <driver.h>
#include <debug_ll.h>
diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h
index 8320a24b7bc1..7f584662f33a 100644
--- a/include/linux/barebox-wrapper.h
+++ b/include/linux/barebox-wrapper.h
@@ -5,7 +5,7 @@
#include <xfuncs.h>
#include <linux/slab.h>
#include <linux/module.h>
-#include <printk.h>
+#include <printf.h>
#define vmalloc(len) malloc(len)
#define __vmalloc(len, mode, pgsz) malloc(len)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 9fdf97507483..469ca879c7fd 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -4,7 +4,7 @@
#include <linux/list.h>
#include <linux/err.h>
-#include <printk.h>
+#include <printf.h>
#include <stdarg.h>
#define MSG_EMERG 0 /* system is unusable */
diff --git a/include/printk.h b/include/printk.h
deleted file mode 100644
index d0e56e1994a2..000000000000
--- a/include/printk.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __PRINTK_H
-#define __PRINTK_H
-
-#include <linux/types.h>
-
-struct device;
-
-#define KERN_EMERG "" /* system is unusable */
-#define KERN_ALERT "" /* action must be taken immediately */
-#define KERN_CRIT "" /* critical conditions */
-#define KERN_ERR "" /* error conditions */
-#define KERN_WARNING "" /* warning conditions */
-#define KERN_NOTICE "" /* normal but significant condition */
-#define KERN_INFO "" /* informational */
-#define KERN_DEBUG "" /* debug-level messages */
-#define KERN_CONT ""
-
-#if (IN_PROPER && !defined(CONFIG_CONSOLE_NONE)) || \
- (IN_PBL && defined(CONFIG_PBL_CONSOLE))
-int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
-#else
-static int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2)));
-static inline int printf(const char *fmt, ...)
-{
- return 0;
-}
-#endif
-
-void __attribute__((noreturn)) panic(const char *fmt, ...);
-void __attribute__((noreturn)) panic_no_stacktrace(const char *fmt, ...);
-
-#define printk printf
-
-enum {
- DUMP_PREFIX_NONE,
- DUMP_PREFIX_ADDRESS,
- DUMP_PREFIX_OFFSET
-};
-extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
- int groupsize, char *linebuf, size_t linebuflen,
- bool ascii);
-extern void dev_print_hex_dump(struct device *dev, const char *level,
- const char *prefix_str, int prefix_type,
- int rowsize, int groupsize, const void *buf,
- size_t len, bool ascii);
-
-#define print_hex_dump(level, prefix_str, prefix_type, rowsize, \
- groupsize, buf, len, ascii) \
- dev_print_hex_dump(NULL, level, prefix_str, prefix_type, rowsize, \
- groupsize, buf, len, ascii)
-
-#ifdef CONFIG_ARCH_HAS_STACK_DUMP
-void dump_stack(void);
-#else
-static inline void dump_stack(void)
-{
- printf("no stack data available\n");
-}
-#endif
-
-
-#endif
diff --git a/include/stdio.h b/include/stdio.h
index 883b06529fdc..c02d383d6bad 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -4,7 +4,7 @@
#include <stdarg.h>
#include <console.h>
-#include <printk.h>
+#include <printf.h>
/*
* STDIO based functions (can always be used)
diff --git a/include/tlsf.h b/include/tlsf.h
index 2f82d0fa005b..e0dcdac1e7ab 100644
--- a/include/tlsf.h
+++ b/include/tlsf.h
@@ -42,7 +42,7 @@
extern "C" {
#endif
-#include <printk.h>
+#include <printf.h>
#include <linux/bug.h>
#define tlsf_assert(expr) do { \
diff --git a/scripts/include/asm-generic/bug.h b/scripts/include/asm-generic/bug.h
index c53ced628fcc..6847fc82801e 100644
--- a/scripts/include/asm-generic/bug.h
+++ b/scripts/include/asm-generic/bug.h
@@ -3,7 +3,7 @@
#ifndef _ASM_GENERIC_BUG_H
#define _ASM_GENERIC_BUG_H
-#include <printk.h>
+#include <printf.h>
#include <stdlib.h>
#define BUG() do { \
diff --git a/test/self/idr.c b/test/self/idr.c
index 3d23141e0f03..bb902b041bb4 100644
--- a/test/self/idr.c
+++ b/test/self/idr.c
@@ -2,7 +2,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <printk.h>
+#include <printf.h>
#include <linux/idr.h>
#include <bselftest.h>
--
2.39.5
next reply other threads:[~2025-01-06 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-06 9:19 Ahmad Fatoum [this message]
2025-01-06 9:19 ` [PATCH 2/2] vsprintf: document %JP format specifier as being barebox-specific Ahmad Fatoum
2025-01-06 13:21 ` [PATCH 1/2] include: rename printk.h to printf.h Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250106091906.3435166-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox