Re: [PATCH v2 3/3] of: Make of_match_node() an inline stub for CONFIG_OF=n

2017-04-12 Thread kbuild test robot
Hi Florian,

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v4.11-rc6 next-20170412]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Florian-Fainelli/of-Make-of_match_node-an-inline-stub-for-CONFIG_OF-n/20170412-160916
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: arm-s3c2410_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   drivers/i2c/busses/i2c-s3c2410.c: In function 's3c24xx_get_device_quirks':
>> drivers/i2c/busses/i2c-s3c2410.c:174:25: error: 's3c24xx_i2c_match' 
>> undeclared (first use in this function)
  match = of_match_node(s3c24xx_i2c_match, pdev->dev.of_node);
^
   drivers/i2c/busses/i2c-s3c2410.c:174:25: note: each undeclared identifier is 
reported only once for each function it appears in
--
   drivers/watchdog/s3c2410_wdt.c: In function 's3c2410_get_wdt_drv_data':
>> drivers/watchdog/s3c2410_wdt.c:515:25: error: 's3c2410_wdt_match' undeclared 
>> (first use in this function)
  match = of_match_node(s3c2410_wdt_match, pdev->dev.of_node);
^
   drivers/watchdog/s3c2410_wdt.c:515:25: note: each undeclared identifier is 
reported only once for each function it appears in

vim +/s3c24xx_i2c_match +174 drivers/i2c/busses/i2c-s3c2410.c

faf93ff6 Giridhar Maruthy2013-01-24  158  .data = (void 
*)(QUIRK_S3C2440 | QUIRK_NO_GPIO) },
117053f7 Vasanth Ananthan2013-11-11  159{ .compatible = 
"samsung,exynos5-sata-phy-i2c",
117053f7 Vasanth Ananthan2013-11-11  160  .data = (void 
*)(QUIRK_S3C2440 | QUIRK_POLL | QUIRK_NO_GPIO) },
27452498 Karol Lewandowski   2012-04-23  161{},
27452498 Karol Lewandowski   2012-04-23  162  };
27452498 Karol Lewandowski   2012-04-23  163  MODULE_DEVICE_TABLE(of, 
s3c24xx_i2c_match);
27452498 Karol Lewandowski   2012-04-23  164  #endif
^1da177e Linus Torvalds  2005-04-16  165  
ec7c34a4 Krzysztof Kozlowski 2016-04-21  166  /*
27452498 Karol Lewandowski   2012-04-23  167   * Get controller type either 
from device tree or platform device variant.
^1da177e Linus Torvalds  2005-04-16  168   */
5f1b1155 Pankaj Dubey2014-01-15  169  static inline kernel_ulong_t 
s3c24xx_get_device_quirks(struct platform_device *pdev)
^1da177e Linus Torvalds  2005-04-16  170  {
27452498 Karol Lewandowski   2012-04-23  171if (pdev->dev.of_node) {
27452498 Karol Lewandowski   2012-04-23  172const struct 
of_device_id *match;
0915833b Krzysztof Kozlowski 2016-04-21  173  
b900ba4c Karol Lewandowski   2012-05-30 @174match = 
of_match_node(s3c24xx_i2c_match, pdev->dev.of_node);
5f1b1155 Pankaj Dubey2014-01-15  175return 
(kernel_ulong_t)match->data;
27452498 Karol Lewandowski   2012-04-23  176}
5a5f5080 Thomas Abraham  2011-09-13  177  
27452498 Karol Lewandowski   2012-04-23  178return 
platform_get_device_id(pdev)->driver_data;
^1da177e Linus Torvalds  2005-04-16  179  }
^1da177e Linus Torvalds  2005-04-16  180  
ec7c34a4 Krzysztof Kozlowski 2016-04-21  181  /*
ec7c34a4 Krzysztof Kozlowski 2016-04-21  182   * Complete the message and wake 
up the caller, using the given return code,

:: The code at line 174 was first introduced by commit
:: b900ba4c1513a8c9a2fab8dca4cc6f50b17d6861 i2c: s3c2410: Fix pointer type 
passed to of_match_node()

:: TO: Karol Lewandowski 
:: CC: Wolfram Sang 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH v2 3/3] of: Make of_match_node() an inline stub for CONFIG_OF=n

2017-04-11 Thread Florian Fainelli
Make of_match_node() an inline function when CONFIG_OF=n which allows the
compiler to eliminate warnings about unused variables.

Signed-off-by: Florian Fainelli 
---
 include/linux/of.h | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index 21e6323de0f3..2803a85e81ec 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -839,7 +839,11 @@ static inline void of_property_clear_flag(struct property 
*p, unsigned long flag
 }
 
 #define of_match_ptr(_ptr) NULL
-#define of_match_node(_matches, _node) NULL
+static inline const struct of_device_id *of_match_node(
+   const struct of_device_id *matches, const struct device_node *node)
+{
+   return NULL;
+}
 #endif /* CONFIG_OF */
 
 /* Default string compare functions, Allow arch asm/prom.h to override */
-- 
2.9.3