All of lore.kernel.org
 help / color / mirror / Atom feed
* [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 related	[flat|nested] 4+ messages in thread

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

Am Mon, Jan 04, 2021 at 09:59:30AM +0800 schrieb Tian Tao:
> 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>

Applied to pcmcia-next, thanks!

	Dominik

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

* Re: [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, 0 replies; 4+ messages in thread
From: Dominik Brodowski @ 2021-02-23  9:32 UTC (permalink / raw)
  To: Yang Li; +Cc: linux-kernel

Am Tue, Feb 23, 2021 at 05:26:50PM +0800 schrieb 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>

Sorry, an equivalent patch is already in pcmcia-next and about to be sent
upstream.

Thanks,
	Dominik

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

* [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 related	[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-01-04  1:59 [PATCH] pcmcia: Switch to using the new API kobj_to_dev() Tian Tao
2021-01-04  7:16 ` Dominik Brodowski
2021-02-23  9:26 Yang Li
2021-02-23  9:32 ` Dominik Brodowski

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.