tree:
https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head: ca018b971e8a0de8ddb9f24e14d458b679bdd135
commit: ca018b971e8a0de8ddb9f24e14d458b679bdd135 [13/13] BACKPORT: spi: Add
driver_override SPI device attribute
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
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
git remote add chrome-os
https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-4.4
git checkout ca018b971e8a0de8ddb9f24e14d458b679bdd135
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/arc/include/asm/bug.h:32,
from include/linux/bug.h:4,
from include/linux/debug_locks.h:6,
from include/linux/lockdep.h:23,
from include/linux/spinlock_types.h:18,
from include/linux/mutex.h:15,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from drivers/spi/spi.c:19:
include/linux/cpumask.h: In function 'cpumask_check':
include/linux/cpumask.h:117:19: warning: comparison of integer expressions of different
signedness: 'unsigned int' and 'int' [-Wsign-compare]
117 | WARN_ON_ONCE(cpu >= nr_cpumask_bits);
| ^~
include/asm-generic/bug.h:123:27: note: in definition of macro 'WARN_ON_ONCE'
123 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
drivers/spi/spi.c: In function 'driver_override_store':
> drivers/spi/spi.c:77:27: warning: operand of ?: changes
signedness from 'int' to 'size_t' {aka 'unsigned int'} due to
unsignedness of other operand [-Wsign-compare]
77 | const size_t len = end ?
end - buf : count;
| ^~~~~~~~~
drivers/spi/spi.c: In function 'spi_register_board_info':
drivers/spi/spi.c:718:16: warning: comparison of integer expressions of different
signedness: 'int' and 'unsigned int' [-Wsign-compare]
718 | for (i = 0; i < n; i++, bi++, info++) {
| ^
drivers/spi/spi.c: In function 'spi_write_then_read':
drivers/spi/spi.c:2774:20: warning: comparison of integer expressions of different
signedness: 'unsigned int' and 'int' [-Wsign-compare]
2774 | if ((n_tx + n_rx) > SPI_BUFSIZ || !mutex_trylock(&lock)) {
| ^
In file included from include/linux/perf_event.h:24,
from include/linux/trace_events.h:9,
from include/trace/trace_events.h:19,
from include/trace/define_trace.h:90,
from include/trace/events/spi.h:156,
from drivers/spi/spi.c:42:
At top level:
arch/arc/include/asm/perf_event.h:127:23: warning: 'arc_pmu_cache_map' defined
but not used [-Wunused-const-variable=]
127 | static const unsigned arc_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
| ^~~~~~~~~~~~~~~~~
arch/arc/include/asm/perf_event.h:95:27: warning: 'arc_pmu_ev_hw_map' defined
but not used [-Wunused-const-variable=]
95 | static const char * const arc_pmu_ev_hw_map[] = {
| ^~~~~~~~~~~~~~~~~
vim +77 drivers/spi/spi.c
70
71 static ssize_t driver_override_store(struct device *dev,
72 struct device_attribute *a,
73 const char *buf, size_t count)
74 {
75 struct spi_device *spi = to_spi_device(dev);
76 const char *end = memchr(buf, '\n', count);
77 const size_t len = end ? end - buf : count;
78 const
char *driver_override, *old;
79
80 /* We need to keep extra room for a newline when displaying value */
81 if (len >= (PAGE_SIZE - 1))
82 return -EINVAL;
83
84 driver_override = kstrndup(buf, len, GFP_KERNEL);
85 if (!driver_override)
86 return -ENOMEM;
87
88 device_lock(dev);
89 old = spi->driver_override;
90 if (len) {
91 spi->driver_override = driver_override;
92 } else {
93 /* Emptry string, disable driver override */
94 spi->driver_override = NULL;
95 kfree(driver_override);
96 }
97 device_unlock(dev);
98 kfree(old);
99
100 return count;
101 }
102
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org