* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2081 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Keith Busch <kbusch@kernel.org>
CC: Jens Axboe <axboe@kernel.dk>
CC: Christoph Hellwig <hch@lst.de>
CC: Sagi Grimberg <sagi@grimberg.me>
CC: linux-nvme(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev()
drivers/nvme/host/core.c:3403:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3400,7 +3400,7 @@ static struct attribute *nvme_ns_id_attr
static umode_t nvme_ns_id_attrs_are_visible(struct kobject *kobj,
struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct nvme_ns_ids *ids = &dev_to_ns_head(dev)->ids;
if (a == &dev_attr_uuid.attr) {
@@ -3643,7 +3643,7 @@ static struct attribute *nvme_dev_attrs[
static umode_t nvme_dev_attrs_are_visible(struct kobject *kobj,
struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
if (a == &dev_attr_delete_controller.attr && !ctrl->ops->delete_ctrl)
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-10-02 15:06 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Pavel Machek <pavel@ucw.cz>
CC: Dan Murphy <dmurphy@ti.com>
CC: linux-leds(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/leds/trigger/ledtrig-pattern.c:336:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
ledtrig-pattern.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/leds/trigger/ledtrig-pattern.c
+++ b/drivers/leds/trigger/ledtrig-pattern.c
@@ -333,7 +333,7 @@ static DEVICE_ATTR_RW(hw_pattern);
static umode_t pattern_trig_attrs_mode(struct kobject *kobj,
struct attribute *attr, int index)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct led_classdev *led_cdev = dev_get_drvdata(dev);
if (attr == &dev_attr_repeat.attr || attr == &dev_attr_pattern.attr)
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-10-02 15:06 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Keith Busch <kbusch@kernel.org>
CC: Jens Axboe <axboe@kernel.dk>
CC: Christoph Hellwig <hch@lst.de>
CC: Sagi Grimberg <sagi@grimberg.me>
CC: linux-nvme(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/nvme/host/lightnvm.c:1244:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
lightnvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -1241,7 +1241,7 @@ static struct attribute *nvm_dev_attrs[]
static umode_t nvm_dev_attrs_visible(struct kobject *kobj,
struct attribute *attr, int index)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct gendisk *disk = dev_to_disk(dev);
struct nvme_ns *ns = disk->private_data;
struct nvm_dev *ndev = ns->ndev;
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
` (2 preceding siblings ...)
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/hwmon/max6650.c:324:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
max6650.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -321,7 +321,7 @@ static SENSOR_DEVICE_ATTR_RO(gpio2_alarm
static umode_t max6650_attrs_visible(struct kobject *kobj, struct attribute *a,
int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct max6650_data *data = dev_get_drvdata(dev);
struct device_attribute *devattr;
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
` (3 preceding siblings ...)
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Guenter Roeck <linux@roeck-us.net>
CC: Jean Delvare <jdelvare@suse.com>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/hwmon/max6697.c:463:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
max6697.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/max6697.c
+++ b/drivers/hwmon/max6697.c
@@ -460,7 +460,7 @@ static DEVICE_ATTR(dummy, 0, NULL, NULL)
static umode_t max6697_is_visible(struct kobject *kobj, struct attribute *attr,
int index)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct max6697_data *data = dev_get_drvdata(dev);
const struct max6697_chip_data *chip = data->chip;
int channel = index / 7; /* channel number */
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
` (4 preceding siblings ...)
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Dan Williams <dan.j.williams@intel.com>
CC: Vishal Verma <vishal.l.verma@intel.com>
CC: Dave Jiang <dave.jiang@intel.com>
CC: Ira Weiny <ira.weiny@intel.com>
CC: linux-nvdimm(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/nvdimm/namespace_devs.c:1626:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
namespace_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1623,7 +1623,7 @@ static struct attribute *nd_namespace_at
static umode_t namespace_visible(struct kobject *kobj,
struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
if (a == &dev_attr_resource.attr && is_namespace_blk(dev))
return 0;
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
` (5 preceding siblings ...)
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1595 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Dan Williams <dan.j.williams@intel.com>
CC: Vishal Verma <vishal.l.verma@intel.com>
CC: Dave Jiang <dave.jiang@intel.com>
CC: Ira Weiny <ira.weiny@intel.com>
CC: linux-nvdimm(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/nvdimm/region_devs.c:762:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
region_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -759,7 +759,7 @@ REGION_MAPPING(31);
static umode_t mapping_visible(struct kobject *kobj, struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct nd_region *nd_region = to_nd_region(dev);
if (n < nd_region->ndr_mappings)
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
` (6 preceding siblings ...)
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 4197 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Lee Duncan <lduncan@suse.com>
CC: Chris Leech <cleech@redhat.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: open-iscsi(a)googlegroups.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_iscsi.c:4041:61-62: WARNING opportunity for kobj_to_dev()
drivers/scsi/scsi_transport_iscsi.c:1128:60-61: WARNING opportunity for kobj_to_dev()
drivers/scsi/scsi_transport_iscsi.c:926:60-61: WARNING opportunity for kobj_to_dev()
drivers/scsi/scsi_transport_iscsi.c:4454:61-62: WARNING opportunity for kobj_to_dev()
drivers/scsi/scsi_transport_iscsi.c:436:60-61: WARNING opportunity for kobj_to_dev()
drivers/scsi/scsi_transport_iscsi.c:4310: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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
scsi_transport_iscsi.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -433,7 +433,7 @@ iscsi_iface_attr(iface, initiator_name,
static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int i)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct iscsi_iface *iface = iscsi_dev_to_iface(dev);
struct iscsi_transport *t = iface->transport;
int param;
@@ -923,7 +923,7 @@ static umode_t iscsi_flashnode_sess_attr
struct attribute *attr,
int i)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct iscsi_bus_flash_session *fnode_sess =
iscsi_dev_to_flash_session(dev);
struct iscsi_transport *t = fnode_sess->transport;
@@ -1125,7 +1125,7 @@ static umode_t iscsi_flashnode_conn_attr
struct attribute *attr,
int i)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct iscsi_bus_flash_conn *fnode_conn = iscsi_dev_to_flash_conn(dev);
struct iscsi_transport *t = fnode_conn->transport;
int param;
@@ -4038,7 +4038,7 @@ static struct attribute *iscsi_conn_attr
static umode_t iscsi_conn_attr_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 iscsi_cls_conn *conn = transport_class_to_conn(cdev);
struct iscsi_transport *t = conn->transport;
int param;
@@ -4307,7 +4307,7 @@ static struct attribute *iscsi_session_a
static umode_t iscsi_session_attr_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 iscsi_cls_session *session = transport_class_to_session(cdev);
struct iscsi_transport *t = session->transport;
int param;
@@ -4451,7 +4451,7 @@ static struct attribute *iscsi_host_attr
static umode_t iscsi_host_attr_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_Host *shost = transport_class_to_shost(cdev);
struct iscsi_internal *priv = to_iscsi_internal(shost->transportt);
int param;
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
` (7 preceding siblings ...)
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/input/touchscreen/tsc200x-core.c:341:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
tsc200x-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/input/touchscreen/tsc200x-core.c
+++ b/drivers/input/touchscreen/tsc200x-core.c
@@ -338,7 +338,7 @@ static struct attribute *tsc200x_attrs[]
static umode_t tsc200x_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct tsc200x *ts = dev_get_drvdata(dev);
umode_t mode = attr->mode;
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
2020-10-02 15:06 [jlawall:for-5.10 3/10] drivers/nvme/host/core.c:3646:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
` (8 preceding siblings ...)
2020-10-02 15:06 ` kernel test robot
@ 2020-10-02 15:06 ` kernel test robot
9 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2020-10-02 15:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Jean Delvare <jdelvare@suse.com>
CC: Guenter Roeck <linux@roeck-us.net>
CC: linux-hwmon(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/hwmon/w83627ehf.c:1113:60-61: 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>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head: 44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/10] coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 19 hours ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
w83627ehf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -1110,7 +1110,7 @@ clear_caseopen(struct device *dev, struc
static umode_t w83627ehf_attrs_visible(struct kobject *kobj,
struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct w83627ehf_data *data = dev_get_drvdata(dev);
struct device_attribute *devattr;
struct sensor_device_attribute *sda;
^ permalink raw reply [flat|nested] 11+ messages in thread