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

From: kbuild test robot
Date: Sat Jun 10 2017 - 03:17:41 EST


Hi Andy,

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR 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: x86_64-rhel (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

In file included from include/linux/bitmap.h:8:0,
from include/linux/cpumask.h:11,
from arch/x86/include/asm/cpumask.h:4,
from arch/x86/include/asm/msr.h:10,
from arch/x86/include/asm/processor.h:20,
from arch/x86/include/asm/cpufeature.h:4,
from arch/x86/include/asm/thread_info.h:52,
from include/linux/thread_info.h:37,
from arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:80,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from drivers/misc/apds990x.c:26:
drivers/misc/apds990x.c: In function 'apds990x_prox_reporting_mode_store':
>> drivers/misc/apds990x.c:861:27: error: passing argument 1 of '__sysfs_match_string' from incompatible pointer type [-Werror=incompatible-pointer-types]
ret = sysfs_match_string(reporting_modes, buf);
^
include/linux/string.h:155:57: note: in definition of macro 'sysfs_match_string'
#define sysfs_match_string(_a, _s) __sysfs_match_string(_a, ARRAY_SIZE(_a), _s)
^~
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);
^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

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

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

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

Attachment: .config.gz
Description: application/gzip