summaryrefslogtreecommitdiff
path: root/kexec
diff options
context:
space:
mode:
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>2013-03-27 22:09:16 +0800
committerSimon Horman <horms@verge.net.au>2013-03-27 23:11:55 +0900
commitaf4c2f5972334368ba33b630f70ac0331ec111ba (patch)
tree3cb1021d214924397cf52bd413e1f1f48dc9c051 /kexec
parent42e97b2ee545901070e6bb9bb8b9a80a5ea01e2e (diff)
kexec: ppc: Use die() instead of fatal()
fatal() nearly does the same thing as die() does, so this is kind of duplicate. Remove fatal() and use die() instead. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec')
-rw-r--r--kexec/arch/ppc/fixup_dtb.c8
-rw-r--r--kexec/arch/ppc/libfdt-wrapper.c8
-rw-r--r--kexec/arch/ppc/ops.h2
3 files changed, 8 insertions, 10 deletions
diff --git a/kexec/arch/ppc/fixup_dtb.c b/kexec/arch/ppc/fixup_dtb.c
index b10ac59..4524c8c 100644
--- a/kexec/arch/ppc/fixup_dtb.c
+++ b/kexec/arch/ppc/fixup_dtb.c
@@ -54,7 +54,7 @@ static void fixup_nodes(char *nodes[])
len = asprintf(&fname, "%s%s", proc_dts, nodes[index]);
if (len < 0)
- fatal("asprintf() failed\n");
+ die("asprintf() failed\n");
content = slurp_file(fname, &content_size);
if (!content) {
@@ -76,7 +76,7 @@ static void fixup_nodes(char *nodes[])
ret = setprop(node, prop_name, content, content_size);
if (ret < 0)
- fatal("setprop of %s/%s size: %ld failed: %s\n",
+ die("setprop of %s/%s size: %ld failed: %s\n",
node_name, prop_name, content_size,
fdt_strerror(ret));
@@ -123,10 +123,10 @@ static char *expand_buf(int minexpand, char *blob_buf, off_t *blob_size)
size = _ALIGN(size + minexpand, EXPAND_GRANULARITY);
blob_buf = realloc(blob_buf, size);
if (!blob_buf)
- fatal("Couldn't find %d bytes to expand device tree\n\r", size);
+ die("Couldn't find %d bytes to expand device tree\n\r", size);
rc = fdt_open_into(blob_buf, blob_buf, size);
if (rc != 0)
- fatal("Couldn't expand fdt into new buffer: %s\n\r",
+ die("Couldn't expand fdt into new buffer: %s\n\r",
fdt_strerror(rc));
*blob_size = fdt_totalsize(blob_buf);
diff --git a/kexec/arch/ppc/libfdt-wrapper.c b/kexec/arch/ppc/libfdt-wrapper.c
index 5fbd3a8..ef355d0 100644
--- a/kexec/arch/ppc/libfdt-wrapper.c
+++ b/kexec/arch/ppc/libfdt-wrapper.c
@@ -66,10 +66,10 @@ static void expand_buf(int minexpand)
size = _ALIGN(size + minexpand, EXPAND_GRANULARITY);
buf = realloc(buf, size);
if (!buf)
- fatal("Couldn't find %d bytes to expand device tree\n\r", size);
+ die("Couldn't find %d bytes to expand device tree\n\r", size);
rc = fdt_open_into(fdt, buf, size);
if (rc != 0)
- fatal("Couldn't expand fdt into new buffer: %s\n\r",
+ die("Couldn't expand fdt into new buffer: %s\n\r",
fdt_strerror(rc));
fdt = buf;
@@ -159,7 +159,7 @@ static unsigned long fdt_wrapper_finalize(void)
rc = fdt_pack(fdt);
if (rc != 0)
- fatal("Couldn't pack flat tree: %s\n\r",
+ die("Couldn't pack flat tree: %s\n\r",
fdt_strerror(rc));
return (unsigned long)fdt;
}
@@ -185,5 +185,5 @@ void fdt_init(void *blob)
err = fdt_open_into(fdt, fdt, bufsize);
if (err != 0)
- fatal("fdt_init(): %s\n\r", fdt_strerror(err));
+ die("fdt_init(): %s\n\r", fdt_strerror(err));
}
diff --git a/kexec/arch/ppc/ops.h b/kexec/arch/ppc/ops.h
index a2eb140..7334a05 100644
--- a/kexec/arch/ppc/ops.h
+++ b/kexec/arch/ppc/ops.h
@@ -145,6 +145,4 @@ static inline char *get_path(const void *phandle, char *buf, int len)
return NULL;
}
-#define fatal(args...) { printf(args); exit(1); }
-
#endif /* _PPC_BOOT_OPS_H_ */