Skip to contentSkip to conversation

osst: Remove casting the return value which is a void pointer

PATCH New Jingoo Han 1 participant 3 messages Sep 9, 2013

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/3 osst: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

---
 drivers/scsi/osst.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/osst.c +6 -6
index 21883a2..a2641bf 100644
@@ -5687,7 +5687,7 @@ static void osst_remove_sysfs_files(struct device_driver *sysfs)
 static ssize_t osst_adr_rev_show(struct device *dev,
 				 struct device_attribute *attr, char *buf)
 {
-	struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
+	struct osst_tape *STp = dev_get_drvdata(dev);
 	ssize_t l = 0;
 
 	if (STp && STp->header_ok && STp->linux_media)
@@ -5701,7 +5701,7 @@ static ssize_t osst_linux_media_version_show(struct device *dev,
 					     struct device_attribute *attr,
 					     char *buf)
 {
-	struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
+	struct osst_tape *STp = dev_get_drvdata(dev);
 	ssize_t l = 0;
 
 	if (STp && STp->header_ok && STp->linux_media)
@@ -5714,7 +5714,7 @@ DEVICE_ATTR(media_version, S_IRUGO, osst_linux_media_version_show, NULL);
 static ssize_t osst_capacity_show(struct device *dev,
 				  struct device_attribute *attr, char *buf)
 {
-	struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
+	struct osst_tape *STp = dev_get_drvdata(dev);
 	ssize_t l = 0;
 
 	if (STp && STp->header_ok && STp->linux_media)
@@ -5728,7 +5728,7 @@ static ssize_t osst_first_data_ppos_show(struct device *dev,
 					 struct device_attribute *attr,
 					 char *buf)
 {
-	struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
+	struct osst_tape *STp = dev_get_drvdata(dev);
 	ssize_t l = 0;
 
 	if (STp && STp->header_ok && STp->linux_media)
@@ -5742,7 +5742,7 @@ static ssize_t osst_eod_frame_ppos_show(struct device *dev,
 					struct device_attribute *attr,
 					char *buf)
 {
-	struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
+	struct osst_tape *STp = dev_get_drvdata(dev);
 	ssize_t l = 0;
 
 	if (STp && STp->header_ok && STp->linux_media)
@@ -5755,7 +5755,7 @@ DEVICE_ATTR(EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL);
 static ssize_t osst_filemark_cnt_show(struct device *dev,
 				      struct device_attribute *attr, char *buf)
 {
-	struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
+	struct osst_tape *STp = dev_get_drvdata(dev);
 	ssize_t l = 0;
 
 	if (STp && STp->header_ok && STp->linux_media)
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/3 ufs: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

---
 drivers/scsi/ufs/ufshcd-pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd-pci.c +1 -1
index a823cf4..26ea19c 100644
@@ -117,7 +117,7 @@ static int ufshcd_pci_runtime_idle(struct device *dev)
  */
 static void ufshcd_pci_shutdown(struct pci_dev *pdev)
 {
-	ufshcd_hba_stop((struct ufs_hba *)pci_get_drvdata(pdev));
+	ufshcd_hba_stop(pci_get_drvdata(pdev));
 }
 
 /**
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 3/3 be2iscsi: Remove casting the return value which is a void pointer

In reply to Jingoo Han

Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

---
 drivers/scsi/be2iscsi/be_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/be2iscsi/be_main.c +1 -1
index a1f5ac7..c6cdd7d 100644
@@ -4836,7 +4836,7 @@ static void beiscsi_shutdown(struct pci_dev *pcidev)
 
 	struct beiscsi_hba *phba = NULL;
 
-	phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev);
+	phba = pci_get_drvdata(pcidev);
 	if (!phba) {
 		dev_err(&pcidev->dev, "beiscsi_shutdown called with no phba\n");
 		return;
Signature · 1 line
1.7.10.4