Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19381023rwd; Wed, 28 Jun 2023 08:34:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6e6X9mfgf/ut+ANVz9Lz7N2H/A67mwOjoSmYuAxaKqZTEZGu3vqFY19CgpTLLlzlOz6Ofz X-Received: by 2002:a17:907:2d2b:b0:988:d6ca:ea72 with SMTP id gs43-20020a1709072d2b00b00988d6caea72mr24952500ejc.71.1687966489258; Wed, 28 Jun 2023 08:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687966489; cv=none; d=google.com; s=arc-20160816; b=r4t/G39Q4NGLeL9Irnhgt36hp6aIzICyaMmuaOr1uIPMTnTPK3mHwJOEILKdU0dKZi Mw7JcB17eeZ80OGuhtVjXhqgydsBsfFcMfjuadQopG+VDFUGoopifn0Fzs/+PlqGwju/ ldKDSZyFHe0nlRxM0AL19+MEVL2m1XfmTQrshboEn54lAxm3H4jJAMTO16HqPr+IJ5nf FIREdorMiu+IfwhSklwnNcEg0CBCRPjZSJwf1Qcwj5ZPiJU42F+npffYuN1okZPXk+lV 1BTcHkCD1rYmg02dKjtAsDeIyLnWXgFfn2ZUo9eQclw0C8D1LI55mNLWz16EsgEfFTMy RVBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Gwb6f/frdoyDhlugn/dkbRaRWLY3CZfwAk6iNWws4+c=; fh=XrA2ku+PA66OSRadqxacVu9ngzn45Ll5WReP+bMahIs=; b=Ca9modu1WHGi14h862MDPoheQsGz8CLP2hQUT478fVaUQTt94b0EDC/gw3IZKb+4vd 4o4qw+muRgtOukjhRFPkp3uFZSNHss1jbnHN8X1ml4gZHnvKwwol17NVpmvsZSfZa9A7 zoAtjXyuubsUCrwb3QFs++K/9htpAXSYrKk6W8Go01VHWY6zgR2rOIUvy+AiruHzVClc vdpT4jJuNR1TJgGtyp8dPmshWWADT5UMXfDnXzikmND+nXEkKtzPF9eel5BJcE0s7Xm1 OPKaGQeHgtgoy2m3XYlOWuEffZj5A0wji3pHXoo5saV6IRO97JTfs/quPfNVTJWhFnn1 FOMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pe4JDV6h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lu9-20020a170906fac900b009884f6b049bsi5607561ejb.41.2023.06.28.08.34.21; Wed, 28 Jun 2023 08:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pe4JDV6h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232342AbjF1Pcl (ORCPT + 99 others); Wed, 28 Jun 2023 11:32:41 -0400 Received: from mga09.intel.com ([134.134.136.24]:19763 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232246AbjF1PcZ (ORCPT ); Wed, 28 Jun 2023 11:32:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687966345; x=1719502345; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ICZEGmnjo8mIWqvcZaLyV+IHFzcjkKGkir9xoI+1F50=; b=Pe4JDV6hj+t1pbcIG166ayBe1LxLcekIvU0GVBDZPgQHgc724ZKeJGdd NqtufppbfzFRrOEYRHgDEv+hKCnmEZPYeJG55DTZEpo971gGfja5X57ye GdULcXQrxQzGgSKNBblr0hDwRRicqhcbRpI+X4CCbeu0CkJv2kK6QdzaI 4J77zu67GDvCqejQU1OAgGiEU6wHwuzOXFPWi6XtLuFIsvKdlswo8FcjQ 1nHqqcn1GApCU8wV9P1ZewlTl1qDX8niBqYx6p6hS+0Dq9XC0v1rIMpw8 ELLY+gm+NfoCZI42izQCEnNcnI6cQQMBzweWCOEN1t7rNR478AO58GZdP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="364426989" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="364426989" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 08:32:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="782344681" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="782344681" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 28 Jun 2023 08:32:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 967CE4DA; Wed, 28 Jun 2023 18:32: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 Cc: "Rafael J. Wysocki" , Peter De Schrijver , Prashant Gaikwad , Michael Turquette , Thierry Reding , Jonathan Hunter , Tero Kristo , Andy Shevchenko Subject: [PATCH v1 2/4] driver core: Replace kstrdup() + strreplace() with kstrdup_and_replace() Date: Wed, 28 Jun 2023 18:32:09 +0300 Message-Id: <20230628153211.52988-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230628153211.52988-1-andriy.shevchenko@linux.intel.com> References: <20230628153211.52988-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace open coded functionalify of kstrdup_and_replace() with a call. Signed-off-by: Andy Shevchenko --- drivers/base/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 3dff5037943e..af0ee691520a 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include /* for dma_default_coherent */ @@ -3910,10 +3910,9 @@ const char *device_get_devnode(const struct device *dev, return dev_name(dev); /* replace '!' in the name with '/' */ - s = kstrdup(dev_name(dev), GFP_KERNEL); + s = kstrdup_and_replace(dev_name(dev), '!', '/', GFP_KERNEL); if (!s) return NULL; - strreplace(s, '!', '/'); return *tmp = s; } -- 2.40.0.1.gaa8946217a0b