From patchwork Thu Jan 23 10:32:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ron Diskin X-Patchwork-Id: 1227750 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 483JWq0y8Cz9sP3 for ; Thu, 23 Jan 2020 21:33:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728205AbgAWKdJ (ORCPT ); Thu, 23 Jan 2020 05:33:09 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:47577 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726194AbgAWKdI (ORCPT ); Thu, 23 Jan 2020 05:33:08 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from rondi@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jan 2020 12:33:01 +0200 Received: from nps-server-35.mtl.labs.mlnx (nps-server-35.mtl.labs.mlnx [10.137.1.140]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00NAX1Qr002799; Thu, 23 Jan 2020 12:33:01 +0200 Received: from nps-server-35.mtl.labs.mlnx (localhost [127.0.0.1]) by nps-server-35.mtl.labs.mlnx (8.15.2/8.15.2/Debian-11ubuntu1) with ESMTP id 00NAX1xr022710; Thu, 23 Jan 2020 12:33:01 +0200 Received: (from rondi@localhost) by nps-server-35.mtl.labs.mlnx (8.15.2/8.15.2/Submit) id 00NAWwDD022708; Thu, 23 Jan 2020 12:32:58 +0200 From: Ron Diskin To: Stephen Hemminger , David Ahern Cc: Jiri Pirko , Moshe Shemesh , netdev@vger.kernel.org, Ron Diskin Subject: [PATCH iproute2 0/6] devlink: Replace devlink print helper functions with common library functions Date: Thu, 23 Jan 2020 12:32:25 +0200 Message-Id: <1579775551-22659-1-git-send-email-rondi@mellanox.com> X-Mailer: git-send-email 1.8.4.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patchset converts devlink prints (json and non-json) to use the same common json library as the rest of iproute2. Patches 1-2 add necessary functionality to json_print library. Patch 3 removes the direct calls to json_writer. Patches 4-6 use the new functionality, replacing different pr_out_#type wrapper. Ron Diskin (6): json_print: Introduce print_#type_name_value json_print: Add new json object function not as array item devlink: Replace json prints by common library functions devlink: Replace pr_out_str wrapper function with common function devlink: Replace pr_#type_value wrapper functions with common functions devlink: Replace pr_out_bool/uint() wrappers with common print functions devlink/devlink.c | 610 +++++++++++++++++++++---------------------- include/json_print.h | 9 + lib/json_print.c | 43 ++- 3 files changed, 345 insertions(+), 317 deletions(-)