On 16-08-10 14:40:13, David Laight wrote:
> From: Linuxppc-dev 
> [mailto:linuxppc-dev-bounces+david.laight=aculab....@lists.ozlabs.org] On 
> Behalf Of
> > > > So given what you have above, you'd use something like:
> > > >
> > > > struct ima_kexec_hdr {
> > > >         u16 version;
> > > >         u16 _reserved0;
> > > >         u32 _reserved1;
> > > >         u64 buffer_size;
> > > >         u64 count;
> > > > };
> > > >
> > > > cheers
> > >
> > > Thanks, I'll make this change.
> > 
> > I would suggest:
> > 
> > struct ima_kexec_hdr {
> >     u64 buffer_size;
> >     u64 count;
> >     u16 version;
> > };
> > 
> > and let the compiler add the proper padding, depending on the architecture. 
> >  On
> > 32bit machine we'll have 4 bytes smaller allocations (compared to 64bit) 
> > while
> > retaining the same functionality.
> 
> AAAArrrrgggg.....
> 
> That doesn't work for 32bit applications on 64bit hosts.

Which part won't work?

> The extra bytes will make 0 difference to the allocation cost and lots to the 
> processing.

An example?


                Petko

Reply via email to