From patchwork Wed Oct 28 00:43:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 11864211 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E39BC4363A for ; Thu, 29 Oct 2020 00:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6662B20780 for ; Thu, 29 Oct 2020 00:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390864AbgJ2AOA (ORCPT ); Wed, 28 Oct 2020 20:14:00 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50800 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390855AbgJ2AN5 (ORCPT ); Wed, 28 Oct 2020 20:13:57 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kXZZ5-003ttp-70; Wed, 28 Oct 2020 01:43:47 +0100 From: Andrew Lunn To: Jakub Kicinski Cc: netdev , Jon Maloy , Ying Xue , Andrew Lunn Subject: [=PATCH net-next] net: tipc: Fix parameter types passed to %s formater Date: Wed, 28 Oct 2020 01:43:33 +0100 Message-Id: <20201028004333.929816-1-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- net/tipc/netlink_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 17a90a2fe753..5c6206c9d6a8 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -589,7 +589,7 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg, return 0; tipc_tlv_sprintf(msg->rep, "\nLink <%s>\n", - nla_data(link[TIPC_NLA_LINK_NAME])); + (char *)nla_data(link[TIPC_NLA_LINK_NAME])); if (link[TIPC_NLA_LINK_BROADCAST]) { __fill_bc_link_stat(msg, prop, stats);