[PATCH v1] scsi: Convert to use ERR_CAST()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux