Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp35011pxk; Tue, 15 Sep 2020 19:29:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh7VDYYrt1XGvAs5W/gfHGeK6ssY54/LJi6LXXIJX/qfKI4z9cEjrWBD9EEKjoDe1Kphrj X-Received: by 2002:a17:906:c0d0:: with SMTP id bn16mr11841128ejb.279.1600223388492; Tue, 15 Sep 2020 19:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600223388; cv=none; d=google.com; s=arc-20160816; b=VfM001/U7cN9k9UTvQ461JY4e5AZTsZqnH5OmWGo/Bm/Cmy5aYsPeOKl3VC4QNu+62 g9PPMWJQf1SJvLCdYp2jCOzAYdgJyUoNiOHBZU1sEr0S2aQJf7uLm1gfMVjwSHfjiiL0 BrApnJayO9tOlOCeunu1yRVFzEmeKuBOf1J2ryPkNcuOkFhgiE69mpCFpf0OqV9YUJ0B PxCYKLbur1kVI+nqU5SSKyfSflaxqjiXG5+3I2eTjAWPUbgoJvP042Aq7le0jAtpaHZm CY+Jgji5qXM/Dv1jROF03hGpH3JS2FoHVZRepHRljxp5+BNu0qhlXFeLDPbc9xTk2BBy A2Jw== 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=RXSDaVmBhjiUWGIQPQM1s6cixu7nm0GnBea5Bj0GrkM=; b=xbP5olgPGIiafW0X9ehVsF6MUczWvditmmJBjcpZ6jRjx1KivUoXyoLesmR0IARaVz n2qSkw1C+tdmWjSCRi9jp3uWR4tEaq4HdVMDdJBC2kmYnbwX8oIAlVpRPAe3O83HVjZt iJidfrEirNOx1s6xHhcXMmS46XxI1t4aag9YtIu65WXcLYtjZB9XEhhw0597zbPMqK4n M3WCUn6Ss44dEj5pOuCMYB++Xj7kFOeIOs4KFAa62soC5UdLJLbJnMywmIBEb04OhUlZ NaA3K1koFuMdcTzWidIoz2skEFiaIgZdcNFVWfJjKodjSXSkpC8Qqqcz3wldumaV0V7J oCvQ== 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 p13si10707509edh.353.2020.09.15.19.29.25; Tue, 15 Sep 2020 19:29:48 -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 S1726440AbgIPC2R (ORCPT + 99 others); Tue, 15 Sep 2020 22:28:17 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12718 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726168AbgIPC17 (ORCPT ); Tue, 15 Sep 2020 22:27:59 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 678E9B7BD0C502CE24B5; Wed, 16 Sep 2020 10:27:58 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 16 Sep 2020 10:27:47 +0800 From: Liu Shixin To: Marc Zyngier , James Morse , "Julien Thierry" , Suzuki K Poulose , Catalin Marinas , "Will Deacon" CC: , , Liu Shixin Subject: [PATCH -next] KVM: arm64: vgic-debug: convert to use DEFINE_SEQ_ATTRIBUTE macro Date: Wed, 16 Sep 2020 10:50:23 +0800 Message-ID: <20200916025023.3992679-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/arm64/kvm/vgic/vgic-debug.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index b13a9e3f99dd..f38c40a76251 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -260,34 +260,14 @@ static int vgic_debug_show(struct seq_file *s, void *v) return 0; } -static const struct seq_operations vgic_debug_seq_ops = { +static const struct seq_operations vgic_debug_sops = { .start = vgic_debug_start, .next = vgic_debug_next, .stop = vgic_debug_stop, .show = vgic_debug_show }; -static int debug_open(struct inode *inode, struct file *file) -{ - int ret; - ret = seq_open(file, &vgic_debug_seq_ops); - if (!ret) { - struct seq_file *seq; - /* seq_open will have modified file->private_data */ - seq = file->private_data; - seq->private = inode->i_private; - } - - return ret; -}; - -static const struct file_operations vgic_debug_fops = { - .owner = THIS_MODULE, - .open = debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release -}; +DEFINE_SEQ_ATTRIBUTE(vgic_debug); void vgic_debug_init(struct kvm *kvm) { -- 2.25.1