Commit ae52bb2384f721562f15f719de1acb8e934733cb

Authored by Geert Uytterhoeven
Committed by Linus Torvalds
1 parent a53c9d5b71

fbdev: move logo externs to header file

Now we have __initconst, we can finally move the external declarations for
the various Linux logo structures to <linux/linux_logo.h>.

James' ack dates back to the previous submission (way to long ago), when the
logos were still __initdata, which caused failures on some platforms with some
toolchain versions.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 7 changed files with 28 additions and 39 deletions Side-by-side Diff

arch/powerpc/kernel/prom_init.c
... ... @@ -44,10 +44,7 @@
44 44 #include <asm/sections.h>
45 45 #include <asm/machdep.h>
46 46  
47   -#ifdef CONFIG_LOGO_LINUX_CLUT224
48 47 #include <linux/linux_logo.h>
49   -extern const struct linux_logo logo_linux_clut224;
50   -#endif
51 48  
52 49 /*
53 50 * Properties whose value is longer than this get excluded from our
arch/powerpc/platforms/cell/spu_base.c
... ... @@ -752,17 +752,8 @@
752 752 goto out_unregister_sysdev_class;
753 753 }
754 754  
755   - if (ret > 0) {
756   - /*
757   - * We cannot put the forward declaration in
758   - * <linux/linux_logo.h> because of conflicting session type
759   - * conflicts for const and __initdata with different compiler
760   - * versions
761   - */
762   - extern const struct linux_logo logo_spe_clut224;
763   -
  755 + if (ret > 0)
764 756 fb_append_extra_logo(&logo_spe_clut224, ret);
765   - }
766 757  
767 758 mutex_lock(&spu_full_list_mutex);
768 759 xmon_register_spus(&spu_full_list);
arch/um/include/shared/init.h
... ... @@ -27,7 +27,7 @@
27 27 * sign followed by value, e.g.:
28 28 *
29 29 * static int init_variable __initdata = 0;
30   - * static char linux_logo[] __initdata = { 0x32, 0x36, ... };
  30 + * static const char linux_logo[] __initconst = { 0x32, 0x36, ... };
31 31 *
32 32 * Don't forget to initialize data not at file scope, i.e. within a function,
33 33 * as gcc otherwise puts the data into the bss section and not into the init
drivers/video/logo/logo.c
... ... @@ -21,21 +21,6 @@
21 21 #include <asm/bootinfo.h>
22 22 #endif
23 23  
24   -extern const struct linux_logo logo_linux_mono;
25   -extern const struct linux_logo logo_linux_vga16;
26   -extern const struct linux_logo logo_linux_clut224;
27   -extern const struct linux_logo logo_blackfin_vga16;
28   -extern const struct linux_logo logo_blackfin_clut224;
29   -extern const struct linux_logo logo_dec_clut224;
30   -extern const struct linux_logo logo_mac_clut224;
31   -extern const struct linux_logo logo_parisc_clut224;
32   -extern const struct linux_logo logo_sgi_clut224;
33   -extern const struct linux_logo logo_sun_clut224;
34   -extern const struct linux_logo logo_superh_mono;
35   -extern const struct linux_logo logo_superh_vga16;
36   -extern const struct linux_logo logo_superh_clut224;
37   -extern const struct linux_logo logo_m32r_clut224;
38   -
39 24 static int nologo;
40 25 module_param(nologo, bool, 0);
41 26 MODULE_PARM_DESC(nologo, "Disables startup logo");
include/linux/init.h
... ... @@ -29,7 +29,7 @@
29 29 * sign followed by value, e.g.:
30 30 *
31 31 * static int init_variable __initdata = 0;
32   - * static char linux_logo[] __initdata = { 0x32, 0x36, ... };
  32 + * static const char linux_logo[] __initconst = { 0x32, 0x36, ... };
33 33 *
34 34 * Don't forget to initialize data not at file scope, i.e. within a function,
35 35 * as gcc otherwise puts the data into the bss section and not into the init
include/linux/linux_logo.h
... ... @@ -32,6 +32,22 @@
32 32 const unsigned char *data;
33 33 };
34 34  
  35 +extern const struct linux_logo logo_linux_mono;
  36 +extern const struct linux_logo logo_linux_vga16;
  37 +extern const struct linux_logo logo_linux_clut224;
  38 +extern const struct linux_logo logo_blackfin_vga16;
  39 +extern const struct linux_logo logo_blackfin_clut224;
  40 +extern const struct linux_logo logo_dec_clut224;
  41 +extern const struct linux_logo logo_mac_clut224;
  42 +extern const struct linux_logo logo_parisc_clut224;
  43 +extern const struct linux_logo logo_sgi_clut224;
  44 +extern const struct linux_logo logo_sun_clut224;
  45 +extern const struct linux_logo logo_superh_mono;
  46 +extern const struct linux_logo logo_superh_vga16;
  47 +extern const struct linux_logo logo_superh_clut224;
  48 +extern const struct linux_logo logo_m32r_clut224;
  49 +extern const struct linux_logo logo_spe_clut224;
  50 +
35 51 extern const struct linux_logo *fb_find_logo(int depth);
36 52 #ifdef CONFIG_FB_LOGO_EXTRA
37 53 extern void fb_append_extra_logo(const struct linux_logo *logo,
... ... @@ -237,22 +237,22 @@
237 237 fprintf(out, " * Linux logo %s\n", logoname);
238 238 fputs(" */\n\n", out);
239 239 fputs("#include <linux/linux_logo.h>\n\n", out);
240   - fprintf(out, "static unsigned char %s_data[] __initdata = {\n",
  240 + fprintf(out, "static const unsigned char %s_data[] __initconst = {\n",
241 241 logoname);
242 242 }
243 243  
244 244 static void write_footer(void)
245 245 {
246 246 fputs("\n};\n\n", out);
247   - fprintf(out, "struct linux_logo %s __initdata = {\n", logoname);
248   - fprintf(out, " .type\t= %s,\n", logo_types[logo_type]);
249   - fprintf(out, " .width\t= %d,\n", logo_width);
250   - fprintf(out, " .height\t= %d,\n", logo_height);
  247 + fprintf(out, "const struct linux_logo %s __initconst = {\n", logoname);
  248 + fprintf(out, "\t.type\t\t= %s,\n", logo_types[logo_type]);
  249 + fprintf(out, "\t.width\t\t= %d,\n", logo_width);
  250 + fprintf(out, "\t.height\t\t= %d,\n", logo_height);
251 251 if (logo_type == LINUX_LOGO_CLUT224) {
252   - fprintf(out, " .clutsize\t= %d,\n", logo_clutsize);
253   - fprintf(out, " .clut\t= %s_clut,\n", logoname);
  252 + fprintf(out, "\t.clutsize\t= %d,\n", logo_clutsize);
  253 + fprintf(out, "\t.clut\t\t= %s_clut,\n", logoname);
254 254 }
255   - fprintf(out, " .data\t= %s_data\n", logoname);
  255 + fprintf(out, "\t.data\t\t= %s_data\n", logoname);
256 256 fputs("};\n\n", out);
257 257  
258 258 /* close logo file */
... ... @@ -374,7 +374,7 @@
374 374 fputs("\n};\n\n", out);
375 375  
376 376 /* write logo clut */
377   - fprintf(out, "static unsigned char %s_clut[] __initdata = {\n",
  377 + fprintf(out, "static const unsigned char %s_clut[] __initconst = {\n",
378 378 logoname);
379 379 write_hex_cnt = 0;
380 380 for (i = 0; i < logo_clutsize; i++) {