Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3765597pxj; Mon, 7 Jun 2021 20:39:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylnqfrlnlMTP/CzVlC8k3Ljb13Y9OvQrVmetvJHKbHugokT3R0RzpSdqlUoKR73vXE1qO4 X-Received: by 2002:a17:906:c2d6:: with SMTP id ch22mr6098363ejb.227.1623123591862; Mon, 07 Jun 2021 20:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623123591; cv=none; d=google.com; s=arc-20160816; b=ApB2Aaq9ieROyFsVBq+pjaW6oISV+YTkPUKkitdthVZVFoZv4QGlC2t1bxDDtPW9Iu cbdn6x/PW7T+yt5E6d/AaT75OkRrS7qrNxRisbyyvXNvSDGZPd6PaoDng24VJ7lXpTkG D533v4Sd8enwaJpQ5DjZxoxtyK4YSxFDPgdEkFLzlFcT7vYe/NQsBTA39J04KsrbKqrO eVXhWaklpYFL7PwilkfWJa//1RsvP+4SO/37JempAGO7uEozfJQaiEk8TH1Qnwsou2h+ xy8u8vs8tUBy0TgonMEgZX3taRS7JSLp3odolsozdHso67M3F55gHHgUrY8pg7AJlrcn TlZA== 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=fTnzWDjXJvX1W3vuSpc+5Y7YWFPK3PaE6screK6SXgg=; b=vQSVmtFAzVjdWTnnFwCLiO7nKKM6Sg/JbjIxniRBwh/IQtoktFD7qGiaR3KrQPDJMh UIg+IzSh959RJxnFLAEk64vQhTzm0c5uqoXz9Vb88xbEuzlc8sHhhCY50r3uB3Yfdoyg 5ShKMRUslXEXi8t9s03se1rRQ3pq7Nwvu6I9YiwgOs5yTd5gGzNarjKc9j9UP5kJ3EKQ /Xd+ZSoIXYC3Qarqsc1Ji7kuWIij8G1AXE/bareYMfh0XHH/sW6+vQCAms7cRBpN0udz vv8V1k3gb7o5RGUx0lohpZPOjJMCga749Cl5AQ85QibFvh3/FOPNKWxxne0fkcW2Y/hj PjvQ== 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 d7si14157691ejo.445.2021.06.07.20.39.29; Mon, 07 Jun 2021 20:39:51 -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 S231359AbhFHDgZ (ORCPT + 99 others); Mon, 7 Jun 2021 23:36:25 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3465 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbhFHDgP (ORCPT ); Mon, 7 Jun 2021 23:36:15 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FzbPM0qzSz6wmP; Tue, 8 Jun 2021 11:31:19 +0800 (CST) Received: from dggema757-chm.china.huawei.com (10.1.198.199) by dggemv711-chm.china.huawei.com (10.1.198.66) 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 5/9] drivers/perf: Simplify EVENT ATTR macro in qcom_l3_pmu.c Date: Tue, 8 Jun 2021 11:33:17 +0800 Message-ID: <1623123201-45634-6-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 L3CACHE_EVENT_ATTR. Cc: Andy Gross Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Qi Liu --- drivers/perf/qcom_l3_pmu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/perf/qcom_l3_pmu.c b/drivers/perf/qcom_l3_pmu.c index bba0780..2b18e44 100644 --- a/drivers/perf/qcom_l3_pmu.c +++ b/drivers/perf/qcom_l3_pmu.c @@ -647,10 +647,7 @@ static ssize_t l3cache_pmu_event_show(struct device *dev, } #define L3CACHE_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ - { .attr = __ATTR(_name, 0444, l3cache_pmu_event_show, NULL), \ - .id = _id, } \ - })[0].attr.attr) + PMU_EVENT_ATTR_ID(_name, l3cache_pmu_event_show, _id) static struct attribute *qcom_l3_cache_pmu_events[] = { L3CACHE_EVENT_ATTR(cycles, L3_EVENT_CYCLES), -- 2.7.4