Re: [PATCH v3 05/12] arm: vdso: do calculations outside reader loops
From: Mark Rutland
Date: Tue Oct 31 2017 - 06:36:31 EST
On Mon, Oct 30, 2017 at 01:27:22PM -0700, Mark Salyzyn wrote:
> Thanks for the review, am taking all the points into consideration.
>
> On 10/30/2017 07:15 AM, Mark Rutland wrote:
> > > +
> > > + typeof(((struct vdso_data *)vd)->xtime_clock_sec) sec;
> > Why do we need to do this typeof() magic?
> >
> > Can't we settle on a consistent type across arches, or have a typedef in
> > a header?
>
> Would you accept 'because I do not want to standardize the sizes yet'?
Well, a typedef would solve that issue. e.g. each arch can have:
typedef u64 vdso_xtime_sec_t;
... or
typedef u32 vdso_xtime_sec_t;
... in headers for native/compat, and the above can be:
vdso_xtime_sec_t sec
... with the same type in the relevant struct.
That way the type can differ per arch. If we want to do something more
complicated later, we can always rework the code.
Thanks,
Mark.