* [PATCH] nvme: Switch to using the new API kobj_to_dev()
@ 2021-03-04 9:41 ` Jiapeng Chong
0 siblings, 0 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-03-04 9:41 UTC (permalink / raw)
To: kbusch; +Cc: axboe, hch, sagi, linux-nvme, linux-kernel, Jiapeng Chong
Fix the following coccicheck warnings:
./drivers/nvme/host/core.c:3714:60-61: WARNING opportunity for
kobj_to_dev().
./drivers/nvme/host/core.c:3475:60-61: WARNING opportunity for
kobj_to_dev().
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/nvme/host/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e68a8c4..89e013b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3472,7 +3472,7 @@ static ssize_t nsid_show(struct device *dev, struct device_attribute *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) {
@@ -3711,7 +3711,7 @@ static DEVICE_ATTR(reconnect_delay, S_IRUGO | S_IWUSR,
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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] nvme: Switch to using the new API kobj_to_dev()
@ 2021-03-04 9:41 ` Jiapeng Chong
0 siblings, 0 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-03-04 9:41 UTC (permalink / raw)
To: kbusch; +Cc: axboe, hch, sagi, linux-nvme, linux-kernel, Jiapeng Chong
Fix the following coccicheck warnings:
./drivers/nvme/host/core.c:3714:60-61: WARNING opportunity for
kobj_to_dev().
./drivers/nvme/host/core.c:3475:60-61: WARNING opportunity for
kobj_to_dev().
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/nvme/host/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e68a8c4..89e013b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3472,7 +3472,7 @@ static ssize_t nsid_show(struct device *dev, struct device_attribute *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) {
@@ -3711,7 +3711,7 @@ static DEVICE_ATTR(reconnect_delay, S_IRUGO | S_IWUSR,
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)
--
1.8.3.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: Switch to using the new API kobj_to_dev()
2021-03-04 9:41 ` Jiapeng Chong
@ 2021-03-04 22:19 ` Chaitanya Kulkarni
-1 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-03-04 22:19 UTC (permalink / raw)
To: Jiapeng Chong, kbusch; +Cc: axboe, hch, sagi, linux-nvme, linux-kernel
On 3/4/21 01:58, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
>
> ./drivers/nvme/host/core.c:3714:60-61: WARNING opportunity for
> kobj_to_dev().
>
> ./drivers/nvme/host/core.c:3475:60-61: WARNING opportunity for
> kobj_to_dev().
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
This patch is already NACKED.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: Switch to using the new API kobj_to_dev()
@ 2021-03-04 22:19 ` Chaitanya Kulkarni
0 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-03-04 22:19 UTC (permalink / raw)
To: Jiapeng Chong, kbusch; +Cc: axboe, hch, sagi, linux-nvme, linux-kernel
On 3/4/21 01:58, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
>
> ./drivers/nvme/host/core.c:3714:60-61: WARNING opportunity for
> kobj_to_dev().
>
> ./drivers/nvme/host/core.c:3475:60-61: WARNING opportunity for
> kobj_to_dev().
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
This patch is already NACKED.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-04 22:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 9:41 [PATCH] nvme: Switch to using the new API kobj_to_dev() Jiapeng Chong
2021-03-04 9:41 ` Jiapeng Chong
2021-03-04 22:19 ` Chaitanya Kulkarni
2021-03-04 22:19 ` Chaitanya Kulkarni
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.