lkml.org 
[lkml]   [2019]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 06/14] x86/hpet: Configure the timer used by the hardlockup detector
On Tue, Mar 26, 2019 at 10:13:06PM +0100, Thomas Gleixner wrote:
> On Wed, 27 Feb 2019, Ricardo Neri wrote:
> > +#ifdef CONFIG_X86_HARDLOCKUP_DETECTOR_HPET
> > +struct hpet_hld_data *hpet_hardlockup_detector_assign_timer(void)
> > +{
> > + struct hpet_hld_data *hdata;
> > + unsigned int cfg;
> > +
> > + cfg = hpet_readl(HPET_Tn_CFG(HPET_WD_TIMER_NR));
> > +
> > + if (!(cfg & HPET_TN_FSB_CAP))
> > + return NULL;
> > +
> > + hdata = kzalloc(sizeof(*hdata), GFP_KERNEL);
> > + if (!hdata)
> > + return NULL;
> > +
> > + hdata->flags = HPET_DEV_FSB_CAP;
>
> Pointless.

Agreed. Only if the timer is FSB-capable is hdata is initialized.
>
> > +
> > + if (cfg & HPET_TN_PERIODIC_CAP)
> > + hdata->flags |= HPET_DEV_PERI_CAP;
>
> This can be expressed by a simple:
>
> hdata->has_periodic = 1;
>
> And no flag shuffling required at all.

Sure. I'll implement this change.

Thanks and BR,
Ricardo

\
 
 \ /
  Last update: 2019-04-09 04:06    [W:0.057 / U:0.352 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site