Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3764147pxj; Mon, 7 Jun 2021 20:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLNw5yVUe9vMg5JiQ/0SvrVK+5985cCa1gutvw8Xyj3Rm3LJicDOWOntYp278EDyUf5VQZ X-Received: by 2002:a17:906:308d:: with SMTP id 13mr20592523ejv.554.1623123389244; Mon, 07 Jun 2021 20:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623123389; cv=none; d=google.com; s=arc-20160816; b=EerwixXAkJe11YnRyk+1w4JXKYEt8+cEnsnzsLVgpsLptGfjqKadafBoYLE0jVirhB IAuD1Tjugwx3zWAhz+OxiG3YkV6XmU7DuRpRM4KFcZlYDurLjYK0iZJU/qC0zy2MCa7p GnDSjplwbJdKK/ROiEbX5cOxXx7CdgbE1vQQwN/RRkXnoMVTC3H2q1eNuEN4Cd2wT1tF LyGaL39f/BTe9/6M9yNAdPbjpCmg956jx+JZZnmGDrj/tiepYfMGitCjDYw5hIGxZV// YIz5M/vl03reDa6F30otvsSnW6LqkPjQysYE0O/X/5RYmkXi/rKBv1bF7Q+GdnKsnVIH jf8w== 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=q6DkNipl4Z5PyVtPiB4Zdbpisdx+7Mm7prooykSN8EE=; b=s8sdUDlq6FJqf/XL2n482Th2kegmML8j2i87zN+yiBgHIHP49JfQmWnxBbqof9lv4V wcehIa6XW/jPPHd5g+F2j1T7+TbdeXur3alMz5nXqhk6asS92cScgiuBeeW5Vk15dbm3 H+yuM9BACvW5QYkUxtYZdvhf4CMMvEqQXvWJP/6B7hk5Sd+ZET+NM4X2HXqf4UZpehDp 50oL84PqIfuz3YurtDHqmtTEyl4XOB9LZH40010KDdzgyQgX+ptskbBqEuBr1aCuGgbF 5yJyvpgv0PbbbHQVEQJ/5kKo1D+EkhI/DjoDTVZM3dgJVC8ZMs4X5wnWbRT9rg+1JP3r bqMA== 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 e12si11401033ejl.676.2021.06.07.20.36.06; Mon, 07 Jun 2021 20:36:29 -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 S231171AbhFHDfl (ORCPT + 99 others); Mon, 7 Jun 2021 23:35:41 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:8072 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbhFHDfg (ORCPT ); Mon, 7 Jun 2021 23:35:36 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FzbNt0mxSzYrZy; Tue, 8 Jun 2021 11:30:54 +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; Tue, 8 Jun 2021 11:33:42 +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; Tue, 8 Jun 2021 11:33:41 +0800 From: Qi Liu To: , CC: , Andy Gross , Will Deacon , Mark Rutland Subject: [PATCH v3 4/9] drivers/perf: Simplify EVENT ATTR macro in qcom_l2_pmu.c Date: Tue, 8 Jun 2021 11:33:16 +0800 Message-ID: <1623123201-45634-5-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1623123201-45634-1-git-send-email-liuqi115@huawei.com> References: <1623123201-45634-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 fc54a80..2cf89de 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