[PATCH 3/3] Return a non-zero exit code if an error occurs during dts parsing.

David Gibson david at gibson.dropbear.id.au
Fri Jan 4 15:30:33 EST 2008

On Thu, Jan 03, 2008 at 05:43:33PM -0600, Scott Wood wrote:
> Previously, only failure to parse caused the reading of the tree to fail;
> semantic errors that called yyerror() but not YYERROR only emitted a message,
> without signalling make to stop the build.

This one, however, I don't like.

> diff --git a/dtc.h b/dtc.h
> index 9b89689..cba9d28 100644
> --- a/dtc.h
> +++ b/dtc.h
> @@ -233,6 +233,7 @@ struct reserve_info *add_reserve_entry(struct reserve_info *list,
>  struct boot_info {
>  	struct reserve_info *reservelist;
>  	struct node *dt;		/* the device tree */
> +	int error;
>  };

This is unequivocally wrong.  boot_info should have information about
the contents of the blob, not state information like the error.

If you're going to use an ugly global, then use it everywhere.

David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!

More information about the Linuxppc-dev mailing list