[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250814131312.231097-1-liaoyuanhong@vivo.com>
Date: Thu, 14 Aug 2025 21:13:12 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: "Martin K. Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org (open list:SCSI TARGET SUBSYSTEM),
target-devel@...r.kernel.org (open list:SCSI TARGET SUBSYSTEM),
linux-kernel@...r.kernel.org (open list)
Cc: Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH] scsi: target: core: Use IS_ERR_OR_NULL() to simplify code
Use IS_ERR_OR_NULL() instead of the original !xxx || IS_ERR(xxx) logic.
This will simplify the code and enhance readability.
Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
---
drivers/target/target_core_fabric_configfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c
index 7156a4dc1ca7..4b0c71fbe57f 100644
--- a/drivers/target/target_core_fabric_configfs.c
+++ b/drivers/target/target_core_fabric_configfs.c
@@ -479,7 +479,7 @@ static struct config_group *target_fabric_make_np(
}
se_tpg_np = tf->tf_ops->fabric_make_np(se_tpg, group, name);
- if (!se_tpg_np || IS_ERR(se_tpg_np))
+ if (IS_ERR_OR_NULL(se_tpg_np))
return ERR_PTR(-EINVAL);
se_tpg_np->tpg_np_parent = se_tpg;
--
2.34.1
Powered by blists - more mailing lists