Skip to content

Commit

Permalink
fbdev: move logo externs to header file
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: James Simmons <[email protected]>
Cc: Krzysztof Helt <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Geert Uytterhoeven authored and torvalds committed Jun 17, 2009
1 parent a53c9d5 commit ae52bb2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 39 deletions.
3 changes: 0 additions & 3 deletions arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@
#include <asm/sections.h>
#include <asm/machdep.h>

#ifdef CONFIG_LOGO_LINUX_CLUT224
#include <linux/linux_logo.h>
extern const struct linux_logo logo_linux_clut224;
#endif

/*
* Properties whose value is longer than this get excluded from our
Expand Down
11 changes: 1 addition & 10 deletions arch/powerpc/platforms/cell/spu_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,17 +752,8 @@ static int __init init_spu_base(void)
goto out_unregister_sysdev_class;
}

if (ret > 0) {
/*
* We cannot put the forward declaration in
* <linux/linux_logo.h> because of conflicting session type
* conflicts for const and __initdata with different compiler
* versions
*/
extern const struct linux_logo logo_spe_clut224;

if (ret > 0)
fb_append_extra_logo(&logo_spe_clut224, ret);
}

mutex_lock(&spu_full_list_mutex);
xmon_register_spus(&spu_full_list);
Expand Down
2 changes: 1 addition & 1 deletion arch/um/include/shared/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* sign followed by value, e.g.:
*
* static int init_variable __initdata = 0;
* static char linux_logo[] __initdata = { 0x32, 0x36, ... };
* static const char linux_logo[] __initconst = { 0x32, 0x36, ... };
*
* Don't forget to initialize data not at file scope, i.e. within a function,
* as gcc otherwise puts the data into the bss section and not into the init
Expand Down
15 changes: 0 additions & 15 deletions drivers/video/logo/logo.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,6 @@
#include <asm/bootinfo.h>
#endif

extern const struct linux_logo logo_linux_mono;
extern const struct linux_logo logo_linux_vga16;
extern const struct linux_logo logo_linux_clut224;
extern const struct linux_logo logo_blackfin_vga16;
extern const struct linux_logo logo_blackfin_clut224;
extern const struct linux_logo logo_dec_clut224;
extern const struct linux_logo logo_mac_clut224;
extern const struct linux_logo logo_parisc_clut224;
extern const struct linux_logo logo_sgi_clut224;
extern const struct linux_logo logo_sun_clut224;
extern const struct linux_logo logo_superh_mono;
extern const struct linux_logo logo_superh_vga16;
extern const struct linux_logo logo_superh_clut224;
extern const struct linux_logo logo_m32r_clut224;

static int nologo;
module_param(nologo, bool, 0);
MODULE_PARM_DESC(nologo, "Disables startup logo");
Expand Down
2 changes: 1 addition & 1 deletion include/linux/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* sign followed by value, e.g.:
*
* static int init_variable __initdata = 0;
* static char linux_logo[] __initdata = { 0x32, 0x36, ... };
* static const char linux_logo[] __initconst = { 0x32, 0x36, ... };
*
* Don't forget to initialize data not at file scope, i.e. within a function,
* as gcc otherwise puts the data into the bss section and not into the init
Expand Down
16 changes: 16 additions & 0 deletions include/linux/linux_logo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ struct linux_logo {
const unsigned char *data;
};

extern const struct linux_logo logo_linux_mono;
extern const struct linux_logo logo_linux_vga16;
extern const struct linux_logo logo_linux_clut224;
extern const struct linux_logo logo_blackfin_vga16;
extern const struct linux_logo logo_blackfin_clut224;
extern const struct linux_logo logo_dec_clut224;
extern const struct linux_logo logo_mac_clut224;
extern const struct linux_logo logo_parisc_clut224;
extern const struct linux_logo logo_sgi_clut224;
extern const struct linux_logo logo_sun_clut224;
extern const struct linux_logo logo_superh_mono;
extern const struct linux_logo logo_superh_vga16;
extern const struct linux_logo logo_superh_clut224;
extern const struct linux_logo logo_m32r_clut224;
extern const struct linux_logo logo_spe_clut224;

extern const struct linux_logo *fb_find_logo(int depth);
#ifdef CONFIG_FB_LOGO_EXTRA
extern void fb_append_extra_logo(const struct linux_logo *logo,
Expand Down
18 changes: 9 additions & 9 deletions scripts/pnmtologo.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,22 @@ static void write_header(void)
fprintf(out, " * Linux logo %s\n", logoname);
fputs(" */\n\n", out);
fputs("#include <linux/linux_logo.h>\n\n", out);
fprintf(out, "static unsigned char %s_data[] __initdata = {\n",
fprintf(out, "static const unsigned char %s_data[] __initconst = {\n",
logoname);
}

static void write_footer(void)
{
fputs("\n};\n\n", out);
fprintf(out, "struct linux_logo %s __initdata = {\n", logoname);
fprintf(out, " .type\t= %s,\n", logo_types[logo_type]);
fprintf(out, " .width\t= %d,\n", logo_width);
fprintf(out, " .height\t= %d,\n", logo_height);
fprintf(out, "const struct linux_logo %s __initconst = {\n", logoname);
fprintf(out, "\t.type\t\t= %s,\n", logo_types[logo_type]);
fprintf(out, "\t.width\t\t= %d,\n", logo_width);
fprintf(out, "\t.height\t\t= %d,\n", logo_height);
if (logo_type == LINUX_LOGO_CLUT224) {
fprintf(out, " .clutsize\t= %d,\n", logo_clutsize);
fprintf(out, " .clut\t= %s_clut,\n", logoname);
fprintf(out, "\t.clutsize\t= %d,\n", logo_clutsize);
fprintf(out, "\t.clut\t\t= %s_clut,\n", logoname);
}
fprintf(out, " .data\t= %s_data\n", logoname);
fprintf(out, "\t.data\t\t= %s_data\n", logoname);
fputs("};\n\n", out);

/* close logo file */
Expand Down Expand Up @@ -374,7 +374,7 @@ static void write_logo_clut224(void)
fputs("\n};\n\n", out);

/* write logo clut */
fprintf(out, "static unsigned char %s_clut[] __initdata = {\n",
fprintf(out, "static const unsigned char %s_clut[] __initconst = {\n",
logoname);
write_hex_cnt = 0;
for (i = 0; i < logo_clutsize; i++) {
Expand Down

0 comments on commit ae52bb2

Please sign in to comment.