Re: [for-next][PATCH 21/21] tracing: Use a struct alignof to determine trace event field alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 1 Aug 2022 07:46:22 +0000
David Laight <David.Laight@xxxxxxxxxx> wrote:

> > Define a macro as:
> > 
> >    ALIGN_STRUCTFIELD(type) ((int)(offsetof(struct {char a; type b;}, b)))
> > 
> > which gives the actual alignment of types in a structure.  
> 
> The simpler:
> 	__alignof__(struct {type b;})
> also works.

I'll have to try that out.

For now, as the previous version made it through all my tests, I may be
pushing it, but change it to this for simplicity if that also works and
passes all my test.

Thanks,

-- Steve



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux