OSDN Git Service

net: tipc: Fix parameter types passed to %s formater
authorAndrew Lunn <andrew@lunn.ch>
Wed, 28 Oct 2020 00:43:33 +0000 (01:43 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Oct 2020 18:29:49 +0000 (11:29 -0700)
commitb3b7e64bcbcb46542650d1980ea22ff25f0332ee
treee83aefc7a5e9fd646393c39588969cc5195da2b7
parent23306008edd9bd21785229a0b8d13e20c3e05419
net: tipc: Fix parameter types passed to %s formater

Now that the compiler is performing printf checking, we get the warning:

net/tipc/netlink_compat.c: In function ‘tipc_nl_compat_link_stat_dump’:
net/tipc/netlink_compat.c:591:39: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘void *’ [-Wformat=]
  591 |  tipc_tlv_sprintf(msg->rep, "\nLink <%s>\n",
      |                                      ~^
      |                                       |
      |                                       char *
      |                                      %p
  592 |     nla_data(link[TIPC_NLA_LINK_NAME]));
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     |
      |     void *

There is no nla_string(), so cast to a char *.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20201028004333.929816-1-andrew@lunn.ch
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tipc/netlink_compat.c