All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] w1: Use kobj_to_dev() API
@ 2020-09-17  3:16 Wang Qing
  2020-09-17  7:36 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-09-17  3:16 UTC (permalink / raw)
  To: Evgeniy Polyakov, linux-kernel; +Cc: Wang Qing

Use kobj_to_dev() instead of container_of()

Signed-off-by: Wang Qing <wangqing@vivo.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 cebf346..7f45174
--- 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)
-- 
2.7.4


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

* Re: [PATCH] w1: Use kobj_to_dev() API
  2020-09-17  3:16 [PATCH] w1: Use kobj_to_dev() API Wang Qing
@ 2020-09-17  7:36 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-09-17  7:36 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

Hi Wang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.9-rc5 next-20200916]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Wang-Qing/w1-Use-kobj_to_dev-API/20200917-111747
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git bcf876870b95592b52519ed4aafcf9d95999bc9c
config: x86_64-randconfig-r001-20200917 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1321160a26e7e489baf9b10d6de90a342f898960)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from drivers/base/regmap/regmap-w1.c:10:
>> include/linux/w1.h:314:42: error: unexpected ';' before ')'
           return dev_to_w1_slave(kobj_to_dev(kobj););
                                                   ^
   1 error generated.

# https://github.com/0day-ci/linux/commit/8f6dda3bde8b884cd5eec16f69f90baf83a6eabc
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Wang-Qing/w1-Use-kobj_to_dev-API/20200917-111747
git checkout 8f6dda3bde8b884cd5eec16f69f90baf83a6eabc
vim +314 include/linux/w1.h

   311	
   312	static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj)
   313	{
 > 314		return dev_to_w1_slave(kobj_to_dev(kobj););
   315	}
   316	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32496 bytes --]

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

end of thread, other threads:[~2020-09-17  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  3:16 [PATCH] w1: Use kobj_to_dev() API Wang Qing
2020-09-17  7:36 ` kernel test robot

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.