From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f68.google.com ([209.85.208.68]:37637 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726249AbeHRQc2 (ORCPT ); Sat, 18 Aug 2018 12:32:28 -0400 Received: by mail-ed1-f68.google.com with SMTP id b10-v6so5979093eds.4 for ; Sat, 18 Aug 2018 06:24:45 -0700 (PDT) From: Rasmus Villemoes To: Alexander Viro Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , linux-fsdevel@vger.kernel.org Subject: [PATCH v2 2/8] seq_file: use seq_open_data in single_open Date: Sat, 18 Aug 2018 15:24:28 +0200 Message-Id: <20180818132434.9515-2-linux@rasmusvillemoes.dk> In-Reply-To: <20180818132434.9515-1-linux@rasmusvillemoes.dk> References: <20180818132434.9515-1-linux@rasmusvillemoes.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Avoid the somewhat hard to grok assignment by using the seq_open_data helper. Signed-off-by: Rasmus Villemoes --- fs/seq_file.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/seq_file.c b/fs/seq_file.c index c8c86660f6db..518a72e444d9 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -582,10 +582,8 @@ int single_open(struct file *file, int (*show)(struct seq_file *, void *), op->next = single_next; op->stop = single_stop; op->show = show; - res = seq_open(file, op); - if (!res) - ((struct seq_file *)file->private_data)->private = data; - else + res = seq_open_data(file, op, data); + if (res) kfree(op); } return res; -- 2.16.4