From patchwork Sat Aug 18 13:24:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 959198 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41t19K2m4Dz9s3C for ; Sat, 18 Aug 2018 23:28:21 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="GBJHUm+s"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41t19K05bNzF0ph for ; Sat, 18 Aug 2018 23:28:21 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="GBJHUm+s"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=rasmusvillemoes.dk (client-ip=2a00:1450:4864:20::542; helo=mail-ed1-x542.google.com; envelope-from=linux@rasmusvillemoes.dk; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="GBJHUm+s"; dkim-atps=neutral Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41t15J2jqWzF0gL for ; Sat, 18 Aug 2018 23:24:52 +1000 (AEST) Received: by mail-ed1-x542.google.com with SMTP id b10-v6so5979156eds.4 for ; Sat, 18 Aug 2018 06:24:52 -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=8VU5yC6/rVj1cdBxmXTz6KDrCfPGY9v3moT0miaymQE=; b=GBJHUm+sKe6qQ5yDR8bHK+tVqeXmzOJDrraEDyzqKAgsgil4x+zzHoppHV2ZY+a8Nv NPiXZXYoLnsSdH6KPfjCtycFzQPgi8by9RHiAsiEN5sdiAFuiO2ijd22T8VG4f+vaWNY EixNlHZ/0y50HgVwplKQ4fiJ8zKEg3k9G81CQ= 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=8VU5yC6/rVj1cdBxmXTz6KDrCfPGY9v3moT0miaymQE=; b=h7flznlao6LByZTaMDfjB3cThlJA85oGqzOhsh2ZAnBYdOQXGmDr2InQDF1URZ9Jfx YxAnq3vFWz90QfQj6XDUt+8LtEcZAbnDzbYynF59KYPmgzjEYaH4Lw7RsZUxR4Ul/9CI CuIxgIghMy8u86MgmgLgEtthC5Iq7W5yhAhB5RkMaFlDLAbsIIO1nzHUfv4wiiqZlV6C UOTD4r4sLauT2jTvqTeLWbddLHfsPu+znriBcAOMRHndTF0n2qIjVYmPnLJPi6uWCW3B 1md6aeJj3SSXo5KB6gOVF9W8fpPl/MaC0A9aMq/vdWmK5gFp0C6XhL6+JEh0ns/Ux6b9 3lNw== X-Gm-Message-State: AOUpUlGvslfbLf38ozkTHx8Ve4xH0GFds8nn3b0hImmLTgpEmtBkaBmf k8zkignk4EnRbwLu6CyiQJ0wmg== X-Google-Smtp-Source: AA+uWPwgeZA84nYD9ZPnUcEiW811y1y7X6MaCAcrvtytZRPdjHKjtpaCMn4/jVoCnUtfZQMRF6yTDA== X-Received: by 2002:a50:f78a:: with SMTP id h10-v6mr45249569edn.37.1534598689645; Sat, 18 Aug 2018 06:24:49 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Aug 2018 06:24:49 -0700 (PDT) From: Rasmus Villemoes To: Michael Ellerman Subject: [PATCH v2 7/8] powerpc/pseries: use seq_open_data in hcall_inst_seq_open Date: Sat, 18 Aug 2018 15:24:33 +0200 Message-Id: <20180818132434.9515-7-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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, Rasmus Villemoes , linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- Depends on 1/8 introducing seq_open_data. arch/powerpc/platforms/pseries/hvCall_inst.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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 = {