Skip to contentSkip to conversation

scsi: ibmvfc: Switch to using the new API kobj_to_dev()

PATCH Applied Yang Li 2 participants 2 messages Feb 22, 2021 – Mar 16, 2021

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 scsi: ibmvfc: Switch to using the new API kobj_to_dev()

fixed the following coccicheck:
./drivers/scsi/ibmvscsi/ibmvfc.c:3161:60-61: WARNING opportunity for kobj_to_dev()

---
 drivers/scsi/ibmvscsi/ibmvfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvfc.c +1 -1
index 65f168c..e947149 100644
@@ -3158,7 +3158,7 @@ static ssize_t ibmvfc_read_trace(struct file *filp, struct kobject *kobj,
 				 struct bin_attribute *bin_attr,
 				 char *buf, loff_t off, size_t count)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct ibmvfc_host *vhost = shost_priv(shost);
 	unsigned long flags = 0;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 3 lines · Yang Li

fixed the following coccicheck:
./drivers/scsi/ibmvscsi/ibmvfc.c:3161:60-61: WARNING opportunity for kobj_to_dev()

Applied to 5.13/scsi-queue, thanks!

[1/1] scsi: ibmvfc: Switch to using the new API kobj_to_dev()

      https://git.kernel.org/mkp/scsi/c/18c2a59a4190
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering