* drivers/scsi/scsi_transport_spi.c:1460:61-62: WARNING opportunity for kobj_to_dev()
@ 2020-11-23 22:20 kernel test robot
2020-11-23 22:20 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-11-23 22:20 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 418baf2c28f3473039f2f7377760bd8f6897ae18
commit: a2fc3718bc22e85378085568ecc5765fb28cabce coccinelle: api: add kobj_to_dev.cocci script
date: 3 months ago
:::::: branch date: 23 hours ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-c002-20201123 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/scsi/scsi_transport_spi.c:1460:61-62: WARNING opportunity for kobj_to_dev()
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36851 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-11-23 22:20 drivers/scsi/scsi_transport_spi.c:1460:61-62: WARNING opportunity for kobj_to_dev() kernel test robot
@ 2020-11-23 22:20 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-11-23 22:20 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/scsi/scsi_transport_spi.c:1460:61-62: WARNING opportunity for kobj_to_dev()
Use kobj_to_dev() instead of container_of()
Generated by: scripts/coccinelle/api/kobj_to_dev.cocci
Fixes: a2fc3718bc22 ("coccinelle: api: add kobj_to_dev.cocci script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 418baf2c28f3473039f2f7377760bd8f6897ae18
commit: a2fc3718bc22e85378085568ecc5765fb28cabce coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 23 hours ago
:::::: commit date: 3 months ago
Please take the patch only if it's a positive warning. Thanks!
scsi_transport_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1457,7 +1457,7 @@ static int spi_host_configure(struct tra
static umode_t target_attribute_is_visible(struct kobject *kobj,
struct attribute *attr, int i)
{
- struct device *cdev = container_of(kobj, struct device, kobj);
+ struct device *cdev = kobj_to_dev(kobj);
struct scsi_target *starget = transport_class_to_starget(cdev);
struct Scsi_Host *shost = transport_class_to_shost(cdev);
struct spi_internal *si = to_spi_internal(shost->transportt);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-23 22:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-23 22:20 drivers/scsi/scsi_transport_spi.c:1460:61-62: WARNING opportunity for kobj_to_dev() kernel test robot
2020-11-23 22:20 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.