Re: [PATCH v1] misc: apds990x: Use sysfs_match_string() helper

From: kbuild test robot
Date: Sat Jun 10 2017 - 03:09:54 EST


Hi Andy,

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on v4.12-rc4 next-20170609]
[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/Andy-Shevchenko/misc-apds990x-Use-sysfs_match_string-helper/20170610-131929
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
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=m68k

All warnings (new ones prefixed by >>):

In file included from include/linux/bitmap.h:8:0,
from include/linux/nodemask.h:94,
from include/linux/mmzone.h:16,
from include/linux/gfp.h:5,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from drivers//misc/apds990x.c:26:
drivers//misc/apds990x.c: In function 'apds990x_prox_reporting_mode_store':
>> include/linux/string.h:155:36: warning: passing argument 1 of '__sysfs_match_string' from incompatible pointer type
#define sysfs_match_string(_a, _s) __sysfs_match_string(_a, ARRAY_SIZE(_a), _s)
^
>> drivers//misc/apds990x.c:861:8: note: in expansion of macro 'sysfs_match_string'
ret = sysfs_match_string(reporting_modes, buf);
^
include/linux/string.h:146:5: note: expected 'const char * const*' but argument is of type 'const char (*)[9]'
int __sysfs_match_string(const char * const *array, size_t n, const char *s);
^
--
In file included from include/linux/bitmap.h:8:0,
from include/linux/nodemask.h:94,
from include/linux/mmzone.h:16,
from include/linux/gfp.h:5,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from drivers/misc/apds990x.c:26:
drivers/misc/apds990x.c: In function 'apds990x_prox_reporting_mode_store':
>> include/linux/string.h:155:36: warning: passing argument 1 of '__sysfs_match_string' from incompatible pointer type
#define sysfs_match_string(_a, _s) __sysfs_match_string(_a, ARRAY_SIZE(_a), _s)
^
drivers/misc/apds990x.c:861:8: note: in expansion of macro 'sysfs_match_string'
ret = sysfs_match_string(reporting_modes, buf);
^
include/linux/string.h:146:5: note: expected 'const char * const*' but argument is of type 'const char (*)[9]'
int __sysfs_match_string(const char * const *array, size_t n, const char *s);
^

vim +/sysfs_match_string +861 drivers//misc/apds990x.c

845
846 static ssize_t apds990x_prox_reporting_mode_show(struct device *dev,
847 struct device_attribute *attr, char *buf)
848 {
849 struct apds990x_chip *chip = dev_get_drvdata(dev);
850 return sprintf(buf, "%s\n",
851 reporting_modes[!!chip->prox_continuous_mode]);
852 }
853
854 static ssize_t apds990x_prox_reporting_mode_store(struct device *dev,
855 struct device_attribute *attr,
856 const char *buf, size_t len)
857 {
858 struct apds990x_chip *chip = dev_get_drvdata(dev);
859 int ret;
860
> 861 ret = sysfs_match_string(reporting_modes, buf);
862 if (ret < 0)
863 return ret;
864
865 chip->prox_continuous_mode = ret;
866 return len;
867 }
868
869 static DEVICE_ATTR(prox0_reporting_mode, S_IRUGO | S_IWUSR,

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

Attachment: .config.gz
Description: application/gzip