Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7517725imu; Tue, 22 Jan 2019 07:17:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN7TZDbxD6gPehrFmfPeSfYbu3Th5HeeE4zLlRJ80lSntgHdQ/pTA8fTSvb8sv6ecNA5Hr6j X-Received: by 2002:a62:7c47:: with SMTP id x68mr34140065pfc.209.1548170244413; Tue, 22 Jan 2019 07:17:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170244; cv=none; d=google.com; s=arc-20160816; b=KWY3jyuagYn2Z+RpgJ3ys0BxFHNboyjrU74ThdZ+5jiyyv8ODSkHAYGgIpNxOHjDyv 2r9GaeVp6+qVByaW7CaUecGgKEgy54VUdICpZUgy4r2Vba+wCNZhj89XBGZwTH1zRVjP iIJHcXItLyupK6ZXk0cB6aOtGC3PfRgM1PlGoTq/XuM7wvDPxq1CudaqjX8HRfjytTZO EJGesz41hnQ6Xw/lsIYFfn1GIpxNxoK5Pbmt0MblzX+qnvLOz+QUErKcHy19FylN6gDG qt2r8T0CAEFsA36FhsqWYsVKp56j57GrlnVyVWVq+PpzLqKPF6ADLtzBB2KL1UVfN1zX ommg== 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=WGrorGrjLzBheJQXKa6xFTeT8t42b3/qWySPC+4RA7o=; b=l5fKysXOjKu/LsmmKODpFyAGFSEH+Xp0uzIqJgOFDUk4THLSyQO+/d5/S8nXNm34JB le2EK8ln2n9ka9Y9GrFTD9VBMD3TX/CChsgokVIc5PWb/7GB+xbmwHdtfTuMPNPLtrBF BgvrnVuxwB68wYK567IdksOtP8ehvI7rU8lppkeQghrLekwsX4hi5ySC3FfScm7eSjaU b8xWucqfmVudUHEQ5AD7VGuSwzIbh+ezEY75eov/pw/9gp6o/bEYq2f8k2NJL9rUa2/c ZmTzMvjGb8pbF+LCAOyXaY+RrfVI4uD98gkTdFLteldKngjtcIQHAhcp6fiF/gdPaiVi F60g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WqCBMm70; 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 v11si15816741plp.85.2019.01.22.07.17.07; Tue, 22 Jan 2019 07:17:24 -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=WqCBMm70; 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 S1729141AbfAVPOu (ORCPT + 99 others); Tue, 22 Jan 2019 10:14:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:54404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729199AbfAVPOs (ORCPT ); Tue, 22 Jan 2019 10:14:48 -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 81A3C217D6; Tue, 22 Jan 2019 15:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170087; bh=vUng/3Gdb3oYCxJxe2+j1CCWbQwGwRefUqh8xBlE5wY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WqCBMm70GDCL7uH2zNImPNcxOTmzD/xiG0ZU2eQCEvQ8hUMLPGI2AUyTjlVoIUF80 nEN1TTKKnVm+Dkq02s5wUhFjANshzZCo9Fh/j7rNYnuXXZBX2J08hBUcxacNaClzL4 J90mfo1vSZb+uIDjmGRCRs4iKlVOSYQx5sLaasuc= From: Greg Kroah-Hartman To: Herbert Xu , David Miller Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Srikanth Jampala , Yangtao Li , Gadam Sreerama , Eric Biggers Subject: [PATCH 5/7] crypto: cavium: nitrox: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:14:20 +0100 Message-Id: <20190122151422.14204-6-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: Srikanth Jampala Cc: Yangtao Li Cc: Gadam Sreerama Cc: Eric Biggers Cc: linux-crypto@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/cavium/nitrox/nitrox_debugfs.c | 27 ++++--------------- drivers/crypto/cavium/nitrox/nitrox_debugfs.h | 5 ++-- drivers/crypto/cavium/nitrox/nitrox_main.c | 4 +-- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/drivers/crypto/cavium/nitrox/nitrox_debugfs.c b/drivers/crypto/cavium/nitrox/nitrox_debugfs.c index 0196b992280f..848ec93d4333 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_debugfs.c +++ b/drivers/crypto/cavium/nitrox/nitrox_debugfs.c @@ -55,31 +55,14 @@ void nitrox_debugfs_exit(struct nitrox_device *ndev) ndev->debugfs_dir = NULL; } -int nitrox_debugfs_init(struct nitrox_device *ndev) +void nitrox_debugfs_init(struct nitrox_device *ndev) { - struct dentry *dir, *f; + struct dentry *dir; dir = debugfs_create_dir(KBUILD_MODNAME, NULL); - if (!dir) - return -ENOMEM; ndev->debugfs_dir = dir; - f = debugfs_create_file("firmware", 0400, dir, ndev, - &firmware_fops); - if (!f) - goto err; - f = debugfs_create_file("device", 0400, dir, ndev, - &device_fops); - if (!f) - goto err; - f = debugfs_create_file("stats", 0400, dir, ndev, - &stats_fops); - if (!f) - goto err; - - return 0; - -err: - nitrox_debugfs_exit(ndev); - return -ENODEV; + debugfs_create_file("firmware", 0400, dir, ndev, &firmware_fops); + debugfs_create_file("device", 0400, dir, ndev, &device_fops); + debugfs_create_file("stats", 0400, dir, ndev, &stats_fops); } diff --git a/drivers/crypto/cavium/nitrox/nitrox_debugfs.h b/drivers/crypto/cavium/nitrox/nitrox_debugfs.h index a8d85ffa619c..f177b79bbab0 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_debugfs.h +++ b/drivers/crypto/cavium/nitrox/nitrox_debugfs.h @@ -5,12 +5,11 @@ #include "nitrox_dev.h" #ifdef CONFIG_DEBUG_FS -int nitrox_debugfs_init(struct nitrox_device *ndev); +void nitrox_debugfs_init(struct nitrox_device *ndev); void nitrox_debugfs_exit(struct nitrox_device *ndev); #else -static inline int nitrox_debugfs_init(struct nitrox_device *ndev) +static inline void nitrox_debugfs_init(struct nitrox_device *ndev) { - return 0; } static inline void nitrox_debugfs_exit(struct nitrox_device *ndev) diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox/nitrox_main.c index 014e9863c20e..faa78f651238 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_main.c +++ b/drivers/crypto/cavium/nitrox/nitrox_main.c @@ -404,9 +404,7 @@ static int nitrox_probe(struct pci_dev *pdev, if (err) goto pf_hw_fail; - err = nitrox_debugfs_init(ndev); - if (err) - goto pf_hw_fail; + nitrox_debugfs_init(ndev); /* clear the statistics */ atomic64_set(&ndev->stats.posted, 0); -- 2.20.1