Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5146746pxj; Wed, 9 Jun 2021 10:10:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEYlimnCW3aqOVCpe5Fh/6JLrY4zoEwBbdauxnVtZdtzmlMsaRumFmU6giA4ZJp2wL8CBE X-Received: by 2002:a05:6402:366:: with SMTP id s6mr450321edw.209.1623258613342; Wed, 09 Jun 2021 10:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258613; cv=none; d=google.com; s=arc-20160816; b=D96ldcuMuUN2z8Hg0t8myG9QPZPQbx3BOKzMXPnvMurfIRYsj1ss0/yGFnNCsbm/nf 8FSFWnO9qgmlZaZwA92goJjWiZxDV2/ZJSY0MhlqsNy5/78CTUcsrrzRtu+eBxMWIa4P 3kjTpLcaQcdsjW8BwhfoIIIrT0Ea7/jHCN+7ZyjghHhgZHhG6XQK0xojsWgYZHYopBoH vSuzuvtBjij+SpnzM86P265Ydwdev0ggh0uyBnRvC1tm/laN/A6Q9KmkPAUw8/mrz/hN B0B4T5lo5CqR2LvQcV40lrB649JHV3mUTjhF1tSmHd9uw/yblrlb0XSVFnFee+rD53IA 8FfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=tHGhkghxlGmuUOMojNpt+3HHiRrYXoGVC2eL4dV595k=; b=d5r3Tezo9+8Mub7S0vS3ZVwuprr0Ok1NJa7pbzLorFr4/6gg+QaXT5u+kkpU6iYt5y KOQDutifDNvSu5sedPrTh3+erJkrld/TFsjcYC0Q/rG6BOZLxeRMXst7T3j5tq4i9Rpb uBdPBnG9NfLR8OjE0p4SEVWDbqKaUcqp0mcfPjHa4c36f3Owsy77+me08jxT6b/CXkqV XvgRbxCNmdyTvPP6/ByQaKVZWcn4XAWhDPN/hWy1sDcebyjXvJ5pIRGrG/m0eXXCoVHd Dn3l0ObufKckKNtWz9+AGR780GtkSHUFD4eMd1xBYy5d4HZX1HTk9xLDXerKC4OhDm50 JJXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si193195edb.238.2021.06.09.10.09.49; Wed, 09 Jun 2021 10:10:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236904AbhFIGoM (ORCPT + 99 others); Wed, 9 Jun 2021 02:44:12 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:8104 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236857AbhFIGoB (ORCPT ); Wed, 9 Jun 2021 02:44:01 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G0HWm461szYsWX; Wed, 9 Jun 2021 14:39:16 +0800 (CST) Received: from dggema757-chm.china.huawei.com (10.1.198.199) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 9 Jun 2021 14:42:00 +0800 Received: from localhost.localdomain (10.69.192.56) by dggema757-chm.china.huawei.com (10.1.198.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 9 Jun 2021 14:41:59 +0800 From: Qi Liu To: , , CC: , Frank Li , Mark Rutland Subject: [PATCH v4 6/7] drivers/perf: Simplify EVENT ATTR macro in fsl_imx8_ddr_perf.c Date: Wed, 9 Jun 2021 14:41:02 +0800 Message-ID: <1623220863-58233-7-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1623220863-58233-1-git-send-email-liuqi115@huawei.com> References: <1623220863-58233-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggema757-chm.china.huawei.com (10.1.198.199) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use common macro PMU_EVENT_ATTR_ID to simplify IMX8_DDR_PMU_EVENT_ATTR Cc: Frank Li Cc: Will Deacon Cc: Mark Rutland Reviewed by Frank Li Signed-off-by: Qi Liu --- drivers/perf/fsl_imx8_ddr_perf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index df048fe..2a1d787 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -222,11 +222,8 @@ ddr_pmu_event_show(struct device *dev, struct device_attribute *attr, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } -#define IMX8_DDR_PMU_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ - { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ - .id = _id, } \ - })[0].attr.attr) +#define IMX8_DDR_PMU_EVENT_ATTR(_name, _id) \ + PMU_EVENT_ATTR_ID(_name, ddr_pmu_event_show, _id) static struct attribute *ddr_perf_events_attrs[] = { IMX8_DDR_PMU_EVENT_ATTR(cycles, EVENT_CYCLES_ID), -- 2.7.4