* [PATCH] char: mem: fix typo and use pr_err() for logging
@ 2026-01-02 6:27 Minu Jin
2026-01-16 15:28 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Minu Jin @ 2026-01-02 6:27 UTC (permalink / raw)
To: arnd, gregkh; +Cc: linux-kernel, Minu Jin
Fix a typo in the comment of read_mem(): funcion -> function
Replace a raw printk() call in chr_dev_init() with pr_err().
The original call lacked a log level, which is discouraged.
Using pr_err() ensures the error is properly categorized and
follows modern logging practices.
Signed-off-by: Minu Jin <s9430939@naver.com>
---
drivers/char/mem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 52039fae1594..4c6bb10d1508 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -76,7 +76,7 @@ static inline bool should_stop_iteration(void)
}
/*
- * This funcion reads the *physical* memory. The f_pos points directly to the
+ * This function reads the *physical* memory. The f_pos points directly to the
* memory location.
*/
static ssize_t read_mem(struct file *file, char __user *buf,
@@ -765,7 +765,7 @@ static int __init chr_dev_init(void)
int minor;
if (register_chrdev(MEM_MAJOR, "mem", &memory_fops))
- printk("unable to get major %d for memory devs\n", MEM_MAJOR);
+ pr_err("unable to get major %d for memory devs\n", MEM_MAJOR);
retval = class_register(&mem_class);
if (retval)
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] char: mem: fix typo and use pr_err() for logging
2026-01-02 6:27 [PATCH] char: mem: fix typo and use pr_err() for logging Minu Jin
@ 2026-01-16 15:28 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-01-16 15:28 UTC (permalink / raw)
To: Minu Jin; +Cc: arnd, linux-kernel
On Fri, Jan 02, 2026 at 03:27:59PM +0900, Minu Jin wrote:
> Fix a typo in the comment of read_mem(): funcion -> function
>
> Replace a raw printk() call in chr_dev_init() with pr_err().
> The original call lacked a log level, which is discouraged.
>
> Using pr_err() ensures the error is properly categorized and
> follows modern logging practices.
This is two different things, it should be 2 different patches (yes, I'm
being pedantic, sorry, that's because:)
> if (register_chrdev(MEM_MAJOR, "mem", &memory_fops))
> - printk("unable to get major %d for memory devs\n", MEM_MAJOR);
> + pr_err("unable to get major %d for memory devs\n", MEM_MAJOR);
This change doesn't really do anything different, so it's not needed.
Let's leave it alone as it's been this way for decades.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-16 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-02 6:27 [PATCH] char: mem: fix typo and use pr_err() for logging Minu Jin
2026-01-16 15:28 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®