From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752402AbeCMRt5 (ORCPT ); Tue, 13 Mar 2018 13:49:57 -0400 Received: from mail-qk0-f176.google.com ([209.85.220.176]:42896 "EHLO mail-qk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752000AbeCMRtx (ORCPT ); Tue, 13 Mar 2018 13:49:53 -0400 X-Google-Smtp-Source: AG47ELt77FMX6fNqo0QObR6IP5IVkohOYbDnKVQeVkW9ByKgRKiYGXWyr3JyDg3HRBA0qiGhOdS31PeoIeev/GGiaDw= 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:49:52 +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: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)); ? -- With Best Regards, Andy Shevchenko