Re: [PATCH 1/1] x86/platform/x86: Fix count of CHas on multi-pci-segment arches
From: Andy Shevchenko
Date: Tue Mar 13 2018 - 13:50:50 EST
On Tue, Mar 13, 2018 at 7:49 PM, Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Tue, Mar 13, 2018 at 7:46 PM, Andy Shevchenko
> <andy.shevchenko@xxxxxxxxx> wrote:
>>>>>> + pci_read_config_dword(dev, SKX_CAPID6, &val);
>>>>>> + return bitmap_weight((unsigned long *)&val, SKX_CHA_BIT_WIDTH);
>
> Forgot about hweight32(). Can you use that one directly?
>
> hweight32(x & (BIT(_WIDTH) - 1));
>
> ?
Or even provide
#define SKX_CHA_BIT_MASK GENMASK(...)
--
With Best Regards,
Andy Shevchenko