Skip to content

Commit cb62e0b

Browse files
Liu ShixinMarc Zyngier
authored andcommitted
KVM: arm64: vgic-debug: Convert to use DEFINE_SEQ_ATTRIBUTE macro
Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin <liushixin2@huawei.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20200916025023.3992679-1-liushixin2@huawei.com
1 parent 8a4374f commit cb62e0b

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

‎arch/arm64/kvm/vgic/vgic-debug.c‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -260,34 +260,14 @@ static int vgic_debug_show(struct seq_file *s, void *v)
260260
return 0;
261261
}
262262

263-
static const struct seq_operations vgic_debug_seq_ops = {
263+
static const struct seq_operations vgic_debug_sops = {
264264
.start = vgic_debug_start,
265265
.next = vgic_debug_next,
266266
.stop = vgic_debug_stop,
267267
.show = vgic_debug_show
268268
};
269269

270-
static int debug_open(struct inode *inode, struct file *file)
271-
{
272-
int ret;
273-
ret = seq_open(file, &vgic_debug_seq_ops);
274-
if (!ret) {
275-
struct seq_file *seq;
276-
/* seq_open will have modified file->private_data */
277-
seq = file->private_data;
278-
seq->private = inode->i_private;
279-
}
280-
281-
return ret;
282-
};
283-
284-
static const struct file_operations vgic_debug_fops = {
285-
.owner = THIS_MODULE,
286-
.open = debug_open,
287-
.read = seq_read,
288-
.llseek = seq_lseek,
289-
.release = seq_release
290-
};
270+
DEFINE_SEQ_ATTRIBUTE(vgic_debug);
291271

292272
void vgic_debug_init(struct kvm *kvm)
293273
{

0 commit comments

Comments
 (0)