Re: [PATCH] regmap: Add a config option for making regmap debugfs writable

From: kbuild test robot
Date: Tue Oct 13 2015 - 16:01:33 EST


Hi Anatol,

[auto build test WARNING on regmap/for-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url: https://github.com/0day-ci/linux/commits/Anatol-Pomozov/regmap-Add-a-config-option-for-making-regmap-debugfs-writable/20151014-014929
config: mn10300-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mn10300

All warnings (new ones prefixed by >>):

In file included from include/linux/list.h:8:0,
from include/linux/preempt.h:10,
from include/linux/spinlock.h:50,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from drivers/base/regmap/regmap-debugfs.c:13:
drivers/base/regmap/regmap-debugfs.c: In function 'regmap_map_write_file':
include/linux/kernel.h:722:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_min1 == &_min2); \
^
>> drivers/base/regmap/regmap-debugfs.c:280:13: note: in expansion of macro 'min'
buf_size = min(count, (sizeof(buf)-1));
^

vim +/min +280 drivers/base/regmap/regmap-debugfs.c

09c6ecd3 Dimitris Papastamos 2012-02-22 264 * This can be dangerous especially when we have clients such as
09c6ecd3 Dimitris Papastamos 2012-02-22 265 * PMICs, therefore don't provide any real compile time configuration option
09c6ecd3 Dimitris Papastamos 2012-02-22 266 * for this feature, people who want to use this will need to modify
09c6ecd3 Dimitris Papastamos 2012-02-22 267 * the source code directly.
09c6ecd3 Dimitris Papastamos 2012-02-22 268 */
09c6ecd3 Dimitris Papastamos 2012-02-22 269 static ssize_t regmap_map_write_file(struct file *file,
09c6ecd3 Dimitris Papastamos 2012-02-22 270 const char __user *user_buf,
09c6ecd3 Dimitris Papastamos 2012-02-22 271 size_t count, loff_t *ppos)
09c6ecd3 Dimitris Papastamos 2012-02-22 272 {
09c6ecd3 Dimitris Papastamos 2012-02-22 273 char buf[32];
09c6ecd3 Dimitris Papastamos 2012-02-22 274 size_t buf_size;
09c6ecd3 Dimitris Papastamos 2012-02-22 275 char *start = buf;
09c6ecd3 Dimitris Papastamos 2012-02-22 276 unsigned long reg, value;
09c6ecd3 Dimitris Papastamos 2012-02-22 277 struct regmap *map = file->private_data;
68e850d8 Dimitris Papastamos 2013-05-09 278 int ret;
09c6ecd3 Dimitris Papastamos 2012-02-22 279
09c6ecd3 Dimitris Papastamos 2012-02-22 @280 buf_size = min(count, (sizeof(buf)-1));
09c6ecd3 Dimitris Papastamos 2012-02-22 281 if (copy_from_user(buf, user_buf, buf_size))
09c6ecd3 Dimitris Papastamos 2012-02-22 282 return -EFAULT;
09c6ecd3 Dimitris Papastamos 2012-02-22 283 buf[buf_size] = 0;
09c6ecd3 Dimitris Papastamos 2012-02-22 284
09c6ecd3 Dimitris Papastamos 2012-02-22 285 while (*start == ' ')
09c6ecd3 Dimitris Papastamos 2012-02-22 286 start++;
09c6ecd3 Dimitris Papastamos 2012-02-22 287 reg = simple_strtoul(start, &start, 16);
09c6ecd3 Dimitris Papastamos 2012-02-22 288 while (*start == ' ')

:::::: The code at line 280 was first introduced by commit
:::::: 09c6ecd394105c4864a0e409e181c9b1578c2a63 regmap: Add support for writing to regmap registers via debugfs

:::::: TO: Dimitris Papastamos <dp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
:::::: CC: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: Binary data