From patchwork Fri Aug 4 14:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 710475 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 CB659C04A94 for ; Fri, 4 Aug 2023 14:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjHDOjO (ORCPT ); Fri, 4 Aug 2023 10:39:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjHDOjN (ORCPT ); Fri, 4 Aug 2023 10:39:13 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB24146B1; Fri, 4 Aug 2023 07:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691159951; x=1722695951; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=treqQoCApe7X7F3bCvmb79fj9fFVPi/mHsyYWBfo0dA=; b=HCVkTWEbOlR/t7wlztoYRtqzjQCzRTatZsL988vf3E3bTQAkW4ZJ8+DS 1EeQTzDB/KbjFdROgHxYZA1ZKz4sSfZO03QNtDzL5pO4JsrROFMKX+CDn MxzexTaiF2tsZZ9BafU/hTzPB4PvI3T1b0WFLAvbXWQqJYYKrwMBmx6Oi MEJY/Xu3mUvk2UqhEHrilQq9eX5T7tZO+tXvc8u8zlJ03neM1us44xqeG z6dmtNhgJ59Cb0VL1Ww6BSu1U0pzLr4Ll8desPLZkXlojnTfQvc/hoDYJ LgC2PNmxkohRbpzkPqFl8Bhwalf6T5CRT6q33fD00S7xp7OfFkP+xm1cS A==; X-IronPort-AV: E=McAfee;i="6600,9927,10792"; a="436487285" X-IronPort-AV: E=Sophos;i="6.01,255,1684825200"; d="scan'208";a="436487285" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2023 07:39:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10792"; a="795444753" X-IronPort-AV: E=Sophos;i="6.01,255,1684825200"; d="scan'208";a="795444753" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 04 Aug 2023 07:39:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8EC2BF12; Fri, 4 Aug 2023 17:39:14 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , Saravana Kannan , Andy Shevchenko , Stephen Boyd , Dario Binacchi , Tony Lindgren , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-hardening@vger.kernel.org Cc: "Rafael J. Wysocki" , Peter De Schrijver , Prashant Gaikwad , Michael Turquette , Thierry Reding , Jonathan Hunter , Tero Kristo , Kees Cook , Andy Shevchenko Subject: [PATCH v2 3/4] clk: tegra: Replace kstrdup() + strreplace() with kstrdup_and_replace() Date: Fri, 4 Aug 2023 17:39:09 +0300 Message-Id: <20230804143910.15504-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230804143910.15504-1-andriy.shevchenko@linux.intel.com> References: <20230804143910.15504-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Replace open coded functionality of kstrdup_and_replace() with a call. Signed-off-by: Andy Shevchenko --- drivers/clk/tegra/clk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c index 333a3ff0db98..19037346f522 100644 --- a/drivers/clk/tegra/clk.c +++ b/drivers/clk/tegra/clk.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include @@ -384,12 +384,10 @@ static struct device_node *tegra_clk_get_of_node(struct clk_hw *hw) struct device_node *np; char *node_name; - node_name = kstrdup(hw->init->name, GFP_KERNEL); + node_name = kstrdup_and_replace(hw->init->name, '_', '-', GFP_KERNEL); if (!node_name) return NULL; - strreplace(node_name, '_', '-'); - for_each_child_of_node(tegra_car_np, np) { if (!strcmp(np->name, node_name)) break;