More missing includes [1/4]
diff mbox series

Message ID Pine.GSO.4.21.0211182314490.16079-100000@vervain.sonytel.be
State New, archived
Headers show
Series
  • More missing includes [1/4]
Related show

Commit Message

Geert Uytterhoeven Nov. 18, 2002, 10:16 p.m. UTC
Add missing #include <linux/init.h>


Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

-
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/

Comments

Russell King Nov. 18, 2002, 11:17 p.m. UTC | #1
On Mon, Nov 18, 2002 at 11:16:04PM +0100, Geert Uytterhoeven wrote:
> 
> Add missing #include <linux/init.h>
> 
> --- linux-2.5.48/drivers/scsi/scsi.h	Mon Nov 18 10:03:40 2002
> +++ linux-m68k-2.5.48/drivers/scsi/scsi.h	Mon Nov 18 14:18:21 2002
> @@ -18,6 +18,7 @@
>  #include <linux/config.h>	/* for CONFIG_SCSI_LOGGING */
>  #include <linux/devfs_fs_kernel.h>
>  #include <linux/proc_fs.h>
> +#include <linux/init.h>
>  
>  /*
>   * Some of the public constants are being moved to this file.
> 

The more obvious solution is to remove the __initdata from the
declaration on line 545.  Such usage of __initdata (and __init)
serves no purpose.

--- orig/drivers/scsi/scsi.h	Mon Nov 18 09:52:15 2002
+++ linux/drivers/scsi/scsi.h	Mon Nov 18 15:25:42 2002
@@ -542,7 +542,7 @@
 	unsigned flags;
 };
 
-extern struct dev_info scsi_static_device_list[] __initdata;
+extern struct dev_info scsi_static_device_list[];
 
 /*
  * scsi_dev_info_list: structure to hold black/white listed devices.
Richard Henderson Nov. 19, 2002, 12:19 a.m. UTC | #2
On Mon, Nov 18, 2002 at 11:17:45PM +0000, Russell King wrote:
> The more obvious solution is to remove the __initdata from the
> declaration on line 545.  Such usage of __initdata (and __init)
> serves no purpose.

Yes it does.  If the variable is small, then the compiler may
expect the variable to be placed in the .sdata section, and so
be reachable by, say, a 16-bit gp-relative relocation.

Now, this variable in particular may not be small enough for
that, but the fact remains that the general rule should be that
variables should be declared with their section attributes.


r~
-
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/
Russell King Nov. 19, 2002, 12:23 a.m. UTC | #3
On Mon, Nov 18, 2002 at 04:19:47PM -0800, Richard Henderson wrote:
> On Mon, Nov 18, 2002 at 11:17:45PM +0000, Russell King wrote:
> > The more obvious solution is to remove the __initdata from the
> > declaration on line 545.  Such usage of __initdata (and __init)
> > serves no purpose.
> 
> Yes it does.  If the variable is small, then the compiler may
> expect the variable to be placed in the .sdata section, and so
> be reachable by, say, a 16-bit gp-relative relocation.
> 
> Now, this variable in particular may not be small enough for
> that, but the fact remains that the general rule should be that
> variables should be declared with their section attributes.

Sigh, which is contary to what Christoph told me.  Fine, have it your
own way.

Patch
diff mbox series

--- linux-2.5.48/drivers/scsi/scsi.h	Mon Nov 18 10:03:40 2002
+++ linux-m68k-2.5.48/drivers/scsi/scsi.h	Mon Nov 18 14:18:21 2002
@@ -18,6 +18,7 @@ 
 #include <linux/config.h>	/* for CONFIG_SCSI_LOGGING */
 #include <linux/devfs_fs_kernel.h>
 #include <linux/proc_fs.h>
+#include <linux/init.h>
 
 /*
  * Some of the public constants are being moved to this file.