Hi Linus,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pavel-linux-leds/for-next]
[also build test WARNING on v5.10-rc3 next-20201112]
[cannot apply to j.anaszewski-leds/for-next]
[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/Linus-Walleij/dt-bindings-leds-A...
base:
git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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/846dcb5b5cb37582e4b8398d794c7f435...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Linus-Walleij/dt-bindings-leds-Add-DT-binding-for-Richtek-RT8515/20201112-195826
git checkout 846dcb5b5cb37582e4b8398d794c7f4352653c8a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
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 include/linux/kernel.h:11,
from include/linux/delay.h:22,
from drivers/leds/flash/leds-rt8515.c:9:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/leds/flash/leds-rt8515.c: At top level:
> drivers/leds/flash/leds-rt8515.c:201:6: warning: no previous
prototype for 'rt8515_determine_max_intensity' [-Wmissing-prototypes]
201 | void rt8515_determine_max_intensity(struct rt8515 *rt,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/rt8515_determine_max_intensity +201 drivers/leds/flash/leds-rt8515.c
200
201 void rt8515_determine_max_intensity(struct rt8515 *rt,
202 struct fwnode_handle *led,
203 const char *resistance,
204 const char *max_ua_prop, int hw_max,
205 int *max_intensity_setting)
206 {
207 u32 res;
208 u32 ua;
209 u32 max_ma;
210 int max_intensity;
211 int ret1, ret2;
212
213
214 ret1 = fwnode_property_read_u32(rt->dev->fwnode, resistance, &res);
215 ret2 = fwnode_property_read_u32(led, max_ua_prop, &ua);
216
217 /* No info in DT, OK go with hardware maxima */
218 if (ret1 && ret2) {
219 max_ma = RT8515_MAX_IOUT_MA;
220 max_intensity = hw_max;
221 goto out_assign_max;
222 }
223
224 if (ret1 || ret2) {
225 dev_err(rt->dev,
226 "either %s or %s missing from DT, using HW max\n",
227 resistance, max_ua_prop);
228 max_ma = RT8515_MAX_IOUT_MA;
229 max_intensity = hw_max;
230 goto out_assign_max;
231 }
232
233 /*
234 * Formula from datasheet, this is the maximum current
235 * defined by the hardware.
236 */
237 max_ma = (5500 * 1000) / res;
238 /*
239 * Calculate max intensity (linear scaling)
240 * Formula is ((ua / 1000) / max_ma) * 100, then simplified
241 */
242 max_intensity = (ua / 10) / max_ma;
243
244 dev_info(rt->dev,
245 "current restricted from %u to %u mA, max intensity %d/100\n",
246 max_ma, (ua / 1000), max_intensity);
247
248 out_assign_max:
249 dev_info(rt->dev, "max intensity %d/%d = %d mA\n",
250 max_intensity, hw_max, max_ma);
251 *max_intensity_setting = max_intensity;
252 }
253
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org