Øyvind Harboe wrote:
> >> +     if (detected_failure != ERROR_OK)
> >> +             return detected_failure;
> >> +     return retval;
> >
> > Please just use retval also for the error.
> 
> I'm not sure what you mean. I'm detecting an error,
> then running cleanup, which can also fail and is using
> retval. After the cleanup has happened, I report the
> original error.

A function can only ever return one value. If cleanup fails then the
value of retval becomes irrelevant, so can easily use just a single
variable for the single purpose of storing the return value for the
function.


//Peter
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to