From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A95B0C433F5 for ; Tue, 17 May 2022 09:15:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244383AbiEQJPq (ORCPT ); Tue, 17 May 2022 05:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244479AbiEQJPK (ORCPT ); Tue, 17 May 2022 05:15:10 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9687837A35; Tue, 17 May 2022 02:15:09 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L2VmC3KYRzbbmM; Tue, 17 May 2022 17:13:47 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 17 May 2022 17:15:07 +0800 CC: , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device To: John Garry , Yicong Yang , , , , , , , , References: <20220516125223.32012-1-yangyicong@hisilicon.com> <20220516125223.32012-3-yangyicong@hisilicon.com> <90aafbc1-b7f6-1cc9-8f94-c72f05150f70@huawei.com> <31113797-29c5-1400-f7ac-bff79853b3fe@huawei.com> From: Yicong Yang Message-ID: <53d7db9f-dbd6-c21a-01dd-7316dd541957@huawei.com> Date: Tue, 17 May 2022 17:15:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On 2022/5/17 16:21, John Garry wrote: > On 17/05/2022 09:09, Yicong Yang wrote: >>>> +    target = cpumask_any(cpumask_of_node(dev_to_node(&hisi_ptt->pdev->dev))); >>>> +    if (target < nr_cpumask_bits) { >>> the comment for cpumask_any() hints to check against nr_cpu_ids - any specific reason to check against nr_cpumask_bits? >>> >> here should be: >>     if (target >= nr_cpumask_bits) { >> >> will fix this up. >> > > I am still not sure that using nr_cpumask_bits is correct. Let's use nr_cpu_ids to match the comment of cpumask_any(). Actually we should have nr_cpu_ids(possible cpus, init to NR_CPUS) <= nr_cpumask_bits (NR_CPUS) so it's ok here.