lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 14/23] thermal: intel: hfi: Update the class of the current task
On Fri, Sep 09, 2022 at 04:11:56PM -0700, Ricardo Neri wrote:
> +union hfi_thread_feedback_char_msr {
> + struct {
> + u8 classid;
> + u64 __reserved:55;
> + u8 valid:1;
> + } split;
> + u64 full;
> +};

Urgh, did you perhaps mean:

struct {
u64 classid :8;
u64 __reserved :55;
u64 valid :1
};

?

Because yes, GCC does fold that into a single u64, but that's
implementation defined behaviour; the C spec doesn't require one to pack
adjacent bitfields of different types together.

I layout of:

u8 class; // offset 0
u64 __reserver : 55; // offset 8
u8 valid : 1; // offset 16

with a total size of 24 bytes is, AFAIU, a valid result of what you
wrote.

\
 
 \ /
  Last update: 2022-09-27 13:48    [W:0.358 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site