Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7516610imu; Tue, 22 Jan 2019 07:16:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN5b5MWhDPmbMYBXSdRQq/cR9VfNbVsHDiBvyZRMB8waU4RL3ty8Xqzdh6rgZIQdfpq1cgqP X-Received: by 2002:a17:902:f64:: with SMTP id 91mr20728868ply.132.1548170192919; Tue, 22 Jan 2019 07:16:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170192; cv=none; d=google.com; s=arc-20160816; b=kxZa7tNJvXLNN3IJ84wW6t0oqgoBwUXMNVTKpNYEr+BYBlHvTPoNKQx0o/qKyKbnWs 2TmW/AeMXaMk9DCAt1k3yIGKbgWXyeetOx7Iy0Q6DgjZ0Tp7xRjYGDYcwvH51vEUYv2c GkyjuYnAM0MA0fjzdvxH9NpHo+/VThAKXYzQefL2WPGoBPWQC7X7D+yg1bZU40CSrXvp mWz0Myd2kvHVxcOmu4JPjYHWmrnPclKpjyif6PVRv0wiasLFD2KU8EYN8NPV/8FuxVLY vc0AKx2KJrkyNfJW7aAIZbkI376i8k5ifY6/mXqoyMe2yEHWA9fcirWBB4bNtocvgYUA pWhQ== 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=+VvsndRcMowd12UuL3rt3/+l259d6LTKPbkgvvcivvA=; b=OYXNPUksrYjRlRP/qfNhhXfb7nU8OvqS4S64jhiDSt6k4kKWa9RNmotcTg/o8GYnLK DnBSSG2ueWSJknwzox1lAezRHslY6uQmtxTud8wHSBW1iUe/b2G29Pt8Mho2nD861y+T XrdHzhNOyJYlnEtQQiINFGpl63hOTtrF41xFJQ1w+dOkSHXB1ShdVpe5gzjJ1DwazvWK FRTT01AOBHvXts6z+b5Gej4AC6qZC4BtK1cLrgi2u2gGf/nIQOkWIgKENlCNwfYojSwl o929KNhXorH0CEKyQDwcJxLFIaGcPdp8nBAkgw+xfDcImSEYWQ8ovZn+IooCgBKQw49a rSTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MtFVwwMK; 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 e13si16954540pgh.251.2019.01.22.07.16.15; Tue, 22 Jan 2019 07:16:32 -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=MtFVwwMK; 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 S1729290AbfAVPOq (ORCPT + 99 others); Tue, 22 Jan 2019 10:14:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:54308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729199AbfAVPOp (ORCPT ); Tue, 22 Jan 2019 10:14:45 -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 E84F6217D4; Tue, 22 Jan 2019 15:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170084; bh=pdbZX+e4YaHZHBBu2G1bBtBhTN0QM+ePWfjLnLkX1eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MtFVwwMK4eO7yrOesrEBE+Mju+V+R/xSkFM0dpRjAX0r7x23OUW3kdEjqKYx6L1Ng X1Tp8wGdk6GPjGvAqBTUOII5FLV1gmEYuwLvjSLcfJQq40Ml3BvxUTQydn1u0LdSMm Y4pFixfZebdj0MHHiPvWzXziFfNtumj6Mm9VXraw= From: Greg Kroah-Hartman To: Herbert Xu , David Miller Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Robert Richter , Jan Glauber Subject: [PATCH 4/7] crypto: cavium: zip: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:14:19 +0100 Message-Id: <20190122151422.14204-5-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: Herbert Xu Cc: "David S. Miller" Cc: Robert Richter Cc: Jan Glauber Cc: linux-crypto@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/cavium/zip/zip_main.c | 52 ++++++---------------------- 1 file changed, 11 insertions(+), 41 deletions(-) diff --git a/drivers/crypto/cavium/zip/zip_main.c b/drivers/crypto/cavium/zip/zip_main.c index be055b9547f6..e6b09e784e66 100644 --- a/drivers/crypto/cavium/zip/zip_main.c +++ b/drivers/crypto/cavium/zip/zip_main.c @@ -618,41 +618,23 @@ static const struct file_operations zip_regs_fops = { /* Root directory for thunderx_zip debugfs entry */ static struct dentry *zip_debugfs_root; -static int __init zip_debugfs_init(void) +static void __init zip_debugfs_init(void) { - struct dentry *zip_stats, *zip_clear, *zip_regs; - if (!debugfs_initialized()) - return -ENODEV; + return; zip_debugfs_root = debugfs_create_dir("thunderx_zip", NULL); - if (!zip_debugfs_root) - return -ENOMEM; /* Creating files for entries inside thunderx_zip directory */ - zip_stats = debugfs_create_file("zip_stats", 0444, - zip_debugfs_root, - NULL, &zip_stats_fops); - if (!zip_stats) - goto failed_to_create; - - zip_clear = debugfs_create_file("zip_clear", 0444, - zip_debugfs_root, - NULL, &zip_clear_fops); - if (!zip_clear) - goto failed_to_create; - - zip_regs = debugfs_create_file("zip_regs", 0444, - zip_debugfs_root, - NULL, &zip_regs_fops); - if (!zip_regs) - goto failed_to_create; + debugfs_create_file("zip_stats", 0444, zip_debugfs_root, NULL, + &zip_stats_fops); - return 0; + debugfs_create_file("zip_clear", 0444, zip_debugfs_root, NULL, + &zip_clear_fops); + + debugfs_create_file("zip_regs", 0444, zip_debugfs_root, NULL, + &zip_regs_fops); -failed_to_create: - debugfs_remove_recursive(zip_debugfs_root); - return -ENOENT; } static void __exit zip_debugfs_exit(void) @@ -661,13 +643,8 @@ static void __exit zip_debugfs_exit(void) } #else -static int __init zip_debugfs_init(void) -{ - return 0; -} - +static void __init zip_debugfs_init(void) { } static void __exit zip_debugfs_exit(void) { } - #endif /* debugfs - end */ @@ -691,17 +668,10 @@ static int __init zip_init_module(void) } /* comp-decomp statistics are handled with debugfs interface */ - ret = zip_debugfs_init(); - if (ret < 0) { - zip_err("ZIP: debugfs initialization failed\n"); - goto err_crypto_unregister; - } + zip_debugfs_init(); return ret; -err_crypto_unregister: - zip_unregister_compression_device(); - err_pci_unregister: pci_unregister_driver(&zip_driver); return ret; -- 2.20.1