[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240829091726.33984-1-shenlichuan@vivo.com>
Date: Thu, 29 Aug 2024 17:17:26 +0800
From: Shen Lichuan <shenlichuan@...o.com>
To: James.Bottomley@...senPartnership.com,
martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org,
m.muzzammilashraf@...il.com,
opensource.kernel@...o.com,
Shen Lichuan <shenlichuan@...o.com>
Subject: [PATCH v1] scsi: Convert to use ERR_CAST()
Use ERR_CAST() as it is designed for casting an error pointer to
another type.
This macro utilizes the __force and __must_check modifiers, which instruct
the compiler to verify for errors at the locations where it is employed.
Signed-off-by: Shen Lichuan <shenlichuan@...o.com>
---
drivers/scsi/cxgbi/libcxgbi.c | 2 +-
drivers/scsi/scsi_devinfo.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index bf75940f2be1..b2456989bcba 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2890,7 +2890,7 @@ struct iscsi_endpoint *cxgbi_ep_connect(struct Scsi_Host *shost,
}
if (IS_ERR(csk))
- return (struct iscsi_endpoint *)csk;
+ return ERR_CAST(csk);
cxgbi_sock_get(csk);
if (!hba)
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 90f1393a23f8..6a04cd1a86d6 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -423,7 +423,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
const char *vskip, *mskip;
if (IS_ERR(devinfo_table))
- return (struct scsi_dev_info_list *) devinfo_table;
+ return ERR_CAST(devinfo_table);
/* Prepare for "compatible" matches */
--
2.17.1
Powered by blists - more mailing lists