Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5145474pxj; Wed, 9 Jun 2021 10:08:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj+ldo4R7LREweIXtBDCNXoSoP9UEQyNvTn45gvU1T/oSGeRaQdQ63opKl5zKXUxpMiNVQ X-Received: by 2002:a05:6402:128d:: with SMTP id w13mr490279edv.38.1623258515371; Wed, 09 Jun 2021 10:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258515; cv=none; d=google.com; s=arc-20160816; b=xBKDD9Inc6Dl6yC2ra8TXrJM4m9s/51vnwHL/TCDZxAUrGwJaXevVcVFsxiTVPspja vRFq8QuzouahyVNk9FxT3RyyEKUZBLwJMtGYkn7TGLN9r95vIem3B3aMOBLnto9GxdaG /j84woXLOoQOo3odGRS1oV9hwgKQ9GgBNLzDn64NX3J/XEgYjB/dkBa2oSl2mzs4gXgQ Q+wuOI8yHESYlKd7ufZK8pE72FTEOAetiwMC7EMGJyl5khDePaz4IycH/vA6SDqjWZKY 0CfPQmU87BCQAjWDbVl8xfr3vq6xsPS0HUnCJYHywBeC3fkTcPrX7klsBuMMpD0qD2fR jprg== 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=5uv3t5X46giyLWrsWErnzhSMhaBbtIAYxyMufLcBxUo=; b=X/0U6qJ/fi4Yq43MkWcnRnnCFVUTfyGNjW0yiP0zu9sGjit8wD0BTz7K0qUaK68BAL bUTodxHHzVpEKMttun4ul8Mgr6B4VUVbmpbsQYDvhzuiPVkJOQzK+4jsTBRoTRvM++IR 7PJNVXifyEKCUHlYWTZNqOBNFJW2+3gIdYaJ86oEpJ0xcNpdi/xJ6BrbbhP2YvOekHle pg6VcvvY9eQwUSr19/U3WCw01nkZS85boDgEvqmyt1wX+XNiBZ11ah5yP6OkJAF9nRDL +b9a1uHmNppcNE8iN2Le/7CWNjUWtkzEr2RO6wpWDI+t0EuEF4Iicz7T+L+OEOFZGkkQ Gayw== 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 y6si287857ejk.381.2021.06.09.10.08.10; Wed, 09 Jun 2021 10:08:35 -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 S236039AbhFIGoL (ORCPT + 99 others); Wed, 9 Jun 2021 02:44:11 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:5299 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236852AbhFIGoB (ORCPT ); Wed, 9 Jun 2021 02:44:01 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4G0HTQ043Zz1BKR5; Wed, 9 Jun 2021 14:37:14 +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:41:59 +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: , Andy Gross , Mark Rutland Subject: [PATCH v4 3/7] drivers/perf: Simplify EVENT ATTR macro in qcom_l2_pmu.c Date: Wed, 9 Jun 2021 14:40:59 +0800 Message-ID: <1623220863-58233-4-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 L2CACHE_EVENT_ATTR Cc: Andy Gross Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Qi Liu --- drivers/perf/qcom_l2_pmu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c index b60e301..5b093ba 100644 --- a/drivers/perf/qcom_l2_pmu.c +++ b/drivers/perf/qcom_l2_pmu.c @@ -679,11 +679,8 @@ static ssize_t l2cache_pmu_event_show(struct device *dev, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } -#define L2CACHE_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ - { .attr = __ATTR(_name, 0444, l2cache_pmu_event_show, NULL), \ - .id = _id, } \ - })[0].attr.attr) +#define L2CACHE_EVENT_ATTR(_name, _id) \ + PMU_EVENT_ATTR_ID(_name, l2cache_pmu_event_show, _id) static struct attribute *l2_cache_pmu_events[] = { L2CACHE_EVENT_ATTR(cycles, L2_EVENT_CYCLES), -- 2.7.4