Re: [PATCH v4 3/4] KVM: selftests: Add atoi_paranoid() to catch errors missed by atoi()

Sean Christopherson
2022-10-06T23:55:03Z

On Thu, Oct 06, 2022, Vipin Sharma wrote:
> On Thu, Oct 6, 2022 at 12:58 PM Sean Christopherson <seanjc@google.com> wrote:
> >
> > On Thu, Oct 06, 2022, Vipin Sharma wrote:
> > > +int atoi_paranoid(const char *num_str)
> > > +{
> > > + int num;
> > > + char *end_ptr;
> >
> > Reverse fir-tree when it's convention:
> >
> > char *end_ptr;
> >
>
> Okay, I will do:
> char *end_ptr;
> int num;
>
> I was not aware of reverse christmas tree convention in KVM subsystem.

Oh, the above was a typo. It was supposed to be "convenient". KVM doesn't strictly
follow the almighty fir tree, but I try to use it and encourage others to do so as
it helps with continuity when switching between x86/kvm and the rest of x86/ (the
tip tree maintainers and thus most of the x86 code are devout believers).