From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 D059BC4740A for ; Tue, 10 Sep 2019 08:47:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1646208E4 for ; Tue, 10 Sep 2019 08:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393572AbfIJIrb (ORCPT ); Tue, 10 Sep 2019 04:47:31 -0400 Received: from mga02.intel.com ([134.134.136.20]:21859 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387794AbfIJIrP (ORCPT ); Tue, 10 Sep 2019 04:47:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2019 01:47:14 -0700 X-IronPort-AV: E=Sophos;i="5.64,489,1559545200"; d="scan'208";a="214221251" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2019 01:47:12 -0700 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by paasikivi.fi.intel.com (Postfix) with ESMTP id DA93F20C9F; Tue, 10 Sep 2019 11:47:05 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.92) (envelope-from ) id 1i7bnn-0004no-IP; Tue, 10 Sep 2019 11:47:07 +0300 From: Sakari Ailus To: Petr Mladek , linux-kernel@vger.kernel.org, rafael@kernel.org Cc: Andy Shevchenko , linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Heikki Krogerus , Joe Perches Subject: [PATCH v6 10/12] lib/vsprintf: OF nodes are first and foremost, struct device_nodes Date: Tue, 10 Sep 2019 11:47:05 +0300 Message-Id: <20190910084707.18380-11-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190910084707.18380-1-sakari.ailus@linux.intel.com> References: <20190910084707.18380-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Factor out static kobject_string() function that simply calls device_node_string(), and thus remove references to kobjects (as these are struct device_node). Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Reviewed-by: Petr Mladek --- lib/vsprintf.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 7a0006e0c3896..9c5b398d4a512 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1906,6 +1906,9 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, struct printf_spec str_spec = spec; str_spec.field_width = -1; + if (fmt[0] != 'F') + return error_string(buf, end, "(%pO?)", spec); + if (!IS_ENABLED(CONFIG_OF)) return error_string(buf, end, "(%pOF?)", spec); @@ -1979,17 +1982,6 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, return widen_string(buf, buf - buf_start, end, spec); } -static char *kobject_string(char *buf, char *end, void *ptr, - struct printf_spec spec, const char *fmt) -{ - switch (fmt[1]) { - case 'F': - return device_node_string(buf, end, ptr, spec, fmt + 1); - } - - return error_string(buf, end, "(%pO?)", spec); -} - /* * Show a '%p' thing. A kernel extension is that the '%p' is followed * by an extra set of alphanumeric characters that are extended format @@ -2168,7 +2160,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, case 'G': return flags_string(buf, end, ptr, spec, fmt); case 'O': - return kobject_string(buf, end, ptr, spec, fmt); + return device_node_string(buf, end, ptr, spec, fmt + 1); case 'x': return pointer_string(buf, end, ptr, spec); } -- 2.20.1