Message ID | 20180818132434.9515-7-linux@rasmusvillemoes.dk (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [v2,1/8] seq_file: introduce seq_open_data helper | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | next/apply_patch Successfully applied |
snowpatch_ozlabs/checkpatch | success | Test checkpatch on branch next |
snowpatch_ozlabs/build-ppc64le | success | Test build-ppc64le on branch next |
snowpatch_ozlabs/build-ppc64be | success | Test build-ppc64be on branch next |
snowpatch_ozlabs/build-ppc64e | success | Test build-ppc64e on branch next |
snowpatch_ozlabs/build-ppc32 | success | Test build-ppc32 on branch next |
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index 6da320c786cd..4816916dc8a1 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c @@ -92,14 +92,7 @@ static const struct seq_operations hcall_inst_seq_ops = { 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; + return seq_open_data(file, &hcall_inst_seq_ops, file_inode(file)->i_private); } static const struct file_operations hcall_inst_seq_fops = {
This code should check the return value of seq_open(); if it failed, file->private_data is NULL. But we can avoid the issue entirely and simplify the code by letting seq_open_data() set the ->private member. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> --- Depends on 1/8 introducing seq_open_data. arch/powerpc/platforms/pseries/hvCall_inst.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)