From patchwork Wed Nov 30 22:02:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kunzelmann X-Patchwork-Id: 13060476 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A0B0C4321E for ; Wed, 30 Nov 2022 22:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbiK3WCR (ORCPT ); Wed, 30 Nov 2022 17:02:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbiK3WCQ (ORCPT ); Wed, 30 Nov 2022 17:02:16 -0500 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F4F7E415 for ; Wed, 30 Nov 2022 14:02:14 -0800 (PST) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 40669240108 for ; Wed, 30 Nov 2022 23:02:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1669845733; bh=8HvKD2CVEGElEJE0JYydznFvphMHMkRvJKSRiTg1dHQ=; h=Date:To:Cc:From:Subject:From; b=Bx3VKHglLkRo4AICVrXXokpP4eSh2Ioaj19emQDAhGuyHgGc4wOgxawktVZBXtfSV vLTDxu+rV93qKxqQGCbIOyDkd4rgt9fKBQ1hkAuvZB3euk3DvLyIZmPdJzlpjCy5s1 AenAG2+6n4F0G3wBDJyIYxdPhce2JzxSzlHqKoK7QMCi9ZmGpBXijHDHpHqz8YBfv9 CIAesfLYxFWsqAJcNS2lWbQr/lNwoZDN8qWaVaP2C6oDblKVJg6miOKc2hgZ2p8Uzb E1q5VmmzOgAY1Dp0ldQXDbE58WqKvxwLy2oMgNFAXEO2HSfMPc82N9gtsuOuy7wf2e NYNSw9dGy6LVw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NMtTt5yFzz6tmq; Wed, 30 Nov 2022 23:02:10 +0100 (CET) Message-ID: <8b50f492-2a3c-5f37-76d6-61f7fc692218@posteo.de> Date: Wed, 30 Nov 2022 22:02:10 +0000 MIME-Version: 1.0 Content-Language: en-US To: netdev@vger.kernel.org Cc: BenBE@geshi.org, github@crpykng.de From: maxdev@posteo.de Subject: [PATCH] Consistent use of local `nlmsg_chain` variable `ipaddr_list_flush_or_save` Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org During a brief code review we noticed a minor consistency issue regarding the variable naming. This patch changes the use of ainfo to be consistent with linfo. The people mentioned in the commit message helped in the overall code review. Kind regards, Max From 553974345f40765ff6c96543b6de6ec3d8b6f871 Mon Sep 17 00:00:00 2001 From: Max Kunzelmann Date: Wed, 23 Mar 2022 20:26:29 +0100 Subject: [PATCH] Consistent use of local `nlmsg_chain` variable `ipaddr_list_flush_or_save` Reviewed-by: Benny Baumann Reviewed-by: Robert Geislinger --- ip/ipaddress.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 5e833482..5630d52c 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -2107,7 +2107,7 @@ static int ip_addr_list(struct nlmsg_chain *ainfo) static int ipaddr_list_flush_or_save(int argc, char **argv, int action) { struct nlmsg_chain linfo = { NULL, NULL}; - struct nlmsg_chain _ainfo = { NULL, NULL}, *ainfo = &_ainfo; + struct nlmsg_chain ainfo = { NULL, NULL}; struct nlmsg_list *l; char *filter_dev = NULL; int no_link = 0; @@ -2263,10 +2263,10 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action) if (filter.oneline) no_link = 1; - if (ip_addr_list(ainfo) != 0) + if (ip_addr_list(&ainfo) != 0) goto out; - ipaddr_filter(&linfo, ainfo); + ipaddr_filter(&linfo, &ainfo); } for (l = linfo.head; l; l = l->next) { @@ -2278,7 +2278,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action) if (brief || !no_link) res = print_linkinfo(n, stdout); if (res >= 0 && filter.family != AF_PACKET) - print_selected_addrinfo(ifi, ainfo->head, stdout); + print_selected_addrinfo(ifi, ainfo.head, stdout); if (res > 0 && !do_link && show_stats) print_link_stats(stdout, n); close_json_object(); @@ -2286,7 +2286,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action) fflush(stdout); out: - free_nlmsg_chain(ainfo); + free_nlmsg_chain(&ainfo); free_nlmsg_chain(&linfo); delete_json_obj(); return 0; -- 2.38.1