Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3764754pxj; Mon, 7 Jun 2021 20:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy6rBCPeWGzdK4YUhFNSQPDOVEby4tqm8bHYlQBJNwoImV/p6vMzU25L/QLcsUiICFNgzB X-Received: by 2002:aa7:d5cf:: with SMTP id d15mr23439383eds.342.1623123456773; Mon, 07 Jun 2021 20:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623123456; cv=none; d=google.com; s=arc-20160816; b=PRmwcVfSb2lkNhXEvsxO1PrQ1Cpyh4a5aij5cyPyNRVEtLYCTUPBbuYWLAmheCi6pK z3vwkvJbqffMkREFYbZJ6fikuxCWapnX8eQtXibCXTyjPzJj2RZZ1NbHgnJD7qEz4mUq JNyXW7LszscilYMBq3st8iw3cpFaQbqfXp26sHDWCRIMcQ2/mFf8EE9yC44hKw9KXT6o cXt3l4TjRUTtPyZ043LdxXm+fM8N7jpbbU50+Da1NcTnBSUcCOLOOMDoHkEGpoKtM8oR XMX7Q3EBwUsBTSpslBJYHnjPuBtVgTGhhizs0UEyqmNVw0KnqDee4JvUo81BNIfuJmc1 1edA== 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=4G4DM38Oof8Sa8segaC3FTFtvIYIcOJGQz6STz9Qfwk=; b=zFB501xq5iw6UcgUYah6y7vIr5IlB9f2uMEIKVuJwk0Y+QBdNBUCNDxfJEo9dLflEA mlR2jvquFddl6oDZSV01oV0tRNEwhmYYPXlY1GJsRYwNSXRcOCDoeMLONRbfnDCnNYgI YcStL8FeeYUWxSUr3qJhlX/32up1Vj/X1lJpyBtmbzYDF2oc7wXaLgZmKMd8lhAOH8bh 52/yETIoU15RWEP3l0wVe99Cv+kK+th8IODNOeDL4uKTHFT0aNp17vZ4iUIxjrReuC6l nsT/CksxGdmR4BT9HprZcHt3BsLj44YR/pFh3U5J4S1znRN0YUpH5eeyXwxvwTwUGDBD u7fw== 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 q8si14207978ejy.320.2021.06.07.20.37.13; Mon, 07 Jun 2021 20:37:36 -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 S231225AbhFHDgN (ORCPT + 99 others); Mon, 7 Jun 2021 23:36:13 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:3100 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhFHDgM (ORCPT ); Mon, 7 Jun 2021 23:36:12 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FzbMD3DH9zWtTW; Tue, 8 Jun 2021 11:29:28 +0800 (CST) Received: from dggema757-chm.china.huawei.com (10.1.198.199) by dggemv704-chm.china.huawei.com (10.3.19.47) 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:43 +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:42 +0800 From: Qi Liu To: , CC: , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Will Deacon Subject: [PATCH v3 9/9] arm64: perf: Simplify EVENT ATTR macro in perf_event.c Date: Tue, 8 Jun 2021 11:33:21 +0800 Message-ID: <1623123201-45634-10-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 ARMV8_EVENT_ATTR. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Will Deacon Signed-off-by: Qi Liu --- arch/arm64/kernel/perf_event.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index f594957..3101c42 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -165,10 +165,7 @@ armv8pmu_events_sysfs_show(struct device *dev, } #define ARMV8_EVENT_ATTR(name, config) \ - (&((struct perf_pmu_events_attr) { \ - .attr = __ATTR(name, 0444, armv8pmu_events_sysfs_show, NULL), \ - .id = config, \ - }).attr.attr) + PMU_EVENT_ATTR_ID(name, armv8pmu_events_sysfs_show, config) static struct attribute *armv8_pmuv3_event_attrs[] = { ARMV8_EVENT_ATTR(sw_incr, ARMV8_PMUV3_PERFCTR_SW_INCR), -- 2.7.4