Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff69a4c8 authored by Russell King's avatar Russell King
Browse files

ARM: constify machine_desc structure uses



struct machine_desc records are defined everywhere as a 'const'
structure, but unfortuantely it loses its const-ness through the use of
linker magic - the symbols which surround the section are not declared
const so it becomes possible not to use 'const' for pointers to these
const structures.

Let's fix this oversight - all pointers to these structures should be
marked const too.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 3b2f64d0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -65,12 +65,12 @@ struct machine_desc {
/*
 * Current machine - only accessible during boot.
 */
extern struct machine_desc *machine_desc;
extern const struct machine_desc *machine_desc;

/*
 * Machine type table - also only accessible during boot
 */
extern struct machine_desc __arch_info_begin[], __arch_info_end[];
extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
#define for_each_machine_desc(p)			\
	for (p = __arch_info_begin; p < __arch_info_end; p++)

+1 −2
Original line number Diff line number Diff line
@@ -4,8 +4,7 @@
struct meminfo;
struct machine_desc;

extern void arm_memblock_init(struct meminfo *, struct machine_desc *);

void arm_memblock_init(struct meminfo *, const struct machine_desc *);
phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align);

#endif
+2 −2
Original line number Diff line number Diff line
@@ -15,13 +15,13 @@

#ifdef CONFIG_OF

extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
extern const struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
extern void arm_dt_memblock_reserve(void);
extern void __init arm_dt_init_cpu_maps(void);

#else /* CONFIG_OF */

static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys)
static inline const struct machine_desc *setup_machine_fdt(unsigned int dt_phys)
{
	return NULL;
}
+3 −2
Original line number Diff line number Diff line
@@ -7,9 +7,10 @@ static inline void save_atags(struct tag *tags) { }
void convert_to_tag_list(struct tag *tags);

#ifdef CONFIG_ATAGS
struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr);
const struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer,
	unsigned int machine_nr);
#else
static inline struct machine_desc *
static inline const struct machine_desc *
setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
{
	early_print("no ATAGS support: can't continue\n");
+3 −3
Original line number Diff line number Diff line
@@ -178,11 +178,11 @@ static void __init squash_mem_tags(struct tag *tag)
			tag->hdr.tag = ATAG_NONE;
}

struct machine_desc * __init setup_machine_tags(phys_addr_t __atags_pointer,
						unsigned int machine_nr)
const struct machine_desc * __init
setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
{
	struct tag *tags = (struct tag *)&default_tags;
	struct machine_desc *mdesc = NULL, *p;
	const struct machine_desc *mdesc = NULL, *p;
	char *from = default_command_line;

	default_tags.mem.start = PHYS_OFFSET;
Loading