dtc: Simplify error handling for unparseable input [resend]

2008-05-15 Thread David Gibson
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)

Re: dtc: Simplify error handling for unparseable input

2008-03-25 Thread Scott Wood
On Wed, Mar 26, 2008 at 10:52:02AM +1100, David Gibson wrote: > On Tue, Mar 25, 2008 at 05:10:07PM -0500, Scott Wood wrote: > > It's generally nice to the user if you can report as many bugs as you can > > rather than fail on the first one. > > Hrm, I guess. There's only so far it's worth going

Re: dtc: Simplify error handling for unparseable input

2008-03-25 Thread David Gibson
On Tue, Mar 25, 2008 at 05:10:07PM -0500, Scott Wood wrote: > David Gibson wrote: >> On Tue, Mar 25, 2008 at 09:36:19AM -0500, Scott Wood wrote: >>> On Tue, Mar 25, 2008 at 12:28:05PM +1100, David Gibson wrote: On Mon, Mar 24, 2008 at 12:36:41PM -0500, Scott Wood wrote: > If you remove thi

Re: dtc: Simplify error handling for unparseable input

2008-03-25 Thread David Gibson
On Tue, Mar 25, 2008 at 05:10:07PM -0500, Scott Wood wrote: > David Gibson wrote: >> On Tue, Mar 25, 2008 at 09:36:19AM -0500, Scott Wood wrote: >>> On Tue, Mar 25, 2008 at 12:28:05PM +1100, David Gibson wrote: On Mon, Mar 24, 2008 at 12:36:41PM -0500, Scott Wood wrote: > If you remove thi

Re: dtc: Simplify error handling for unparseable input

2008-03-25 Thread Scott Wood
David Gibson wrote: On Tue, Mar 25, 2008 at 09:36:19AM -0500, Scott Wood wrote: On Tue, Mar 25, 2008 at 12:28:05PM +1100, David Gibson wrote: On Mon, Mar 24, 2008 at 12:36:41PM -0500, Scott Wood wrote: If you remove this, there'll be no way to indicate semantic errors other than die() (the NUL

Re: dtc: Simplify error handling for unparseable input

2008-03-25 Thread David Gibson
On Tue, Mar 25, 2008 at 09:36:19AM -0500, Scott Wood wrote: > On Tue, Mar 25, 2008 at 12:28:05PM +1100, David Gibson wrote: > > On Mon, Mar 24, 2008 at 12:36:41PM -0500, Scott Wood wrote: > > > If you remove this, there'll be no way to indicate semantic errors other > > > than die() (the NULL appr

Re: dtc: Simplify error handling for unparseable input

2008-03-25 Thread Scott Wood
On Tue, Mar 25, 2008 at 12:28:05PM +1100, David Gibson wrote: > On Mon, Mar 24, 2008 at 12:36:41PM -0500, Scott Wood wrote: > > If you remove this, there'll be no way to indicate semantic errors other > > than die() (the NULL approaches are no good, since they inhibit recovery), > > which is subopt

Re: dtc: Simplify error handling for unparseable input

2008-03-24 Thread David Gibson
On Mon, Mar 24, 2008 at 12:36:41PM -0500, Scott Wood wrote: > On Mon, Mar 24, 2008 at 02:44:24PM +1100, David Gibson wrote: > > Index: dtc/dtc.h > > === > > --- dtc.orig/dtc.h 2008-03-24 14:33:33.0 +1100 > > +++ dtc/dtc.h

Re: dtc: Simplify error handling for unparseable input

2008-03-24 Thread Scott Wood
On Mon, Mar 24, 2008 at 02:44:24PM +1100, David Gibson wrote: > Index: dtc/dtc.h > === > --- dtc.orig/dtc.h2008-03-24 14:33:33.0 +1100 > +++ dtc/dtc.h 2008-03-24 14:33:34.0 +1100 > @@ -232,7 +232,6 @@ > struct boot

dtc: Simplify error handling for unparseable input

2008-03-23 Thread David Gibson
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)