Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7516391imu; Tue, 22 Jan 2019 07:16:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN564WcN4VN9hVI8o5Lc48A/WhKdhc9QZE/mN4lZG43zrUzcoKno5OTXzGoM8qFT5xjcBx24 X-Received: by 2002:a17:902:934a:: with SMTP id g10mr33254423plp.172.1548170183782; Tue, 22 Jan 2019 07:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170183; cv=none; d=google.com; s=arc-20160816; b=yDPZWPlmDk4GBTWNY0mwXd+ik6P0PzO8LMt12wmr+cv0HLNaG8+bfsFSbcJc5/h1Ni al0AhDSMIwyQHxGR5DWBhPkF6OcrykCgJh+w+18WTxiiGJTMMV1e8Sm+E7wKX5jmiAda SQ9t+b0LskqaLOczJUlqnGqsPQK3p616R3brs2RLHYrAgAHYi2jL/ZzGHjx4pyzsLFPy d978GEMN2vCEDgY27V3/wrTxnxJVLoFSR1sFWwF++3LOvh67nZjEHC7YorxLWChgEzcC rJ/hNKjHivDoRTpA3QMiUuhzyov7Q7tFSpJIFJN6fBX+E51OMaL1lc/BKriH1htvjY7d UWdw== 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=0drmkU50XVH8/zzIZFSlOZuYFusKkek0xI/+asHkbUU=; b=WWMOvOr2fP7ZhHaq1XPM5e8KUKR9DN3OQ7TiaU4Z9peeILsfrx2DXrJUKG1Ew9IhrZ jxyqkBaCdXyfk47kNUN4TEhrrUcUZuhp6/OrUfy6GDcVMv7zHsRq5LiD68Ls1lDbd9y4 l8yCxZhk8fkhtewmeCyKXdhvKGUzQb7rQCy3rLT+u+KrN8Sf1R96dwhJEa1R1ZfH+1Z2 AXDgDaXiMy4LpW6pTR2uH+mlysaaABg8yprKKUwZsf6jsXlO0I3zFleBbJqDs5h+7bRD AgOXf1jZNhHBygSymtXcl4qCQTv4hqtGNxDuMqq19tO/OctNNoZ7FsmTmLuCdi+9Ed9z ngMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lx9qJgVk; 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 90si16320047plb.17.2019.01.22.07.16.07; Tue, 22 Jan 2019 07:16:23 -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=lx9qJgVk; 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 S1729262AbfAVPOm (ORCPT + 99 others); Tue, 22 Jan 2019 10:14:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:54110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbfAVPOj (ORCPT ); Tue, 22 Jan 2019 10:14:39 -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 3F28C217D4; Tue, 22 Jan 2019 15:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170078; bh=a38eLIHakff3RxdEo1/Wa7SAAon1dgSDDFEp8T+OyX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lx9qJgVkrDzgmX55H/S5PnivaGgWunzrm5Jmgftxgq925pBtf6obUwzdVZFI1KJhm BSixnrAN9fkrIgCXjkeDDMJfRx0e1wTvkIUhiquy9EJPG9OX1rXM5fZ1EJWKsmmdxl EFgwMek6V+iWA5p6HK+gWre3KiVRwvyDS8JAJTCc= From: Greg Kroah-Hartman To: Herbert Xu , David Miller Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Yael Chemla , Gilad Ben-Yossef Subject: [PATCH 2/7] crypto: ccrree: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:14:17 +0100 Message-Id: <20190122151422.14204-3-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: Yael Chemla Cc: Gilad Ben-Yossef Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccree/cc_debugfs.c | 22 +++------------------- drivers/crypto/ccree/cc_debugfs.h | 8 ++------ drivers/crypto/ccree/cc_driver.c | 7 +------ 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/drivers/crypto/ccree/cc_debugfs.c b/drivers/crypto/ccree/cc_debugfs.c index 5ca184e42483..5fa05a7bcf36 100644 --- a/drivers/crypto/ccree/cc_debugfs.c +++ b/drivers/crypto/ccree/cc_debugfs.c @@ -39,11 +39,9 @@ static struct debugfs_reg32 debug_regs[] = { CC_DEBUG_REG(AXIM_MON_COMP), }; -int __init cc_debugfs_global_init(void) +void __init cc_debugfs_global_init(void) { cc_debugfs_dir = debugfs_create_dir("ccree", NULL); - - return !cc_debugfs_dir; } void __exit cc_debugfs_global_fini(void) @@ -56,7 +54,6 @@ int cc_debugfs_init(struct cc_drvdata *drvdata) struct device *dev = drvdata_to_dev(drvdata); struct cc_debugfs_ctx *ctx; struct debugfs_regset32 *regset; - struct dentry *file; debug_regs[0].offset = drvdata->sig_offset; debug_regs[1].offset = drvdata->ver_offset; @@ -74,22 +71,9 @@ int cc_debugfs_init(struct cc_drvdata *drvdata) regset->base = drvdata->cc_base; ctx->dir = debugfs_create_dir(drvdata->plat_dev->name, cc_debugfs_dir); - if (!ctx->dir) - return -ENFILE; - - file = debugfs_create_regset32("regs", 0400, ctx->dir, regset); - if (!file) { - debugfs_remove(ctx->dir); - return -ENFILE; - } - file = debugfs_create_bool("coherent", 0400, ctx->dir, - &drvdata->coherent); - - if (!file) { - debugfs_remove_recursive(ctx->dir); - return -ENFILE; - } + debugfs_create_regset32("regs", 0400, ctx->dir, regset); + debugfs_create_bool("coherent", 0400, ctx->dir, &drvdata->coherent); drvdata->debugfs = ctx; diff --git a/drivers/crypto/ccree/cc_debugfs.h b/drivers/crypto/ccree/cc_debugfs.h index 5b5320eca7d2..01cbd9a95659 100644 --- a/drivers/crypto/ccree/cc_debugfs.h +++ b/drivers/crypto/ccree/cc_debugfs.h @@ -5,7 +5,7 @@ #define __CC_DEBUGFS_H__ #ifdef CONFIG_DEBUG_FS -int cc_debugfs_global_init(void); +void cc_debugfs_global_init(void); void cc_debugfs_global_fini(void); int cc_debugfs_init(struct cc_drvdata *drvdata); @@ -13,11 +13,7 @@ void cc_debugfs_fini(struct cc_drvdata *drvdata); #else -static inline int cc_debugfs_global_init(void) -{ - return 0; -} - +static inline void cc_debugfs_global_init(void) {} static inline void cc_debugfs_global_fini(void) {} static inline int cc_debugfs_init(struct cc_drvdata *drvdata) diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index 8ada308d72ee..662738e53ced 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -538,13 +538,8 @@ static struct platform_driver ccree_driver = { static int __init ccree_init(void) { - int ret; - cc_hash_global_init(); - - ret = cc_debugfs_global_init(); - if (ret) - return ret; + cc_debugfs_global_init(); return platform_driver_register(&ccree_driver); } -- 2.20.1