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=-9.8 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=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 6E593C3A59F for ; Thu, 29 Aug 2019 10:11:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FAF12339E for ; Thu, 29 Aug 2019 10:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbfH2KLN (ORCPT ); Thu, 29 Aug 2019 06:11:13 -0400 Received: from mga02.intel.com ([134.134.136.20]:26910 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727195AbfH2KKt (ORCPT ); Thu, 29 Aug 2019 06:10:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2019 03:10:48 -0700 X-IronPort-AV: E=Sophos;i="5.64,442,1559545200"; d="scan'208";a="180835442" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2019 03:10:46 -0700 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 7DAC320D41; Thu, 29 Aug 2019 13:10:40 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.92) (envelope-from ) id 1i3HO7-0006Vu-Hu; Thu, 29 Aug 2019 13:10:43 +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 Subject: [PATCH v3 08/10] lib/vsprintf: OF nodes are first and foremost, struct device_nodes Date: Thu, 29 Aug 2019 13:10:41 +0300 Message-Id: <20190829101043.24963-9-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829101043.24963-1-sakari.ailus@linux.intel.com> References: <20190829101043.24963-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 --- lib/vsprintf.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index a04a2167101ef..19f9b3f30623e 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1905,7 +1905,7 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, struct printf_spec str_spec = spec; str_spec.field_width = -1; - if (!IS_ENABLED(CONFIG_OF)) + if (!IS_ENABLED(CONFIG_OF) || fmt[0] != 'F') return error_string(buf, end, "(%pOF?)", spec); if (check_pointer(&buf, end, dn, spec)) @@ -1978,17 +1978,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 @@ -2167,7 +2156,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