From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932464AbeCMRuq (ORCPT ); Tue, 13 Mar 2018 13:50:46 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:46934 "EHLO mail-qk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752187AbeCMRup (ORCPT ); Tue, 13 Mar 2018 13:50:45 -0400 X-Google-Smtp-Source: AG47ELueU+Fn0NnGzGef5bQYSNlclNFD9pMZ8G5eUJX0BcjXHqsbwgxK1MN89Orfw6uzIfnl+qZVRwyfDhZvJQ5+4u8= MIME-Version: 1.0 In-Reply-To: References: <9efcdfa1-9da3-f4de-749f-0950d20a5758@linux.intel.com> <55123ef5-3287-d4c9-4499-62140c598474@linux.intel.com> From: Andy Shevchenko Date: Tue, 13 Mar 2018 19:50:44 +0200 Message-ID: Subject: Re: [PATCH 1/1] x86/platform/x86: Fix count of CHas on multi-pci-segment arches To: "Liang, Kan" Cc: "Kroening, Gary" , "mingo@redhat.com" , "hpa@zytor.com" , "tglx@linutronix.de" , "peterz@infradead.org" , "Travis, Mike" , "Banman, Andrew" , "Sivanich, Dimitri" , "Anderson, Russ" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 13, 2018 at 7:49 PM, Andy Shevchenko wrote: > On Tue, Mar 13, 2018 at 7:46 PM, Andy Shevchenko > 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