Re: [PATCH] more __init in network drivers

From: Matthias Hanisch (matze@camline.com)
Date: Tue Jul 18 2000 - 03:19:26 EST


On Thu, 13 Jul 2000, Andrzej Krzysztofowicz wrote:

> diff -u --recursive linux-2.4test4-6/drivers/net/3c505.c linux/drivers/net/3c505.c
> --- linux-2.4test4-6/drivers/net/3c505.c Tue May 2 21:40:58 2000
> +++ linux/drivers/net/3c505.c Thu Jul 13 12:57:58 2000
> @@ -130,15 +130,16 @@
> #define INVALID_PCB_MSG(len) \
> printk(invalid_pcb_msg, (len),filename,__FUNCTION__,__LINE__)
>
> -static const char *search_msg = "%s: Looking for 3c505 adapter at address %#x...";
> +static const char *search_msg __initdata =
> + "%s: Looking for 3c505 adapter at address %#x...";
>
> -static const char *stilllooking_msg = "still looking...";
> +static const char *stilllooking_msg __initdata = "still looking...";
>
> -static const char *found_msg = "found.\n";
> +static const char *found_msg __initdata = "found.\n";
>
> -static const char *notfound_msg = "not found (reason = %d)\n";
> +static const char *notfound_msg __initdata = "not found (reason = %d)\n";
>
> -static const char *couldnot_msg = "%s: 3c505 not found\n";
> +static const char *couldnot_msg __initdata = "%s: 3c505 not found\n";

Just a short sidenote. If am not completely mistaken, these changes just
move the memory for the pointer (4 byte on intel) into the .init.data
section. You have to change it like this

-static char *text = "foo";
+static char text[] __initdata = "foo";

to move also the string itself into init section.

        Matze

-- 
Matthias Hanisch    mailto:matze@camline.com    phone: +49 8137 935-219

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



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:10 EST