Hi Andrew,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url:
https://github.com/0day-ci/linux/commits/Andrew-Lunn/net-dccp-Add-__print...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
cd29296fdfca919590e4004a7e4905544f4c4a32
config: x86_64-randconfig-a004-20201028 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
772aaa602383cf82795572ebcd86b0e660f3579f)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
#
https://github.com/0day-ci/linux/commit/0be08855cea6e7b987406c1beee6ca1b5...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Andrew-Lunn/net-dccp-Add-__printf-markup-to-fix-Wsuggest-attribute-format/20201029-081346
git checkout 0be08855cea6e7b987406c1beee6ca1b508f5066
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
> net/tipc/netlink_compat.c:592:5: warning: format specifies type
'char *' but the argument has type 'void *' [-Wformat]
nla_data(link[TIPC_NLA_LINK_NAME]));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +592 net/tipc/netlink_compat.c
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 541
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 542 static int
tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 543 struct nlattr **attrs)
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 544 {
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 545 char *name;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 546 struct nlattr *link[TIPC_NLA_LINK_MAX +
1];
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 547 struct nlattr *prop[TIPC_NLA_PROP_MAX +
1];
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 548 struct nlattr *stats[TIPC_NLA_STATS_MAX +
1];
297f7d2cce6a15 Baozeng Ding 2016-05-24 549 int err;
0762216c0ad2a2 Ying Xue 2019-01-14 550 int len;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 551
297f7d2cce6a15 Baozeng Ding 2016-05-24 552 if (!attrs[TIPC_NLA_LINK])
297f7d2cce6a15 Baozeng Ding 2016-05-24 553 return -EINVAL;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 554
8cb081746c031f Johannes Berg 2019-04-26 555 err = nla_parse_nested_deprecated(link,
TIPC_NLA_LINK_MAX,
8cb081746c031f Johannes Berg 2019-04-26 556 attrs[TIPC_NLA_LINK], NULL, NULL);
297f7d2cce6a15 Baozeng Ding 2016-05-24 557 if (err)
297f7d2cce6a15 Baozeng Ding 2016-05-24 558 return err;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 559
297f7d2cce6a15 Baozeng Ding 2016-05-24 560 if (!link[TIPC_NLA_LINK_PROP])
297f7d2cce6a15 Baozeng Ding 2016-05-24 561 return -EINVAL;
297f7d2cce6a15 Baozeng Ding 2016-05-24 562
8cb081746c031f Johannes Berg 2019-04-26 563 err = nla_parse_nested_deprecated(prop,
TIPC_NLA_PROP_MAX,
8cb081746c031f Johannes Berg 2019-04-26 564 link[TIPC_NLA_LINK_PROP], NULL,
8cb081746c031f Johannes Berg 2019-04-26 565 NULL);
297f7d2cce6a15 Baozeng Ding 2016-05-24 566 if (err)
297f7d2cce6a15 Baozeng Ding 2016-05-24 567 return err;
297f7d2cce6a15 Baozeng Ding 2016-05-24 568
297f7d2cce6a15 Baozeng Ding 2016-05-24 569 if (!link[TIPC_NLA_LINK_STATS])
297f7d2cce6a15 Baozeng Ding 2016-05-24 570 return -EINVAL;
297f7d2cce6a15 Baozeng Ding 2016-05-24 571
8cb081746c031f Johannes Berg 2019-04-26 572 err = nla_parse_nested_deprecated(stats,
TIPC_NLA_STATS_MAX,
8cb081746c031f Johannes Berg 2019-04-26 573 link[TIPC_NLA_LINK_STATS], NULL,
8cb081746c031f Johannes Berg 2019-04-26 574 NULL);
297f7d2cce6a15 Baozeng Ding 2016-05-24 575 if (err)
297f7d2cce6a15 Baozeng Ding 2016-05-24 576 return err;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 577
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 578 name = (char *)TLV_DATA(msg->req);
0762216c0ad2a2 Ying Xue 2019-01-14 579
4f07b80c973348 Xin Long 2019-06-25 580 len = TLV_GET_DATA_LEN(msg->req);
4f07b80c973348 Xin Long 2019-06-25 581 if (len <= 0)
4f07b80c973348 Xin Long 2019-06-25 582 return -EINVAL;
4f07b80c973348 Xin Long 2019-06-25 583
fd567ac20cb037 John Rutherford 2019-11-26 584 len = min_t(int, len,
TIPC_MAX_LINK_NAME);
0762216c0ad2a2 Ying Xue 2019-01-14 585 if (!string_is_valid(name, len))
0762216c0ad2a2 Ying Xue 2019-01-14 586 return -EINVAL;
0762216c0ad2a2 Ying Xue 2019-01-14 587
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 588 if (strcmp(name,
nla_data(link[TIPC_NLA_LINK_NAME])) != 0)
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 589 return 0;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 590
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 591 tipc_tlv_sprintf(msg->rep,
"\nLink <%s>\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 @592 nla_data(link[TIPC_NLA_LINK_NAME]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 593
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 594 if (link[TIPC_NLA_LINK_BROADCAST]) {
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 595 __fill_bc_link_stat(msg, prop, stats);
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 596 return 0;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 597 }
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 598
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 599 if (link[TIPC_NLA_LINK_ACTIVE])
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 600 tipc_tlv_sprintf(msg->rep, "
ACTIVE");
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 601 else if (link[TIPC_NLA_LINK_UP])
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 602 tipc_tlv_sprintf(msg->rep, "
STANDBY");
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 603 else
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 604 tipc_tlv_sprintf(msg->rep, "
DEFUNCT");
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 605
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 606 tipc_tlv_sprintf(msg->rep, "
MTU:%u Priority:%u",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 607 nla_get_u32(link[TIPC_NLA_LINK_MTU]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 608
nla_get_u32(prop[TIPC_NLA_PROP_PRIO]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 609
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 610 tipc_tlv_sprintf(msg->rep, "
Tolerance:%u ms Window:%u packets\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 611 nla_get_u32(prop[TIPC_NLA_PROP_TOL]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 612
nla_get_u32(prop[TIPC_NLA_PROP_WIN]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 613
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 614 tipc_tlv_sprintf(msg->rep,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 615 " RX packets:%u fragments:%u/%u
bundles:%u/%u\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 616 nla_get_u32(link[TIPC_NLA_LINK_RX]) -
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 617
nla_get_u32(stats[TIPC_NLA_STATS_RX_INFO]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 618
nla_get_u32(stats[TIPC_NLA_STATS_RX_FRAGMENTS]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 619
nla_get_u32(stats[TIPC_NLA_STATS_RX_FRAGMENTED]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 620
nla_get_u32(stats[TIPC_NLA_STATS_RX_BUNDLES]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 621
nla_get_u32(stats[TIPC_NLA_STATS_RX_BUNDLED]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 622
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 623 tipc_tlv_sprintf(msg->rep,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 624 " TX packets:%u fragments:%u/%u
bundles:%u/%u\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 625 nla_get_u32(link[TIPC_NLA_LINK_TX]) -
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 626
nla_get_u32(stats[TIPC_NLA_STATS_TX_INFO]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 627
nla_get_u32(stats[TIPC_NLA_STATS_TX_FRAGMENTS]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 628
nla_get_u32(stats[TIPC_NLA_STATS_TX_FRAGMENTED]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 629
nla_get_u32(stats[TIPC_NLA_STATS_TX_BUNDLES]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 630
nla_get_u32(stats[TIPC_NLA_STATS_TX_BUNDLED]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 631
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 632 tipc_tlv_sprintf(msg->rep,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 633 " TX profile sample:%u packets
average:%u octets\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 634
nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_CNT]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 635
nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_TOT]) /
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 636
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 637
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 638 tipc_tlv_sprintf(msg->rep,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 639 " 0-64:%u%% -256:%u%% -1024:%u%%
-4096:%u%% ",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 640
perc(nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_P0]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 641
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT])),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 642
perc(nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_P1]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 643
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT])),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 644
perc(nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_P2]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 645
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT])),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 646
perc(nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_P3]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 647
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT])));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 648
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 649 tipc_tlv_sprintf(msg->rep,
"-16384:%u%% -32768:%u%% -66000:%u%%\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 650
perc(nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_P4]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 651
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT])),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 652
perc(nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_P5]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 653
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT])),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 654
perc(nla_get_u32(stats[TIPC_NLA_STATS_MSG_LEN_P6]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 655
nla_get_u32(stats[TIPC_NLA_STATS_MSG_PROF_TOT])));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 656
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 657 tipc_tlv_sprintf(msg->rep,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 658 " RX states:%u probes:%u naks:%u
defs:%u dups:%u\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 659
nla_get_u32(stats[TIPC_NLA_STATS_RX_STATES]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 660
nla_get_u32(stats[TIPC_NLA_STATS_RX_PROBES]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 661
nla_get_u32(stats[TIPC_NLA_STATS_RX_NACKS]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 662
nla_get_u32(stats[TIPC_NLA_STATS_RX_DEFERRED]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 663
nla_get_u32(stats[TIPC_NLA_STATS_DUPLICATES]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 664
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 665 tipc_tlv_sprintf(msg->rep,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 666 " TX states:%u probes:%u naks:%u
acks:%u dups:%u\n",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 667
nla_get_u32(stats[TIPC_NLA_STATS_TX_STATES]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 668
nla_get_u32(stats[TIPC_NLA_STATS_TX_PROBES]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 669
nla_get_u32(stats[TIPC_NLA_STATS_TX_NACKS]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 670
nla_get_u32(stats[TIPC_NLA_STATS_TX_ACKS]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 671
nla_get_u32(stats[TIPC_NLA_STATS_RETRANSMITTED]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 672
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 673 tipc_tlv_sprintf(msg->rep,
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 674 " Congestion link:%u Send queue
max:%u avg:%u",
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 675
nla_get_u32(stats[TIPC_NLA_STATS_LINK_CONGS]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 676
nla_get_u32(stats[TIPC_NLA_STATS_MAX_QUEUE]),
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 677
nla_get_u32(stats[TIPC_NLA_STATS_AVG_QUEUE]));
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 678
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 679 return 0;
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 680 }
f2b3b2d4ccbf96 Richard Alpe 2015-02-09 681
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org