Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7517057imu; Tue, 22 Jan 2019 07:16:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6oc0Km3tGrk0OTiDbLz3c7CzwMHf5hGLHUn5g5mj5cnb2C8V0rIOfP+UuuanpI2zTushd8 X-Received: by 2002:a17:902:ac1:: with SMTP id 59mr34323184plp.36.1548170214752; Tue, 22 Jan 2019 07:16:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170214; cv=none; d=google.com; s=arc-20160816; b=wdYydgI6yDXXhmhYnyc4D0XCMNQVhWlT+uqe3jND7I8TP/QkEyPHEbHioj+DRHjXRt SHhXbPLjdPHJpeVMDL1TQK+43Ggr/WM8dIfyaIa32jZItjdTfAADa4S+Fbi6QDrLFIDd 1loeNmHasGLw/qKkj10KMhTyTTPqtJaVWmu3iLSInJagMKrNj7vDF7M7OVMwop6RFhXx RrLrfR26GBnJVQFkcD3zw3kVXl2DQYd0cOMKJ6sa9V+dgjKb4n3dDc3AHIGTFO501eM1 lJQTB2duYdzAh0Wz5QyUIf3kHNbgQpWW1a+7gGmrrQ63AK668nK/lqaZznwCloCYAm/H q43w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SiEOUpFmF8datUt87LEtmfFdOUeg2GioQKpFGdcLpag=; b=I54Un0IreDAn4KkOoG/mTacVTXa2fKUQRvwJTwfiddi9o0c77uamiPqlgqIiH5wwU/ 5tHUPRzQ59n3IXTmBrEE2mQsN7U7mf0oSBLxJD9p9CNcMZxiBkE+QeZNJdsZAeujYzHN CaY5dwVpNmkZ7yGQzJbc4myXfvwSRQ737URupbYfzK41JuAHG9xOdkNWCiwARa91dHQ2 7pqzIZnE11CSsXdoYwukiGzPjt2CM/5QZD6aY0xC8/5jqPzpc89K8z7rSNJz7EznU1ku VGkhFXoXGZwFeI0luHaCMDN6e8VYbjAPVzRzrVVShN62JYvoyOxXeHLpslRClXypNPUP AJXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iZ0eftAG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14si16371044pfc.76.2019.01.22.07.16.38; Tue, 22 Jan 2019 07:16:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iZ0eftAG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729321AbfAVPOy (ORCPT + 99 others); Tue, 22 Jan 2019 10:14:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:54496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729304AbfAVPOv (ORCPT ); Tue, 22 Jan 2019 10:14:51 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8692320879; Tue, 22 Jan 2019 15:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170090; bh=pNi+plpGvyZxFABsBAWchMyav3BimwX0bOsD7fo9jVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iZ0eftAGBx4/n2UxdJBhiDLZu96vPxCTZXz626Db1qsm+zHD6Z7oj1q5fho0IJoWn vUlXC3/dZt0ytHfhWcbQtO2viHuHmzNQU4RRTdsoQE0vJ9asxzxb6Qf92ZuWzHHYFe jyuZJu10qHaYDMasDwzLN8m+gt4HXi4WClr6PuHA= From: Greg Kroah-Hartman To: Herbert Xu , David Miller Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Tom Lendacky , Gary Hook Subject: [PATCH 6/7] crypto: ccp: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:14:21 +0100 Message-Id: <20190122151422.14204-7-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122151422.14204-1-gregkh@linuxfoundation.org> References: <20190122151422.14204-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Tom Lendacky Cc: Gary Hook Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccp/ccp-debugfs.c | 36 +++++++------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/drivers/crypto/ccp/ccp-debugfs.c b/drivers/crypto/ccp/ccp-debugfs.c index 1a734bd2070a..4bd26af7098d 100644 --- a/drivers/crypto/ccp/ccp-debugfs.c +++ b/drivers/crypto/ccp/ccp-debugfs.c @@ -286,10 +286,7 @@ void ccp5_debugfs_setup(struct ccp_device *ccp) { struct ccp_cmd_queue *cmd_q; char name[MAX_NAME_LEN + 1]; - struct dentry *debugfs_info; - struct dentry *debugfs_stats; struct dentry *debugfs_q_instance; - struct dentry *debugfs_q_stats; int i; if (!debugfs_initialized()) @@ -299,24 +296,14 @@ void ccp5_debugfs_setup(struct ccp_device *ccp) if (!ccp_debugfs_dir) ccp_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); mutex_unlock(&ccp_debugfs_lock); - if (!ccp_debugfs_dir) - return; ccp->debugfs_instance = debugfs_create_dir(ccp->name, ccp_debugfs_dir); - if (!ccp->debugfs_instance) - goto err; - debugfs_info = debugfs_create_file("info", 0400, - ccp->debugfs_instance, ccp, - &ccp_debugfs_info_ops); - if (!debugfs_info) - goto err; + debugfs_create_file("info", 0400, ccp->debugfs_instance, ccp, + &ccp_debugfs_info_ops); - debugfs_stats = debugfs_create_file("stats", 0600, - ccp->debugfs_instance, ccp, - &ccp_debugfs_stats_ops); - if (!debugfs_stats) - goto err; + debugfs_create_file("stats", 0600, ccp->debugfs_instance, ccp, + &ccp_debugfs_stats_ops); for (i = 0; i < ccp->cmd_q_count; i++) { cmd_q = &ccp->cmd_q[i]; @@ -325,21 +312,12 @@ void ccp5_debugfs_setup(struct ccp_device *ccp) debugfs_q_instance = debugfs_create_dir(name, ccp->debugfs_instance); - if (!debugfs_q_instance) - goto err; - - debugfs_q_stats = - debugfs_create_file("stats", 0600, - debugfs_q_instance, cmd_q, - &ccp_debugfs_queue_ops); - if (!debugfs_q_stats) - goto err; + + debugfs_create_file("stats", 0600, debugfs_q_instance, cmd_q, + &ccp_debugfs_queue_ops); } return; - -err: - debugfs_remove_recursive(ccp->debugfs_instance); } void ccp5_debugfs_destroy(void) -- 2.20.1