From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings
Date: Thu, 01 Apr 2021 04:25:59 +0800 [thread overview]
Message-ID: <20210331202559.GA81382@423fe46d13f0> (raw)
In-Reply-To: <202104010415.esDCLlNA-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3639 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: Brian King <brking@us.ibm.com>
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/ipr.c:4209:61-62: WARNING opportunity for kobj_to_dev()
drivers/scsi/ipr.c:4185:61-62: WARNING opportunity for kobj_to_dev()
drivers/scsi/ipr.c:4268:61-62: WARNING opportunity for kobj_to_dev()
drivers/scsi/ipr.c:3459:60-61: WARNING opportunity for kobj_to_dev()
drivers/scsi/ipr.c:4457: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: 5e46d1b78a03d52306f21f77a4e4a144b6d31486
commit: a2fc3718bc22e85378085568ecc5765fb28cabce coccinelle: api: add kobj_to_dev.cocci script
:::::: branch date: 23 hours ago
:::::: commit date: 7 months ago
Please take the patch only if it's a positive warning. Thanks!
ipr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3456,7 +3456,7 @@ static ssize_t ipr_read_trace(struct fil
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 ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
unsigned long lock_flags = 0;
@@ -4182,7 +4182,7 @@ static ssize_t ipr_read_async_err_log(st
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{
- struct device *cdev = container_of(kobj, struct device, kobj);
+ struct device *cdev = kobj_to_dev(kobj);
struct Scsi_Host *shost = class_to_shost(cdev);
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
struct ipr_hostrcb *hostrcb;
@@ -4206,7 +4206,7 @@ static ssize_t ipr_next_async_err_log(st
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{
- struct device *cdev = container_of(kobj, struct device, kobj);
+ struct device *cdev = kobj_to_dev(kobj);
struct Scsi_Host *shost = class_to_shost(cdev);
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
struct ipr_hostrcb *hostrcb;
@@ -4265,7 +4265,7 @@ static ssize_t ipr_read_dump(struct file
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
- struct device *cdev = container_of(kobj, struct device, kobj);
+ struct device *cdev = kobj_to_dev(kobj);
struct Scsi_Host *shost = class_to_shost(cdev);
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
struct ipr_dump *dump;
@@ -4454,7 +4454,7 @@ static ssize_t ipr_write_dump(struct fil
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
- struct device *cdev = container_of(kobj, struct device, kobj);
+ struct device *cdev = kobj_to_dev(kobj);
struct Scsi_Host *shost = class_to_shost(cdev);
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
int rc;
next prev parent reply other threads:[~2021-03-31 20:25 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 20:25 drivers/scsi/ipr.c:4209:61-62: WARNING opportunity for kobj_to_dev() kernel test robot
2021-03-31 20:25 ` kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-07-05 11:59 kernel test robot
2021-07-05 11:59 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2021-04-03 0:10 drivers/nvdimm/region_devs.c:762:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2021-04-03 0:10 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2021-03-16 22:20 drivers/platform/x86/asus-laptop.c:1572:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2021-03-16 22:21 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2021-03-10 0:31 drivers/input/misc/ims-pcu.c:1231:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2021-03-10 0:31 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2021-03-10 0:31 ` kernel test robot
2021-01-08 9:40 drivers/nvdimm/namespace_devs.c:1626:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2021-01-08 9:40 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2021-01-01 9:01 drivers/platform/x86/ideapad-laptop.c:522:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2021-01-01 9:01 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-12-21 6:39 drivers/mfd/lm3533-core.c:361:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-12-21 6:39 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-12-21 6:38 drivers/mfd/lm3533-core.c:361:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-12-21 6:38 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-12-20 11:36 drivers/mfd/lm3533-core.c:361:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-12-20 11:36 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-12-15 9:25 drivers/nvdimm/namespace_devs.c:1626:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-12-15 9:25 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-12-10 5:15 drivers/scsi/esas2r/esas2r_main.c:62:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-12-10 5:15 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-12-03 1:10 drivers/scsi/3w-sas.c:102:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-12-03 1:10 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
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
2020-11-20 11:00 drivers/scsi/scsi_transport_iscsi.c:4041:61-62: WARNING opportunity for kobj_to_dev() kernel test robot
2020-11-20 11:00 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-11-16 13:14 drivers/nvdimm/namespace_devs.c:1626:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-11-16 13:14 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-11-13 8:52 drivers/hwmon/pwm-fan.c:150:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-11-13 8:52 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-11-11 9:50 drivers/nvme/host/lightnvm.c:1244:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-11-11 9:50 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
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
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
2020-10-02 15:06 ` kernel test robot
2020-10-02 15:06 ` kernel test robot
2020-09-28 2:40 [jlawall:for-5.10 3/9] drivers/block/virtio_blk.c:634:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-09-28 2:40 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-09-01 9:46 [jlawall:for-5.10 3/4] drivers/iio/adc/adi-axi-adc.c:279:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-09-01 9:46 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-09-01 9:46 ` kernel test robot
2020-08-27 20:13 Julia Lawall
2020-08-27 20:13 ` Julia Lawall
2020-08-27 20:13 ` Julia Lawall
2020-08-27 22:24 ` Jens Axboe
2020-08-27 22:24 ` Jens Axboe
2020-08-27 17:03 Markus Elfring
2020-08-27 20:05 ` Julia Lawall
2020-08-27 20:05 ` Julia Lawall
2020-08-27 20:05 ` Julia Lawall
2020-08-27 20:05 ` Julia Lawall
2020-08-28 16:52 ` Markus Elfring
2020-08-28 16:52 ` Markus Elfring
2020-08-26 23:27 [jlawall:for-5.10 3/3] drivers/scsi/3w-sas.c:102:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2020-08-26 23:27 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
2020-08-26 23:27 ` kernel test robot
2020-08-26 23:27 ` kernel test robot
2020-08-26 23:27 ` kernel test robot
2020-08-26 23:27 ` kernel test robot
2020-08-26 23:27 ` kernel test robot
[not found] <CGME20200826205412eucas1p16c748e9d73f4cd924aae1d6386ab450c@eucas1p1.samsung.com>
2020-08-26 20:54 ` Julia Lawall
2020-08-26 20:54 ` Julia Lawall
2020-08-26 20:54 ` Julia Lawall
2020-08-26 20:54 ` Julia Lawall
2020-09-08 11:37 ` Bartlomiej Zolnierkiewicz
2020-09-08 11:37 ` Bartlomiej Zolnierkiewicz
2020-09-08 11:37 ` Bartlomiej Zolnierkiewicz
2020-09-08 11:37 ` Bartlomiej Zolnierkiewicz
2020-08-26 19:51 [jlawall:for-5.10 3/3] drivers/video/fbdev/udlfb.c:1460:62-63: WARNING opportunity for kobj_to_dev() kernel test robot
2020-08-26 19:51 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210331202559.GA81382@423fe46d13f0 \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.