Re: [PATCHv3 5/5] misc: gehc-achc: new driver

kernel test robot
2021-05-28T15:05:11Z

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

Hi Sebastian,

I love your patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on char-misc/char-misc-testing v5.13-rc3]
[cannot apply to spi/for-next next-20210528]
[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/Sebastian-Reichel/GE-Healthcare-PPD-firmware-upgrade-driver-for-ACHC/20210528-193816
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-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
# https://github.com/0day-ci/linux/commit/dac014da90e2715a80e4f7139ac40333cd3d4bec
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sebastian-Reichel/GE-Healthcare-PPD-firmware-upgrade-driver-for-ACHC/20210528-193816
git checkout dac014da90e2715a80e4f7139ac40333cd3d4bec
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64

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

All error/warnings (new ones prefixed by >>):

In file included from include/linux/printk.h:409,
from include/linux/kernel.h:17,
from include/linux/delay.h:22,
from drivers/misc/nxp-ezport.c:12:
drivers/misc/nxp-ezport.c: In function 'ezport_flash_transfer':
>> drivers/misc/nxp-ezport.c:221:21: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
221 | dev_dbg(&spi->dev, "EzPort write %u bytes @ 0x%06x...\n", payload_size, address);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/misc/nxp-ezport.c:221:2: note: in expansion of macro 'dev_dbg'
221 | dev_dbg(&spi->dev, "EzPort write %u bytes @ 0x%06x...\n", payload_size, address);
| ^~~~~~~
drivers/misc/nxp-ezport.c:221:36: note: format string is defined here
221 | dev_dbg(&spi->dev, "EzPort write %u bytes @ 0x%06x...\n", payload_size, address);
| ~^
| |
| unsigned int
| %lu
In file included from include/linux/printk.h:409,
from include/linux/kernel.h:17,
from include/linux/delay.h:22,
from drivers/misc/nxp-ezport.c:12:
drivers/misc/nxp-ezport.c: In function 'ezport_firmware_compare_data':
drivers/misc/nxp-ezport.c:292:21: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
292 | dev_dbg(&spi->dev, "EzPort compare data with %u bytes...\n", size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/misc/nxp-ezport.c:292:2: note: in expansion of macro 'dev_dbg'
292 | dev_dbg(&spi->dev, "EzPort compare data with %u bytes...\n", size);
| ^~~~~~~
drivers/misc/nxp-ezport.c:292:48: note: format string is defined here
292 | dev_dbg(&spi->dev, "EzPort compare data with %u bytes...\n", size);
| ~^
| |
| unsigned int
| %lu
In file included from include/linux/kernel.h:15,
from include/linux/delay.h:22,
from drivers/misc/nxp-ezport.c:12:
include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/linux/minmax.h:32:4: note: in expansion of macro '__typecheck'
32 | (__typecheck(x, y) && __no_side_effects(x, y))
| ^~~~~~~~~~~
include/linux/minmax.h:42:24: note: in expansion of macro '__safe_cmp'
42 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:51:19: note: in expansion of macro '__careful_cmp'
51 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/nxp-ezport.c:305:19: note: in expansion of macro 'min'
305 | transfer_size = min((u32) EZPORT_TRANSFER_SIZE, size - address);
| ^~~
In file included from include/linux/printk.h:409,
from include/linux/kernel.h:17,
from include/linux/delay.h:22,
from drivers/misc/nxp-ezport.c:12:
drivers/misc/nxp-ezport.c: In function 'ezport_firmware_flash_data':
drivers/misc/nxp-ezport.c:324:21: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
324 | dev_dbg(&spi->dev, "EzPort flash data with %u bytes...\n", size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/misc/nxp-ezport.c:324:2: note: in expansion of macro 'dev_dbg'
324 | dev_dbg(&spi->dev, "EzPort flash data with %u bytes...\n", size);
| ^~~~~~~
drivers/misc/nxp-ezport.c:324:46: note: format string is defined here
324 | dev_dbg(&spi->dev, "EzPort flash data with %u bytes...\n", size);
| ~^
| |
| unsigned int
| %lu
In file included from include/linux/kernel.h:15,
--
drivers/misc/gehc-achc.c: In function 'gehc_achc_probe':
>> drivers/misc/gehc-achc.c:123:8: error: implicit declaration of function 'spidev_probe' [-Werror=implicit-function-declaration]
123 | ret = spidev_probe(spi);
| ^~~~~~~~~~~~
drivers/misc/gehc-achc.c: In function 'gehc_achc_remove':
>> drivers/misc/gehc-achc.c:132:9: error: implicit declaration of function 'spidev_remove'; did you mean 'idr_remove'? [-Werror=implicit-function-declaration]
132 | return spidev_remove(spi);
| ^~~~~~~~~~~~~
| idr_remove
cc1: some warnings being treated as errors

vim +/spidev_probe +123 drivers/misc/gehc-achc.c

77
78 static int gehc_achc_probe(struct spi_device *spi)
79 {
80 struct achc_data *achc;
81 int ezport_reg, ret;
82
83 spi->max_speed_hz = ACHC_MAX_FREQ;
84 spi->bits_per_word = 8;
85 spi->mode = SPI_MODE_0;
86
87 achc = devm_kzalloc(&spi->dev, sizeof(*achc), GFP_KERNEL);
88 if (!achc)
89 return -ENOMEM;
90 achc->main = spi;
91
92 mutex_init(&achc->device_lock);
93
94 ret = of_property_read_u32_index(spi->dev.of_node, "reg", 1, &ezport_reg);
95 if (ret)
96 return dev_err_probe(&spi->dev, ret, "missing second reg entry!\n");
97
98 achc->ezport = spi_new_ancillary_device(spi, ezport_reg);
99 if (IS_ERR(achc->ezport))
100 return PTR_ERR(achc->ezport);
101
102 ret = devm_add_action_or_reset(&spi->dev, unregister_ezport, achc->ezport);
103 if (ret)
104 return ret;
105
106 achc->reset = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_LOW);
107 if (IS_ERR(achc->reset))
108 return dev_err_probe(&spi->dev, PTR_ERR(achc->reset), "Could not get reset gpio\n");
109
110 /*
111 * The sysfs properties are bound to the dummy device, since the main device already
112 * uses drvdata assigned by the spidev driver.
113 */
114 spi_set_drvdata(achc->ezport, achc);
115 ret = devm_device_add_group(&achc->ezport->dev, &gehc_achc_attr_group);
116 if (ret)
117 return ret;
118
119 /*
120 * Anything before this must use device managed resources to ensure resources being
121 * free'd in reverse allocation order.
122 */
> 123 ret = spidev_probe(spi);
124 if (ret)
125 return ret;
126
127 return 0;
128 }
129
130 static int gehc_achc_remove(struct spi_device *spi)
131 {
> 132 return spidev_remove(spi);
133 }
134

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

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