Message ID | 20230403-regmap-maple-walk-fine-v2-1-c07371c8a867@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp124388vqo; Tue, 4 Apr 2023 12:53:30 -0700 (PDT) X-Google-Smtp-Source: AKy350b3HOcIhygd/P1K+7uG0ipirmnb30HYca8YHPyq6HiIoZ87riNsomdKuh/amgZyH0yzIrKD X-Received: by 2002:a17:906:c784:b0:92d:591f:6586 with SMTP id cw4-20020a170906c78400b0092d591f6586mr663680ejb.34.1680638010299; Tue, 04 Apr 2023 12:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680638010; cv=none; d=google.com; s=arc-20160816; b=YWUXKlmB8aSRlUeCFb8ekhwM5Sg3Ampyi1YsjBFr9nmmIHU0qnuje1+oHYQSqHZaYX mcLBgCylkxkRJcb8tstrTBa/WXP86+oP4nbX9hG2I1OCv2p7gj1xsv+rPP5R9oF6cZ9v 2DDZRtQpLP0Rz9xEePV96t3b+MljwSDH+FrvFGyqoYTgBVLbFnlpoKTVYXL5jJHv3WxS xDGIcLGV77ahWzA8cm+DN4R6IUDujg7WoFDZfHW4ZGudULUfcVldwoPPzRJuyqXGE8Wi xJT2pJs3UMQdphPPYfSk5MdnGDmJFGj9SSQkIeLDQpQzG8tp+QhAM/upuDBmyLYmbI13 +m7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=belcUcwcJSTvehLpZ3HHthnBR8LWz/q2jszUDXZZW0E=; b=GcY5waVt8gSeuVV/8nXpsD8jZazX9M8A7G2iDpdpQAH59nk0uiN+YTKhMAcGp2F4qs /NSGnPO1E/X/CHK2LhZ8OTKEg/NWDTxckRzjTZ9OILp8sIJHQKsn2LwIDo4yrlMXiwuB mTnNWtvzwKXFFjPhnG/Dmi+kgGb+HMCRfZ9VAtLWsj9mJ/VTyhiGLDvBAmbNEP5FvR7l GmvCfkbPgO5K3psXuz2PfMPZDO7dFCEKv/XYSZkDoZhRHbXCAzj4RLRbynwzOQXcrc2q O3GPtXgO820NEDF1cCxIvABozgx98FFQkSueYqkHgNW8+SlI3WQjqh1v4x/D0oV3mkQC 1JRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QCUUSa3r; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a170906831700b00947791bfdcasi766084ejx.312.2023.04.04.12.53.04; Tue, 04 Apr 2023 12:53:30 -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=@kernel.org header.s=k20201202 header.b=QCUUSa3r; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236013AbjDDTmi (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Tue, 4 Apr 2023 15:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234726AbjDDTmg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Apr 2023 15:42:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A9D740D9 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 12:42:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E7DFC63662 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 19:42:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BDF1C433EF; Tue, 4 Apr 2023 19:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680637354; bh=9jF6cncPMExB3h8iUIwTFCwOtG+nCcN1cxEvxO5Y8io=; h=From:Date:Subject:To:Cc:From; b=QCUUSa3rs55stYoSESzuIUFgKM4FYXJLnU2ZqUGAVl0lkJhfc3X7gkqiUZWGV5dX5 B/hNkM4Yq0sRmmBALwdG4QeBv6rfN0rtjUN8Gw6/QmvrYPf/o0fw/JaRKFjI6BKOLh wnNfzpe8aAs2kMjfiJGk/7txXqtj/rmh/5W0DuCFnpk31RGKSGLzlHOA8CnWcANGdb AfO/Pa4DSCINVt9neu8/vM7x2L0oV+JK6KSWxowycPTkC4o32ZuG1kV7acYJ77qinw nOps0zVk4W005pPGsOwNTAkqvACa6zAJOiDoQ3vN4npoKbpHrv9Eg6hbIvTtJvuQZz bTxajOXFOoPdQ== From: Mark Brown <broonie@kernel.org> Date: Tue, 04 Apr 2023 20:42:28 +0100 Subject: [PATCH v2] regmap: Use mas_walk() instead of mas_find() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230403-regmap-maple-walk-fine-v2-1-c07371c8a867@kernel.org> X-B4-Tracking: v=1; b=H4sIAKN9LGQC/4WNQQqDMBBFryKz7pQkNlC76j3ERWJGDdpEJkVbx Ls3eoEu/uJ9eLwNErGnBI9iA6bFJx9DBnUpoB1M6Am9ywxKqFLcRIlM/cvMmDcRrmYasfOBsLo ra51ybUcasmxNIrRsQjsc+hp5PO6ZqfOfs1c3mQef3pG/Z36Rx/u3tEiUKCotlXNakhbPkTjQd I3cQ7Pv+w+Cdfal1AAAAA== To: Liam.Howlett@Oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org> X-Mailer: b4 0.13-dev-00303 X-Developer-Signature: v=1; a=openpgp-sha256; l=1460; i=broonie@kernel.org; h=from:subject:message-id; bh=9jF6cncPMExB3h8iUIwTFCwOtG+nCcN1cxEvxO5Y8io=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBkLH2ofhETmgYh0TRqZKndr5LeWM04/2yTtJQCSP+m jP9LfwyJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZCx9qAAKCRAk1otyXVSH0HTIB/ 4hzczWbRFBucw2Q4aW32qRaWrUomLRaPgbkaAiIziLaHdGalxllgJVJYX7X6PxVRogv5VgIkAJ+C6g Ge1ATIMT5xX7lxGcjMkobPROm0QXechQ/V80oqWyZ+u97rgjgFRkWxP/enPxUfx+OiBB++EOjI3RCy W/6ZEA3P1vLelu85zbCtDMKhWRa4D6W2YfCydFZLC0nrUZLfClrMnyVo1jU7oLymErdhhPs/i4gP2c n/w2+XHPh78tyR05UbpfZtKbeq4fuhqItSknFkoFdbyxZ+6GGjzR5ob0gnLAVmBILFPAo2srAAvu3f 54XRBnNKR5DmrozZ4OJ+NhkUUYYrUe X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762276682014524129?= X-GMAIL-MSGID: =?utf-8?q?1762276682014524129?= |
Series |
[v2] regmap: Use mas_walk() instead of mas_find()
|
|
Commit Message
Mark Brown
April 4, 2023, 7:42 p.m. UTC
Liam recommends using mas_walk() instead of mas_find() for our use case so
let's do that, it avoids some minor overhead associated with being able to
restart the operation which we don't need since we do a simple search.
Suggested-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
Changes in v2:
- Don't set index and last again needlessly.
- Link to v1: https://lore.kernel.org/r/20230403-regmap-maple-walk-fine-v1-1-09512dd51e50@kernel.org
---
drivers/base/regmap/regcache-maple.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
base-commit: f033c26de5a5734625d2dd1dc196745fae186f1b
change-id: 20230403-regmap-maple-walk-fine-982bbd2dcfe5
Best regards,
Comments
On Tue, 04 Apr 2023 20:42:28 +0100, Mark Brown wrote: > Liam recommends using mas_walk() instead of mas_find() for our use case so > let's do that, it avoids some minor overhead associated with being able to > restart the operation which we don't need since we do a simple search. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next Thanks! [1/1] regmap: Use mas_walk() instead of mas_find() commit: fac79bad889bb167a37492181646992c8c48903b All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c index 497cc708d277..e48f5b0c96cb 100644 --- a/drivers/base/regmap/regcache-maple.c +++ b/drivers/base/regmap/regcache-maple.c @@ -22,7 +22,7 @@ static int regcache_maple_read(struct regmap *map, rcu_read_lock(); - entry = mas_find(&mas, reg); + entry = mas_walk(&mas); if (!entry) { rcu_read_unlock(); return -ENOENT; @@ -47,7 +47,7 @@ static int regcache_maple_write(struct regmap *map, unsigned int reg, rcu_read_lock(); - entry = mas_find(&mas, reg); + entry = mas_walk(&mas); if (entry) { entry[reg - mas.index] = val; rcu_read_unlock();