Message ID | 79b9c9d9f86b4c573f0d3f2dac0a6fc9e6024058.1708154999.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-69714-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp194678dyc; Fri, 16 Feb 2024 23:32:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQj3jD/gJJawG7iZ9SQl4f6vy/zE1BBiWkJ6wseiffzoTwK8oUVrK+AalD4d1FZeN89GGtDvp66il1dXwQYS4Dw7jL/w== X-Google-Smtp-Source: AGHT+IEh9kKNN/0Yg04XF5FHqXVEAvCy+2EEmh8wEuITbTlcflYRqBc9P4K8PbumhIGrlU+xxbAr X-Received: by 2002:a05:622a:1886:b0:42c:7b96:12df with SMTP id v6-20020a05622a188600b0042c7b9612dfmr16697481qtc.31.1708155143973; Fri, 16 Feb 2024 23:32:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708155143; cv=pass; d=google.com; s=arc-20160816; b=RHcl+FCrq5HvvH0t2L50tF8tuz3yNdyoudPpahE+wHUrzFQIVVdaXrBt2VUwijeOQh WBqKGxBBRLdKPBsttBcYhvfl6fnRXFZua02LsEPeycXkk4UY8uVFtmBtbHfZSjLqoEPs XtwRn/M5M5ScXJhkkvZ9BvnFHF1JRbb9Yr1F2DHgunIySnfJq3NLIrGZiG6Upcc3xs9B tpJ19QWLbShIAYqtAnxwSOA7NEJCR8/9CeWbumvCgUvBOoP/ZcV5jwheLnJC84dPmQce ecAamP/gLIgVwnqjdXmEbGPUGoM0eM06x2LaW8WfDaz8tJWr0L5mMQm+Vx2SiCxCnmn7 Pl3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=HXDa8YFPQiliIbuq5HJ9khulV8rK+PXHSC6Ee9kcXik=; fh=AkZTJ1vQdqOJlAfk7xXIPyq0VWZ2grm6Iy/f8NX2w48=; b=OZg+y7U2OMw6/u1K84ur1TDM7n6w3hoRKodecZbgvIeTWqeOo1pLVXJel6bo6yXgIl f1qEPp5XOlcIo5w58vPvOtK+2BQ/xsPwm3SEIotmM2Ice7ABm1M9vpO18TqImoeXjgE5 K3vWZ+FIC5taB9BPeDdInEEi3Qyk6yHOfQLl4Lx7hn3UDmxE+GkBa87cqr29Cr3i5vOz 3NadsbhLJ+njrqEo5rLDY5uwkFxu7slSuo8iexhldJ0CMed+mtKQLD1aCl+HhR9QfHWq R5ePyUTDiI+Jdu/reMLIvQuTRjwn/EFX9SAgF1+4jfnESAVdw0a3TVLEEY2vZZTzDIe+ P+YA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=phcQj97w; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-69714-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69714-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bp13-20020a05620a458d00b00785da71a474si1651405qkb.193.2024.02.16.23.32.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 23:32:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69714-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=phcQj97w; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-69714-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69714-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BDBEC1C20FED for <ouuuleilei@gmail.com>; Sat, 17 Feb 2024 07:32:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 794B31CF98; Sat, 17 Feb 2024 07:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="phcQj97w" Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3705517727 for <linux-kernel@vger.kernel.org>; Sat, 17 Feb 2024 07:31:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708155120; cv=none; b=lEXpdpTYnkwKCjTxtsQtZ7NqNZeavgJUj7pOiDhEwF8OxCf4n9WVBg6cWLnOGuBrMWcAk0dEc7tqWT9P0GnyQ94eI0Jz+/AVZVPNALy56psYVjtQxdnO1cwMHlYTxPVEQSo38QpMnYvr0C7azTXcfxFcn/NJsidu9lGTzaX9a7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708155120; c=relaxed/simple; bh=npv7ZOWRpw6sxGJkWx9vOTc73+q2ocP0AqU18/94cms=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kmzLPrAjFLCQmb4CVKURy4wKSazuflOFf85brgS4Dn4EGwEXsCtHLYv3YRGPmmPuAfmD7tIf7/S/EzwpG6hV/Gc6pRBGfI1NOaCgS8bRAP6c3+qkJb5rNT1Y0xC9zN7ep/8ScZLvAxbeHAUtmqfUj2S2letfze3c40Xz7oXk6yY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=phcQj97w; arc=none smtp.client-ip=80.12.242.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id bF9rr7RBlRhCJbF9rr0LV3; Sat, 17 Feb 2024 08:30:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1708155048; bh=HXDa8YFPQiliIbuq5HJ9khulV8rK+PXHSC6Ee9kcXik=; h=From:To:Cc:Subject:Date; b=phcQj97w9FE+Zh+H12MyDYbqxfDXboeZhcdKcaDy6IYyvzkOgI972oBzbtXtwMg5C TSZzZnStNK+6c0yjaRj6GF3y0dBpnOXAJAUlwEsLl9upx5aFrJOzMzF2hKsQXaT49C mXh+FDJQK6n9udm26kvldXMSW6j8/KqH2VouZIXH4wPfx71+y8hUTRLOsfunS4eSb0 xMXnV9UilbxMZjyEV378CWYPjQR0nLNmPjq0rPE2VV1lRyo6Te76CGsSbLDlhQVbNA BXcBr0lnTd3SDNbOwf3iQ+bI5ijk3c7TvYPinnOVdFynHb25p4ZKxfLFfGilW4zWsl /+7QF7t8eyVFw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 17 Feb 2024 08:30:48 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Marcel Holtmann <marcel@holtmann.org>, Luiz Augusto von Dentz <luiz.dentz@gmail.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-bluetooth@vger.kernel.org Subject: [PATCH 1/2] Bluetooth: btbcm: Use strreplace() Date: Sat, 17 Feb 2024 08:30:41 +0100 Message-ID: <79b9c9d9f86b4c573f0d3f2dac0a6fc9e6024058.1708154999.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791130487972158544 X-GMAIL-MSGID: 1791130487972158544 |
Series |
[1/2] Bluetooth: btbcm: Use strreplace()
|
|
Commit Message
Christophe JAILLET
Feb. 17, 2024, 7:30 a.m. UTC
Use strreplace() instead of hand-writing it.
It is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/bluetooth/btbcm.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Comments
Hello: This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Sat, 17 Feb 2024 08:30:41 +0100 you wrote: > Use strreplace() instead of hand-writing it. > It is less verbose. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > drivers/bluetooth/btbcm.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) Here is the summary with links: - [1/2] Bluetooth: btbcm: Use strreplace() https://git.kernel.org/bluetooth/bluetooth-next/c/76912dcbabc6 - [2/2] Bluetooth: btbcm: Use devm_kstrdup() https://git.kernel.org/bluetooth/bluetooth-next/c/d095e06a1569 You are awesome, thank you!
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index 0a5445ac5e1b..01d2343b4978 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -11,6 +11,7 @@ #include <linux/firmware.h> #include <linux/dmi.h> #include <linux/of.h> +#include <linux/string.h> #include <asm/unaligned.h> #include <net/bluetooth/bluetooth.h> @@ -544,7 +545,6 @@ static const char *btbcm_get_board_name(struct device *dev) char *board_type; const char *tmp; int len; - int i; root = of_find_node_by_path("/"); if (!root) @@ -557,10 +557,7 @@ static const char *btbcm_get_board_name(struct device *dev) len = strlen(tmp) + 1; board_type = devm_kzalloc(dev, len, GFP_KERNEL); strscpy(board_type, tmp, len); - for (i = 0; i < len; i++) { - if (board_type[i] == '/') - board_type[i] = '-'; - } + strreplace(board_type, '/', '-'); of_node_put(root); return board_type;