Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7516385imu; Tue, 22 Jan 2019 07:16:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6GI4ldjCGvSi1OsL7mOroe2zoeGmow+KZ4fdzPpMwuyAPz22nb5dHrR4rVHj5qtK4SG0Xi X-Received: by 2002:a63:658:: with SMTP id 85mr32198916pgg.373.1548170183584; 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=OoCzQqJPAbT2oNLfnJ15u0tSBYZlFLT20NrKZKQPi5QnpCFBaA0AM+/A5Y2BqS9wLk Ze0IfNn6HpSjO/KIO/cFCp9iYhP0ZTs9mKPD1/9SnzS99CjGp/068Vl5kn3R8ivDB+mh ycAcuJfLUtjR8Lodh0r41W7kvULWCHYKdnUtEaif7qmhuSIbBIifYOvARPKX8T6NCRYj TLhe/3BcR2cDR/A5N8Pu5dDpvtibfXwJzZNbVneZcUvql10zyro0PAHHNV7uncUZtuNK rsjCxGwaPUu1ILRQYhKU0meDeZKiK93/UctcHEtv/9/pdSM4FUN5xrDY9M9nGn4MG+po Aeag== 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=c3VR7aGB9R9agp3xWyVv2JTdY0ua343d0HPeK8atAEc=; b=VryAvYb6QtakmM/iD+tvlXI3XyezHYNrnQ4w+vAjhgN87X7Uc5kRwOlh1GPvYYRZVc e7WSH4P10lFEvJQV2uz2xShydHjxE5aXaVKiw2NWMGu+bd4uzJ0SeoIc7biT5hNXk8G8 TwWgpXCN+a0NBRsNSwc9vDVho7UDJ56WYd/A1Lbu9/crYXYkZxxrGwo5xqLUas5U73Xa 3ZHr2FzNEAmYjUjyQGues7u7cLkNVp1xD45NzBY/qmTZZqzLEGEfjPPikr0sUdVSGwfU uwk0WfasM4i0Ghe0ELtwd+WE5zNv/rKgkJhQRg1pmC0134WioRhsbxbROhKGZxIsC1wa TeNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FMoP1jMX; 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 d4si15773355pls.348.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=FMoP1jMX; 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 S1729248AbfAVPOh (ORCPT + 99 others); Tue, 22 Jan 2019 10:14:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:54038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728899AbfAVPOh (ORCPT ); Tue, 22 Jan 2019 10:14:37 -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 7935720879; Tue, 22 Jan 2019 15:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170076; bh=svdj2mFEmqwog0Nb1hRlIR6GVZQhgx6zqxWH7cI3Rs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FMoP1jMXuLiIc28RsmwO1AFsYqw+ppUJ0t89GsDdNLvLLltL/kWFiPt78HelCqU3G RgKzxKVV/qMJo/8gGQpBR8jZ76HaCiY2l+8NmqUFEeVLUpCugBX4Pib0z60ong1EjI skKtdfoznMxqOpW0TufCbePH225qqUVFK7j5U3Ak= From: Greg Kroah-Hartman To: Herbert Xu , David Miller Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Giovanni Cabiddu , Conor McLoughlin , Waiman Long , qat-linux@intel.com Subject: [PATCH 1/7] crypto: qat: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:14:16 +0100 Message-Id: <20190122151422.14204-2-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: Giovanni Cabiddu Cc: Herbert Xu Cc: "David S. Miller" Cc: Conor McLoughlin Cc: Waiman Long Cc: qat-linux@intel.com Cc: linux-crypto@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/qat/qat_c3xxx/adf_drv.c | 5 ----- drivers/crypto/qat/qat_c3xxxvf/adf_drv.c | 5 ----- drivers/crypto/qat/qat_c62x/adf_drv.c | 5 ----- drivers/crypto/qat/qat_c62xvf/adf_drv.c | 5 ----- drivers/crypto/qat/qat_common/adf_cfg.c | 7 ------- drivers/crypto/qat/qat_common/adf_transport.c | 6 ------ .../crypto/qat/qat_common/adf_transport_debug.c | 15 --------------- drivers/crypto/qat/qat_dh895xcc/adf_drv.c | 5 ----- drivers/crypto/qat/qat_dh895xccvf/adf_drv.c | 5 ----- 9 files changed, 58 deletions(-) diff --git a/drivers/crypto/qat/qat_c3xxx/adf_drv.c b/drivers/crypto/qat/qat_c3xxx/adf_drv.c index 763c2166ee0e..d937cc7248a5 100644 --- a/drivers/crypto/qat/qat_c3xxx/adf_drv.c +++ b/drivers/crypto/qat/qat_c3xxx/adf_drv.c @@ -193,11 +193,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) PCI_FUNC(pdev->devfn)); accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); - if (!accel_dev->debugfs_dir) { - dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); - ret = -EINVAL; - goto out_err; - } /* Create device configuration table */ ret = adf_cfg_dev_add(accel_dev); diff --git a/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c b/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c index 613c7d5644ce..1dc5ac859f7b 100644 --- a/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c +++ b/drivers/crypto/qat/qat_c3xxxvf/adf_drv.c @@ -177,11 +177,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) PCI_FUNC(pdev->devfn)); accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); - if (!accel_dev->debugfs_dir) { - dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); - ret = -EINVAL; - goto out_err; - } /* Create device configuration table */ ret = adf_cfg_dev_add(accel_dev); diff --git a/drivers/crypto/qat/qat_c62x/adf_drv.c b/drivers/crypto/qat/qat_c62x/adf_drv.c index 9cb832963357..2bc06c89d2fe 100644 --- a/drivers/crypto/qat/qat_c62x/adf_drv.c +++ b/drivers/crypto/qat/qat_c62x/adf_drv.c @@ -193,11 +193,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) PCI_FUNC(pdev->devfn)); accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); - if (!accel_dev->debugfs_dir) { - dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); - ret = -EINVAL; - goto out_err; - } /* Create device configuration table */ ret = adf_cfg_dev_add(accel_dev); diff --git a/drivers/crypto/qat/qat_c62xvf/adf_drv.c b/drivers/crypto/qat/qat_c62xvf/adf_drv.c index 278452b8ef81..a68358b31292 100644 --- a/drivers/crypto/qat/qat_c62xvf/adf_drv.c +++ b/drivers/crypto/qat/qat_c62xvf/adf_drv.c @@ -177,11 +177,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) PCI_FUNC(pdev->devfn)); accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); - if (!accel_dev->debugfs_dir) { - dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); - ret = -EINVAL; - goto out_err; - } /* Create device configuration table */ ret = adf_cfg_dev_add(accel_dev); diff --git a/drivers/crypto/qat/qat_common/adf_cfg.c b/drivers/crypto/qat/qat_common/adf_cfg.c index d0879790561f..5c7fdb0fc53d 100644 --- a/drivers/crypto/qat/qat_common/adf_cfg.c +++ b/drivers/crypto/qat/qat_common/adf_cfg.c @@ -141,13 +141,6 @@ int adf_cfg_dev_add(struct adf_accel_dev *accel_dev) accel_dev->debugfs_dir, dev_cfg_data, &qat_dev_cfg_fops); - if (!dev_cfg_data->debug) { - dev_err(&GET_DEV(accel_dev), - "Failed to create qat cfg debugfs entry.\n"); - kfree(dev_cfg_data); - accel_dev->cfg = NULL; - return -EFAULT; - } return 0; } EXPORT_SYMBOL_GPL(adf_cfg_dev_add); diff --git a/drivers/crypto/qat/qat_common/adf_transport.c b/drivers/crypto/qat/qat_common/adf_transport.c index 57d2622728a5..ac658ce46836 100644 --- a/drivers/crypto/qat/qat_common/adf_transport.c +++ b/drivers/crypto/qat/qat_common/adf_transport.c @@ -486,12 +486,6 @@ int adf_init_etr_data(struct adf_accel_dev *accel_dev) /* accel_dev->debugfs_dir should always be non-NULL here */ etr_data->debug = debugfs_create_dir("transport", accel_dev->debugfs_dir); - if (!etr_data->debug) { - dev_err(&GET_DEV(accel_dev), - "Unable to create transport debugfs entry\n"); - ret = -ENOENT; - goto err_bank_debug; - } for (i = 0; i < num_banks; i++) { ret = adf_init_bank(accel_dev, &etr_data->banks[i], i, diff --git a/drivers/crypto/qat/qat_common/adf_transport_debug.c b/drivers/crypto/qat/qat_common/adf_transport_debug.c index 52340b9bb387..e794e9d97b2c 100644 --- a/drivers/crypto/qat/qat_common/adf_transport_debug.c +++ b/drivers/crypto/qat/qat_common/adf_transport_debug.c @@ -163,11 +163,6 @@ int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name) ring_debug->debug = debugfs_create_file(entry_name, S_IRUSR, ring->bank->bank_debug_dir, ring, &adf_ring_debug_fops); - if (!ring_debug->debug) { - pr_err("QAT: Failed to create ring debug entry.\n"); - kfree(ring_debug); - return -EFAULT; - } ring->ring_debug = ring_debug; return 0; } @@ -271,19 +266,9 @@ int adf_bank_debugfs_add(struct adf_etr_bank_data *bank) snprintf(name, sizeof(name), "bank_%02d", bank->bank_number); bank->bank_debug_dir = debugfs_create_dir(name, parent); - if (!bank->bank_debug_dir) { - pr_err("QAT: Failed to create bank debug dir.\n"); - return -EFAULT; - } - bank->bank_debug_cfg = debugfs_create_file("config", S_IRUSR, bank->bank_debug_dir, bank, &adf_bank_debug_fops); - if (!bank->bank_debug_cfg) { - pr_err("QAT: Failed to create bank debug entry.\n"); - debugfs_remove(bank->bank_debug_dir); - return -EFAULT; - } return 0; } diff --git a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c index 3a9708ef4ce2..b11bf8c0e683 100644 --- a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c +++ b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c @@ -193,11 +193,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) PCI_FUNC(pdev->devfn)); accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); - if (!accel_dev->debugfs_dir) { - dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); - ret = -EINVAL; - goto out_err; - } /* Create device configuration table */ ret = adf_cfg_dev_add(accel_dev); diff --git a/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c b/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c index 3da0f951cb59..1b762eefc6c1 100644 --- a/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c +++ b/drivers/crypto/qat/qat_dh895xccvf/adf_drv.c @@ -177,11 +177,6 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) PCI_FUNC(pdev->devfn)); accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); - if (!accel_dev->debugfs_dir) { - dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); - ret = -EINVAL; - goto out_err; - } /* Create device configuration table */ ret = adf_cfg_dev_add(accel_dev); -- 2.20.1