Patch "printk: Let no_printk() use _printk()" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    printk: Let no_printk() use _printk()

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     printk-let-no_printk-use-_printk.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fb128a2c514cedca4700c5fcac2dee5d97adaaa8
Author: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Date:   Wed Feb 28 15:00:02 2024 +0100

    printk: Let no_printk() use _printk()
    
    [ Upstream commit 8522f6b760ca588928eede740d5d69dd1e936b49 ]
    
    When printk-indexing is enabled, each printk() invocation emits a
    pi_entry structure, containing the format string and other information
    related to its location in the kernel sources.  This is even true for
    no_printk(): while the actual code to print the message is optimized out
    by the compiler due to the always-false check, the pi_entry structure is
    still emitted.
    
    As the main purpose of no_printk() is to provide a helper to maintain
    printf()-style format checking when debugging is disabled, this leads to
    the inclusion in the index of lots of printk formats that cannot be
    emitted by the current kernel.
    
    Fix this by switching no_printk() from printk() to _printk().
    
    This reduces the size of an arm64 defconfig kernel with
    CONFIG_PRINTK_INDEX=y by 576 KiB.
    
    Fixes: 337015573718b161 ("printk: Userspace format indexing support")
    Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Reviewed-by: Xiubo Li <xiubli@xxxxxxxxxx>
    Reviewed-by: Chris Down <chris@xxxxxxxxxxxxxx>
    Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
    Link: https://lore.kernel.org/r/56cf92edccffea970e1f40a075334dd6cf5bb2a4.1709127473.git.geert+renesas@xxxxxxxxx
    Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/printk.h b/include/linux/printk.h
index 955e31860095e..2fde40cc96778 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -126,7 +126,7 @@ struct va_format {
 #define no_printk(fmt, ...)				\
 ({							\
 	if (0)						\
-		printk(fmt, ##__VA_ARGS__);		\
+		_printk(fmt, ##__VA_ARGS__);		\
 	0;						\
 })
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux