mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pcmcia: Switch to using the new API kobj_to_dev()
@ 2021-02-23  9:26 Yang Li
  2021-02-23  9:32 ` Dominik Brodowski
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Li @ 2021-02-23  9:26 UTC (permalink / raw)
  To: linux; +Cc: linux-kernel, Yang Li

fixed the following coccicheck:
./drivers/pcmcia/cistpl.c:1584:53-54: WARNING opportunity for
kobj_to_dev()

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/pcmcia/cistpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index cf109d9..7b296ba 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -1581,7 +1581,7 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj,
 	if (error)
 		return error;
 
-	s = to_socket(container_of(kobj, struct device, kobj));
+	s = to_socket(kobj_to_dev(kobj));
 
 	if (off)
 		return -EINVAL;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] pcmcia: Switch to using the new API kobj_to_dev()
@ 2021-01-04  1:59 Tian Tao
  2021-01-04  7:16 ` Dominik Brodowski
  0 siblings, 1 reply; 4+ messages in thread
From: Tian Tao @ 2021-01-04  1:59 UTC (permalink / raw)
  To: linux; +Cc: linux-kernel

fixed the following coccicheck:
drivers/pcmcia/cistpl.c:1557:54-55: WARNING opportunity for kobj_to_dev()
drivers/pcmcia/cistpl.c:1584:53-54: WARNING opportunity for kobj_to_dev()

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/pcmcia/cistpl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index cf109d9..e693910 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -1554,7 +1554,7 @@ static ssize_t pccard_show_cis(struct file *filp, struct kobject *kobj,
 		if (off + count > size)
 			count = size - off;
 
-		s = to_socket(container_of(kobj, struct device, kobj));
+		s = to_socket(kobj_to_dev(kobj));
 
 		if (!(s->state & SOCKET_PRESENT))
 			return -ENODEV;
@@ -1581,7 +1581,7 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj,
 	if (error)
 		return error;
 
-	s = to_socket(container_of(kobj, struct device, kobj));
+	s = to_socket(kobj_to_dev(kobj));
 
 	if (off)
 		return -EINVAL;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-23  9:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23  9:26 [PATCH] pcmcia: Switch to using the new API kobj_to_dev() Yang Li
2021-02-23  9:32 ` Dominik Brodowski
  -- strict thread matches above, loose matches on Subject: below --
2021-01-04  1:59 Tian Tao
2021-01-04  7:16 ` Dominik Brodowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®