On 11/11/2020 10:50 AM, Richard Cochran wrote:
> On Wed, Nov 11, 2020 at 10:35:20AM -0800, Jacob Keller wrote:
>> Thoughts on making this an enum instead so that it's even more clear
>> from the function signatures that this is not an integer return code?
>> The run_pmc function is static so it would only affect callers in this file.
>
> I considered an enum, but that meant churn on all the callers due to
> the change in return type of run_pmc().
>
> At the end, I want to have run_pmc return errno codes.
>
> Thanks,
> Richard
>
Makes sense. Having run_pmc just return error codes or zero makes more
sense in the long run, so the enumeration isn't really necessary. This
is especially true since the return values really are one success and 3
possible failures, where we pretty much just forward the error value out.
It might be different if many of the callers had to switch on the return
and do things differently based on which return value.
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel