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 55D2EC433F5 for ; Thu, 14 Apr 2022 12:59:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243677AbiDNNBj (ORCPT ); Thu, 14 Apr 2022 09:01:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238742AbiDNNBf (ORCPT ); Thu, 14 Apr 2022 09:01:35 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF38F92865; Thu, 14 Apr 2022 05:59:10 -0700 (PDT) Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KfKGs19YDz688j4; Thu, 14 Apr 2022 20:56:53 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.24; Thu, 14 Apr 2022 14:59:06 +0200 Received: from [10.47.27.241] (10.47.27.241) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 14 Apr 2022 13:59:05 +0100 Message-ID: <40f03ea6-1690-8a6f-2969-24c47f39c215@huawei.com> Date: Thu, 14 Apr 2022 14:00:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v7 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver To: Yicong Yang , Yicong Yang , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , References: <20220407125841.3678-1-yangyicong@hisilicon.com> <20220407125841.3678-6-yangyicong@hisilicon.com> <276c24d2-daf5-5eba-26b9-55edd4a45537@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.27.241] X-ClientProxiedBy: lhreml714-chm.china.huawei.com (10.201.108.65) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/04/2022 08:41, Yicong Yang wrote: >>> +    hisi_ptt_pmus = zalloc(sizeof(struct perf_pmu *) * (*nr_ptts)); >>> +    if (!hisi_ptt_pmus) { >>> +        pr_err("hisi_ptt alloc failed\n"); >>> +        *err = -ENOMEM; >> using PTR_ERR seems better, if possible >> > ok will change to that. *err = -ENOMEM is used here to keep consistence with > what spe does. > Ah, I see that we are contrained by the interface of auxtrace_record_init() to pass err as a pointer, so I suppose the code in this patch is ok to fit into that.