Skip to content

Commit 3370941

Browse files
geerturobherring
authored andcommitted
crash_dump: Make elfcorehdr address/size symbols always visible
Make the forward declarations of elfcorehdr_addr and elfcorehdr_size, and the definitions of ELFCORE_ADDR_MAX and ELFCORE_ADDR_ERR always available, like is done for phys_initrd_start and phys_initrd_size. Code referring to these symbols can then just check for IS_ENABLED(CONFIG_CRASH_DUMP), instead of requiring conditional compilation using an #ifdef, thus preparing to increase compile coverage. Suggested-by: Rob Herring <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/ba965ca613c0cc82c1ec2fe353ee34fb13b36474.1628670468.git.geert+renesas@glider.be
1 parent 0b38130 commit 3370941

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/crash_dump.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
#include <linux/pgtable.h> /* for pgprot_t */
1212

13-
#ifdef CONFIG_CRASH_DUMP
13+
/* For IS_ENABLED(CONFIG_CRASH_DUMP) */
1414
#define ELFCORE_ADDR_MAX (-1ULL)
1515
#define ELFCORE_ADDR_ERR (-2ULL)
1616

1717
extern unsigned long long elfcorehdr_addr;
1818
extern unsigned long long elfcorehdr_size;
1919

20+
#ifdef CONFIG_CRASH_DUMP
2021
extern int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size);
2122
extern void elfcorehdr_free(unsigned long long addr);
2223
extern ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos);

0 commit comments

Comments
 (0)