[PATCH] scsi: target: core: Use IS_ERR_OR_NULL() to simplify code

Liao Yuanhong posted 1 patch 1 month, 3 weeks ago
drivers/target/target_core_fabric_configfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] scsi: target: core: Use IS_ERR_OR_NULL() to simplify code
Posted by Liao Yuanhong 1 month, 3 weeks ago
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@vivo.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