On Tue, Apr 09, 2019 at 01:03:40PM +0200, Peter Zijlstra wrote:
> On Wed, Feb 27, 2019 at 08:05:15AM -0800, Ricardo Neri wrote:
> > diff --git a/arch/x86/include/asm/hpet.h b/arch/x86/include/asm/hpet.h
> > index 4d559e0c746f..15dc3b576496 100644
> > --- a/arch/x86/include/asm/hpet.h
> > +++ b/arch/x86/include/asm/hpet.h
> > @@ -123,12 +123,24 @@ struct hpet_hld_data {
> >     u32             num;
> >     u32             flags;
> >     u64             ticks_per_second;
> > +   u32             handling_cpu;
> > +   struct cpumask  cpu_monitored_mask;
> > +   struct msi_msg  msi_msg;
> >  };
> 
> Please don't use struct cpumask unless you absolutely have to.
> 
> The above is better written as:
> 
> 
>       struct hpet_hld_data {
>               ...
>               unsigned long cpumask[0];
>       };
> 
> and allocated using:
> 
>       struct hpet_hld_data *hhd = kzalloc(sizeof(struct hpet_hld_data) + 
> cpumask_size());
> 
> and used as:
> 
>       to_cpumask(hhd->cpumask);

Thanks for your feedback, Peter!

Sure. I will make this change.

Thanks and BR,
Ricardo

Reply via email to