[PATCH] small addition to <linux/init.h>

From: pazke@orbita1.ru
Date: Mon May 14 2001 - 07:21:18 EST


Hi all,

please take a quick look at attached patch (IMHO it can be usefull :)

The code below is a common code pattern in Linux kernel:

static int __init foo(void)
{
        . . .
        printk("%s: blah blah blah\n", bar);
        . . .
}

this is bad because "blah blah blah\n" goes to .rodata section and plagues
the memory. With this small patch it's possibe to rewrite this fragment as:

static int __init foo(void)
{
        . . .
        printk(__init_msg("%s: blah blah blah\n"), bar);
        . . .
}

and thus "blah blah blah\n" goes to .data.init and then to bitbucket.
IMHO it can save some extra memory for us.

Best regadrs.

-- 
Andrey Panin            | Embedded systems software engineer
pazke@orbita1.ru        | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc



- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 15 2001 - 21:00:35 EST