diff mbox series

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

Message ID 1613976429-89853-1-git-send-email-yang.lee@linux.alibaba.com
State New
Headers show
Series scsi: ibmvfc: Switch to using the new API kobj_to_dev() | expand

Commit Message

Yang Li Feb. 22, 2021, 6:47 a.m. UTC
fixed the following coccicheck:
./drivers/scsi/ibmvscsi/ibmvfc.c:3161:60-61: WARNING opportunity for
kobj_to_dev()

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen March 16, 2021, 3:15 a.m. UTC | #1
On Mon, 22 Feb 2021 14:47:09 +0800, Yang Li wrote:

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 65f168c..e947149 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -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;