Skip to content

Commit 340e200

Browse files
committed
crypto: qat - remove check after debugfs_create_dir()
JIRA: https://issues.redhat.com/browse/RHEL-52749 Upstream Status: merged into herbert/crypto-2.6.git commit 2371705 Author: Cabiddu, Giovanni <giovanni.cabiddu@intel.com> Date: Mon Sep 16 10:42:51 2024 +0100 crypto: qat - remove check after debugfs_create_dir() The debugfs functions are guaranteed to return a valid error code instead of NULL upon failure. Consequently, the driver can directly propagate any error returned without additional checks. Remove the unnecessary `if` statement after debugfs_create_dir(). If this function fails, the error code is stored in accel_dev->debugfs_dir and utilized in subsequent debugfs calls. Additionally, since accel_dev->debugfs_dir is assured to be non-NULL, remove the superfluous NULL pointer checks within the adf_dbgfs_add() and adf_dbgfs_rm(). Fixes: 9260db6 ("crypto: qat - move dbgfs init to separate file") Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Vladis Dronov <vdronov@redhat.com>
1 parent f0f12b3 commit 340e200

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/crypto/intel/qat/qat_common/adf_dbgfs.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,13 @@
2222
void adf_dbgfs_init(struct adf_accel_dev *accel_dev)
2323
{
2424
char name[ADF_DEVICE_NAME_LENGTH];
25-
void *ret;
2625

2726
/* Create dev top level debugfs entry */
2827
snprintf(name, sizeof(name), "%s%s_%s", ADF_DEVICE_NAME_PREFIX,
2928
accel_dev->hw_device->dev_class->name,
3029
pci_name(accel_dev->accel_pci_dev.pci_dev));
3130

32-
ret = debugfs_create_dir(name, NULL);
33-
if (IS_ERR_OR_NULL(ret))
34-
return;
35-
36-
accel_dev->debugfs_dir = ret;
31+
accel_dev->debugfs_dir = debugfs_create_dir(name, NULL);
3732

3833
adf_cfg_dev_dbgfs_add(accel_dev);
3934
}
@@ -59,9 +54,6 @@ EXPORT_SYMBOL_GPL(adf_dbgfs_exit);
5954
*/
6055
void adf_dbgfs_add(struct adf_accel_dev *accel_dev)
6156
{
62-
if (!accel_dev->debugfs_dir)
63-
return;
64-
6557
if (!accel_dev->is_vf) {
6658
adf_fw_counters_dbgfs_add(accel_dev);
6759
adf_heartbeat_dbgfs_add(accel_dev);
@@ -77,9 +69,6 @@ void adf_dbgfs_add(struct adf_accel_dev *accel_dev)
7769
*/
7870
void adf_dbgfs_rm(struct adf_accel_dev *accel_dev)
7971
{
80-
if (!accel_dev->debugfs_dir)
81-
return;
82-
8372
if (!accel_dev->is_vf) {
8473
adf_tl_dbgfs_rm(accel_dev);
8574
adf_cnv_dbgfs_rm(accel_dev);

0 commit comments

Comments
 (0)