public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] w1: Switch to using the new API kobj_to_dev()
@ 2021-02-22  7:06 Yang Li
  0 siblings, 0 replies; only message in thread
From: Yang Li @ 2021-02-22  7:06 UTC (permalink / raw)
  To: zbr; +Cc: linux-kernel, Yang Li

fixed the following coccicheck:
./include/linux/w1.h:314:62-63: WARNING opportunity for kobj_to_dev()

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

diff --git a/include/linux/w1.h b/include/linux/w1.h
index 949d3b1..93f3be8 100644
--- a/include/linux/w1.h
+++ b/include/linux/w1.h
@@ -311,7 +311,7 @@ static inline struct w1_slave* dev_to_w1_slave(struct device *dev)
 
 static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj)
 {
-	return dev_to_w1_slave(container_of(kobj, struct device, kobj));
+	return dev_to_w1_slave(kobj_to_dev(kobj));
 }
 
 static inline struct w1_master* dev_to_w1_master(struct device *dev)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-22  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-22  7:06 [PATCH] w1: Switch to using the new API kobj_to_dev() Yang Li

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