Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp35154pxk; Tue, 15 Sep 2020 19:30:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaOf0wKioWzzEMGq+MsyQwxAN3vLXrTg8HGhJa/1C3sprJqKwRjWrpUruHkN6fYGTiyRSB X-Received: by 2002:a17:906:6a50:: with SMTP id n16mr22590222ejs.107.1600223407104; Tue, 15 Sep 2020 19:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600223407; cv=none; d=google.com; s=arc-20160816; b=GCtXS2bUxdeQM3tNJok71n5TvezWsp3hwCfeJYkTeKq1ELq5wcaSRpluyeqc0Krxin jX50DpuD4S64k3KJc4At1uaDZgLZWn4CFwW47Gh4cgWVokWSf81tUfLDQMJaPS0ElBTp eE0sEK54PN6PmMMGY4tPGHry11uizf9eLjEcZ5f3VSpaQ8HSCzq4psyDwvniqg7L4tbI U0SKyu71qgstj6O1/E9grSoUD6eEw04sk6m678LnUVgR9SiG71To+fTM1z+7SepmQyGx kp7Ps5ckYq8MkDWUDNK3y83rHw7FJyTyfPIV+izp+NpaOwZKcXUq0cQna52++yQ96fBj 1eXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+5E/fKAKZ06R/FCmTSYqfMNvt9RCCL//vt6c69wFa9U=; b=mqOoVrFk4iuKU40NZ+mimSmA8rlAnG2+KdqceD3oDCXUKbWOgNo3XowocpcCDnRKTl TGnekCovWredtSsPxBpqC9EfMEl2Uj14/kzddpQJnyV4PZaDA4Xwz35FJNDcsjiQj50q 6BncqFFLDjw5ReFLFJVedVgKRK98iU9MNPsSbPyFXLgtPexfB9l15nwhpuyC6DKVVdKh WcVUblup+HLArLhnNSVlPEhhdqi1pCrxo4bivcuoqcXXyKpjil6ZEPCcrSRfrRxoWqxS 7h/cEN9FKNjD/vURKX2DNWIHqc5J+ifb203XElDyX3hu0q9vLmedzSUSxmaXoXVrXzMt haiQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ap10si10798592ejc.106.2020.09.15.19.29.44; Tue, 15 Sep 2020 19:30:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726479AbgIPC2m (ORCPT + 99 others); Tue, 15 Sep 2020 22:28:42 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:58390 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726200AbgIPC2F (ORCPT ); Tue, 15 Sep 2020 22:28:05 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9B40F1EE6CC59AE4601; Wed, 16 Sep 2020 10:28:00 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Wed, 16 Sep 2020 10:27:51 +0800 From: Liu Shixin To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras CC: , , "Liu Shixin" Subject: [PATCH -next] powerpc/pseries: convert to use DEFINE_SEQ_ATTRIBUTE macro Date: Wed, 16 Sep 2020 10:50:26 +0800 Message-ID: <20200916025026.3992835-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin --- arch/powerpc/platforms/pseries/hvCall_inst.c | 23 +++----------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index c40c62ec432e..2c59b4986ea5 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c @@ -70,31 +70,14 @@ static int hc_show(struct seq_file *m, void *p) return 0; } -static const struct seq_operations hcall_inst_seq_ops = { +static const struct seq_operations hcall_inst_sops = { .start = hc_start, .next = hc_next, .stop = hc_stop, .show = hc_show }; -static int hcall_inst_seq_open(struct inode *inode, struct file *file) -{ - int rc; - struct seq_file *seq; - - rc = seq_open(file, &hcall_inst_seq_ops); - seq = file->private_data; - seq->private = file_inode(file)->i_private; - - return rc; -} - -static const struct file_operations hcall_inst_seq_fops = { - .open = hcall_inst_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; +DEFINE_SEQ_ATTRIBUTE(hcall_inst); #define HCALL_ROOT_DIR "hcall_inst" #define CPU_NAME_BUF_SIZE 32 @@ -149,7 +132,7 @@ static int __init hcall_inst_init(void) snprintf(cpu_name_buf, CPU_NAME_BUF_SIZE, "cpu%d", cpu); debugfs_create_file(cpu_name_buf, 0444, hcall_root, per_cpu(hcall_stats, cpu), - &hcall_inst_seq_fops); + &hcall_inst_fops); } return 0; -- 2.25.1