From 35aa1a273bc407271f8a1e7b91989b9e6787879c Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 16 May 2008 13:21:51 +1000 Subject: dtc: Simplify error handling for unparseable input Currently, main() tests if it got a valid input tree from whichever dt_from_*() function it invoked and if not, die()s. For one thing, this test has, for no good reason, three different ways for those functions to communicate a failure to provide input (bi NULL, bi->dt NULL, or bi->error non-zero). For another, in every case save one, if the dt_from_*() functions are unable to provide input they will immediately die() (with a more specific error message) rather than proceeding to the test in main(). Therefore, this patch removes this test, making the one case that could have triggered it (in dt_from_source()) call die() directly instead. With this change, the error field in struct boot_info is now unused, so remove it. Signed-off-by: David Gibson --- livetree.c | 1 - 1 file changed, 1 deletion(-) (limited to 'livetree.c') diff --git a/livetree.c b/livetree.c index 7610e78..6ba0846 100644 --- a/livetree.c +++ b/livetree.c @@ -172,7 +172,6 @@ struct boot_info *build_boot_info(struct reserve_info *reservelist, bi = xmalloc(sizeof(*bi)); bi->reservelist = reservelist; bi->dt = tree; - bi->error = 0; return bi; } -- cgit v1.2.1