]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
scsi: ibmvfc: Switch to using kobj_to_dev()
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Thu, 4 Mar 2021 09:28:44 +0000 (17:28 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 10 Mar 2021 04:47:17 +0000 (23:47 -0500)
Fix the following coccicheck warnings:

./drivers/scsi/ibmvscsi/ibmvfc.c:3483:60-61: WARNING opportunity for
kobj_to_dev().

Link: https://lore.kernel.org/r/1614850124-54111-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Acked-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi/ibmvfc.c

index 755313b766b914aed345a124b0052c1e969b1740..e5f1ca70faf94342da508bc269906a1ed701b7d0 100644 (file)
@@ -3480,7 +3480,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;