From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Sutter Subject: Re: [PATCHv2 iproute2] bridge/mdb: fix missing new line when show bridge mdb Date: Tue, 11 Sep 2018 13:01:57 +0200 Message-ID: <20180911110157.GF2630@orbyte.nwl.cc> References: <1536118423-20604-1-git-send-email-liuhangbin@gmail.com> <1536629195-12540-1-git-send-email-liuhangbin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, Stephen Hemminger , David Ahern To: Hangbin Liu Return-path: Received: from orbyte.nwl.cc ([151.80.46.58]:55992 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726569AbeIKQAs (ORCPT ); Tue, 11 Sep 2018 12:00:48 -0400 Content-Disposition: inline In-Reply-To: <1536629195-12540-1-git-send-email-liuhangbin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Hi Hangbin, On Tue, Sep 11, 2018 at 09:26:35AM +0800, Hangbin Liu wrote: [...] > + if (!is_json_context() && !show_stats) > + print_string(PRINT_FP, NULL, "\n", NULL); There is no need to check for !is_json_context() here. You give a type of PRINT_FP which won't lead to output if JSON is active. For reference, check print_color_string() in lib/json_print.c and _IS_JSON_CONTEXT macro. Cheers, Phil