From patchwork Sat Aug 18 13:24:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10569549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5C93A139B for ; Sat, 18 Aug 2018 13:25:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A2B42A84D for ; Sat, 18 Aug 2018 13:25:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D0AE2A836; Sat, 18 Aug 2018 13:25:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A602C2A836 for ; Sat, 18 Aug 2018 13:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726306AbeHRQdK (ORCPT ); Sat, 18 Aug 2018 12:33:10 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cL+amC/EhTEPmd41EAlHN3lVoQDtEfn6cmvZ4nKzOvo=; b=gzojv32NLct438Ce4rRbM6o630C3PjAaWL0pryspZG5NNJUFuplQufVtE/XCsXWWHO 0p+tTKVI+F3srVFC8f5+gw6rVlt6FK3dNTq2IyRPpOBtRs8ot38ULJw/OJZGWbS3jkau snFCK56WRhNUKAW/ezp6+oinhPJ9mcCJScVXk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cL+amC/EhTEPmd41EAlHN3lVoQDtEfn6cmvZ4nKzOvo=; b=T3uxjTvC6czqueQ5oW/Vbo2IxFiSOdRBAuPPY7RWTJg9RlKbZ9xKiJ5t/67zyhblfg mkIMJPAvj74A4yj9tINwS4u+ZTGQkCzG4yngvd+Oa4BtJYAk4PxythdR6WkJnpzFmgzb zFBj93/VN73RIjZTJyRZrkd4411tj6F6BMHwAbBUVbPGr3cS9J9/OdqnCCMDnYeNn7XD 90KGV9EiUlntCl9OVJSDKikHZmIsJifsnyVP2KhGfCllFjN+DJK1eD5mbaGe6Uvsuj6L AA6QL4BheCELB2wqG4Gkuw7/itJWyKIXzyPAlOj9jxMLJZVnBDbd9fPC0DT4+PTmcb2I kNaw== X-Gm-Message-State: AOUpUlFKRHkNnYZKFhBy70IKKzO/j4HOlpKGndRpD3DCQyyQEEO/W0Gm tXVwbzTOqajsT6Vj8oKbAnetJw== X-Google-Smtp-Source: AA+uWPwWun/4mMAkZ0+BhUifYyVaxX75RDphjddyTbgQoclYbztLcvqPXPweZIf/ImOcuJ5wUEvIVQ== X-Received: by 2002:a50:a2e5:: with SMTP id 92-v6mr48377120edm.106.1534598684438; Sat, 18 Aug 2018 06:24:44 -0700 (PDT) Received: from prevas-ravi.waoo.dk (dhcp-5-186-114-212.cgn.ip.fibianet.dk. [5.186.114.212]) by smtp.gmail.com with ESMTPSA id a11-v6sm2739032edn.95.2018.08.18.06.24.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Aug 2018 06:24:44 -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> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180818132434.9515-1-linux@rasmusvillemoes.dk> References: <20180818132434.9515-1-linux@rasmusvillemoes.dk> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;