From: Zhang Yanfei <zhangyanfei.yes@gmail.com>
To: Simon Horman <horms@verge.net.au>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: [PATCH] kexec: ppc: Use die() instead of fatal()
Date: Wed, 27 Mar 2013 22:09:16 +0800 [thread overview]
Message-ID: <5152FD8C.2070100@gmail.com> (raw)
From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
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>
---
kexec/arch/ppc/fixup_dtb.c | 8 ++++----
kexec/arch/ppc/libfdt-wrapper.c | 8 ++++----
kexec/arch/ppc/ops.h | 2 --
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/kexec/arch/ppc/fixup_dtb.c b/kexec/arch/ppc/fixup_dtb.c
index f832026..2c9e250 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) {
@@ -78,7 +78,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));
@@ -125,10 +125,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_ */
--
1.7.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next reply other threads:[~2013-03-27 14:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 14:09 Zhang Yanfei [this message]
2013-03-27 14:12 ` [PATCH] kexec: ppc: Use die() instead of fatal() Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5152FD8C.2070100@gmail.com \
--to=zhangyanfei.yes@gmail.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.