Re: [PATCH 3/4] bitmap_parselist: rework input string parser

From: kbuild test robot
Date: Sun Dec 23 2018 - 08:06:28 EST


Hi Yuri,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.20-rc7 next-20181221]
[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/Yuri-Norov/rework-bitmap_parselist/20181223-175529
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
lib/bitmap.c:679: warning: Excess function parameter 'buflen' description in '__bitmap_parselist'
lib/bitmap.c:680: warning: Excess function parameter 'buflen' description in '__bitmap_parselist'
>> lib/bitmap.c:680: warning: Function parameter or member 'end' not described in '__bitmap_parselist'
lib/bitmap.c:680: warning: Excess function parameter 'buflen' description in '__bitmap_parselist'
include/linux/rcutree.h:1: warning: no structured comments found
kernel/rcu/tree.c:684: warning: Excess function parameter 'irq' description in 'rcu_nmi_exit'
include/linux/srcu.h:175: warning: Function parameter or member 'p' not described in 'srcu_dereference_notrace'
include/linux/srcu.h:175: warning: Function parameter or member 'sp' not described in 'srcu_dereference_notrace'
include/linux/gfp.h:1: warning: no structured comments found
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev'
include/net/cfg80211.h:4439: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev'
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '
include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats '

vim +680 lib/bitmap.c

32eb0e6b5 Yuri Norov 2018-12-23 649
5aaba3631 Sudeep Holla 2014-09-30 650 /**
4b060420a Mike Travis 2011-05-24 651 * __bitmap_parselist - convert list format ASCII string to bitmap
b0825ee3a Randy Dunlap 2011-06-15 652 * @buf: read nul-terminated user string from this buffer
4b060420a Mike Travis 2011-05-24 653 * @buflen: buffer size in bytes. If string is smaller than this
4b060420a Mike Travis 2011-05-24 654 * then it must be terminated with a \0.
4b060420a Mike Travis 2011-05-24 655 * @is_user: location of buffer, 0 indicates kernel space
6e1907ffd Randy Dunlap 2006-06-25 656 * @maskp: write resulting mask here
^1da177e4 Linus Torvalds 2005-04-16 657 * @nmaskbits: number of bits in mask to be written
^1da177e4 Linus Torvalds 2005-04-16 658 *
^1da177e4 Linus Torvalds 2005-04-16 659 * Input format is a comma-separated list of decimal numbers and
^1da177e4 Linus Torvalds 2005-04-16 660 * ranges. Consecutively set bits are shown as two hyphen-separated
^1da177e4 Linus Torvalds 2005-04-16 661 * decimal numbers, the smallest and largest bit numbers set in
^1da177e4 Linus Torvalds 2005-04-16 662 * the range.
2d13e6ca4 Noam Camus 2016-10-11 663 * Optionally each range can be postfixed to denote that only parts of it
2d13e6ca4 Noam Camus 2016-10-11 664 * should be set. The range will divided to groups of specific size.
2d13e6ca4 Noam Camus 2016-10-11 665 * From each group will be used only defined amount of bits.
2d13e6ca4 Noam Camus 2016-10-11 666 * Syntax: range:used_size/group_size
2d13e6ca4 Noam Camus 2016-10-11 667 * Example: 0-1023:2/256 ==> 0,1,256,257,512,513,768,769
^1da177e4 Linus Torvalds 2005-04-16 668 *
40bf19a8d Mauro Carvalho Chehab 2017-03-30 669 * Returns: 0 on success, -errno on invalid input strings. Error values:
40bf19a8d Mauro Carvalho Chehab 2017-03-30 670 *
32eb0e6b5 Yuri Norov 2018-12-23 671 * - ``-EINVAL``: wrong region format
40bf19a8d Mauro Carvalho Chehab 2017-03-30 672 * - ``-EINVAL``: invalid character in string
40bf19a8d Mauro Carvalho Chehab 2017-03-30 673 * - ``-ERANGE``: bit number specified too large for mask
32eb0e6b5 Yuri Norov 2018-12-23 674 * - ``-EOVERFLOW``: integer overflow in the input parameters
^1da177e4 Linus Torvalds 2005-04-16 675 */
32eb0e6b5 Yuri Norov 2018-12-23 676 static int __bitmap_parselist(const char *buf, const char *const end,
4b060420a Mike Travis 2011-05-24 677 int is_user, unsigned long *maskp,
4b060420a Mike Travis 2011-05-24 678 int nmaskbits)
^1da177e4 Linus Torvalds 2005-04-16 @679 {
87ac23b87 Yuri Norov 2018-12-23 @680 struct region r;
32eb0e6b5 Yuri Norov 2018-12-23 681 long ret;
^1da177e4 Linus Torvalds 2005-04-16 682
^1da177e4 Linus Torvalds 2005-04-16 683 bitmap_zero(maskp, nmaskbits);
4b060420a Mike Travis 2011-05-24 684
32eb0e6b5 Yuri Norov 2018-12-23 685 while (buf && buf < end) {
32eb0e6b5 Yuri Norov 2018-12-23 686 buf = bitmap_find_region(buf, end, is_user);
32eb0e6b5 Yuri Norov 2018-12-23 687 if (buf == NULL)
32eb0e6b5 Yuri Norov 2018-12-23 688 return 0;
87ac23b87 Yuri Norov 2018-12-23 689
32eb0e6b5 Yuri Norov 2018-12-23 690 buf = bitmap_parse_region(&r, buf, end, is_user);
32eb0e6b5 Yuri Norov 2018-12-23 691 if (IS_ERR(buf))
32eb0e6b5 Yuri Norov 2018-12-23 692 return (long)buf;
87ac23b87 Yuri Norov 2018-12-23 693
87ac23b87 Yuri Norov 2018-12-23 694 ret = bitmap_check_region(&r);
87ac23b87 Yuri Norov 2018-12-23 695 if (ret)
87ac23b87 Yuri Norov 2018-12-23 696 return ret;
87ac23b87 Yuri Norov 2018-12-23 697
87ac23b87 Yuri Norov 2018-12-23 698 ret = bitmap_set_region(&r, maskp, nmaskbits);
87ac23b87 Yuri Norov 2018-12-23 699 if (ret)
87ac23b87 Yuri Norov 2018-12-23 700 return ret;
32eb0e6b5 Yuri Norov 2018-12-23 701 }
87ac23b87 Yuri Norov 2018-12-23 702
^1da177e4 Linus Torvalds 2005-04-16 703 return 0;
^1da177e4 Linus Torvalds 2005-04-16 704 }
4b060420a Mike Travis 2011-05-24 705

:::::: The code at line 680 was first introduced by commit
:::::: 87ac23b8755f8cbef41f1befaee43d76bbfb2cc9 bitmap_parselist: move part of logic to helpers

:::::: TO: Yuri Norov <ynorov@xxxxxxxxxxx>
:::::: CC: 0day robot <lkp@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip