Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4964141pxj; Wed, 9 Jun 2021 06:17:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfJkvfKWFpWb1ZpDTbFS2dzHCoX9NhYrdGh3L1MkowuEMsH+F+4zW2KNiXP87WYQ6kio8y X-Received: by 2002:a05:6402:5207:: with SMTP id s7mr2156259edd.363.1623244676794; Wed, 09 Jun 2021 06:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623244676; cv=none; d=google.com; s=arc-20160816; b=FRkzQ2n9F7zpqflVM3euQ+p5PwtAMaG0i6HLk2sJg0/p59LufezLfwVAVXb1PArMEO lLsJbDJvz4esnPIwHtGvwER46CyhptyMlQzbkF8q0I+dQpQm4dqyFCcwkjN+m3FGO79m vk8w5CLPuuNcFZ2xH+t9JKrsly8AOuGEFEtNYvpGyUBHxiLyTfssaZYspA3vvNyYuLnV +CwGDgRttRuo+fFnpDEOsT9nqbV5GdRKkB0aTTb/lirCNwAVTcN6aekjnZkEyH92zVkU XRrhRn1WHRhjs5LzB2wrt5bsKZH6j4SKUxfr1q8muK8vqaNJ/eGf93+C5Ci3+yF0EOnc oJvA== 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=JTycWgow7y7uR8CCI8g4QeFh0PDBfEd8Y55EqUmcnV8=; b=tXwj9YW+ihys5EMPRbwtTr2dMWxHTtBF/vydnSOTEU9+ARV1Na3VyJUbk85eJ+CMrb rBRcfjDrSNLBgtGDNtrjL82wMRlFfg2aV/NKlXrunlzbdk4yKQLmzevBj5LjAml1kyXg zHuKcOSeJBd8Gcl2D5DDcmHPSkVEZdzuqRFq4ZcR9dVvyfLoD5rlheNWXxHjbGSeOi7W KTz9/eXCkseAp3jfTMzpJDstpl4Gz7BoBSz/CdDGmrKnsem2DrKj1Yzh6vchahdJiSxQ zdc2Q6/iEOExaTiS2X5ThcPsj7y3ZitGyZbPTXo6SxNQi7M/xMdQxs0Ozge5Lk/fq1ZM ipQw== 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 d10si2430981ejc.427.2021.06.09.06.17.32; Wed, 09 Jun 2021 06:17:56 -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 S236882AbhFIGoG (ORCPT + 99 others); Wed, 9 Jun 2021 02:44:06 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:5298 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233849AbhFIGn4 (ORCPT ); Wed, 9 Jun 2021 02:43:56 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4G0HTJ2Hpvz1BKSw; Wed, 9 Jun 2021 14:37:08 +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; 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: , Andy Gross , Mark Rutland Subject: [PATCH v4 4/7] drivers/perf: Simplify EVENT ATTR macro in qcom_l3_pmu.c Date: Wed, 9 Jun 2021 14:41:00 +0800 Message-ID: <1623220863-58233-5-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 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 0812735..e033d89 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