From patchwork Tue Sep 26 05:20:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13398670 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD1E4E8181B for ; Tue, 26 Sep 2023 05:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NtjoeuQVS4BtSJAW3ycWDgpHwYT3ifp2F8b9z95M54k=; b=YQva89P0sKkto/ 3gFPjFZIlYbH2ccnb9h5e+IOux2ZloBKyKM5XC71XlmLFC5rQEScW09HZTJpg95d9vIIf6BPUupuJ fEn9ZKOllLZOdgrZTT3JVSZFJWLK2ygEussHD+2P4u8JzTfIsEcapFgwXadCUZVe/ZE/k7LyYTxDa sACLM9IO+LkMhnnzqnVdWul+nl0hOIIWNaqqKB45hIBOAn5dN6Vzu/7wjPlHzwoGDdUBYF1dJbI6Z M6+HdYkuSQiTIWWQA2NSWdwe7Nsa+IzO2J1VATCg7U7Fx/aLz0ztp2jY+Myl/HPDdJd8uFEe5qMoq O2dFJLWJ01PMnOklPJWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ql0V1-00FbyD-1G; Tue, 26 Sep 2023 05:20:43 +0000 Received: from mgamail.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ql0Um-00Fbt4-11 for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2023 05:20:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695705628; x=1727241628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/0/YnXJEcB9BbLqlQjSk46oBKNZtRMAfDcTDuka6q4c=; b=SnOV3DuQ00KqqjzBS2BmdS1njgCpDXJOe6g9D2T+aOxFkT3JgDnTFe1n BW87c1+NIq3A2Qg4nE9z9j019bBCbjeDISLWgK90k7iD2twoN/fmbF4OD ktOUWpt/XvovElXiahgR9iXwZUXKtU7c0lIfAxWcMsT0gCrbM2Rjh974G zwHLNo3Weg4yFZiMWIJIX5Jd+qNBEDZB5XsTfMhnGALuRTsMmJ1Jx+hYd muRlpgXaIy8iFFvNSm22LYbI+gJmkVSfrKRPH9IVt+J4xkz3ENF+VMGGJ JcFqCIVNHgtooUmZZuL/8OoSJBN+qoUREavatlxJPk3BAQjgk7s6lj8mF g==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="360865683" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="360865683" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 22:20:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="748689668" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="748689668" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 25 Sep 2023 22:20:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id F04B91C7; Tue, 26 Sep 2023 08:20:18 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , Yury Norov , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Shubhrajyoti Datta , Srinivas Neeli , Michal Simek , Bartosz Golaszewski , Andy Shevchenko , Rasmus Villemoes , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH v1 3/5] gpio: xilinx: Switch to use new bitmap_scatter() helper Date: Tue, 26 Sep 2023 08:20:05 +0300 Message-Id: <20230926052007.3917389-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230926052007.3917389-1-andriy.shevchenko@linux.intel.com> References: <20230926052007.3917389-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230925_222028_371161_9E0DADE2 X-CRM114-Status: GOOD ( 14.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org bitmaps_scatter() produces a sparse bitmap based on the dense one and a given mask. In this driver the given mask is hw_map, while sw_map is of sequential bits. We may use the bitmap_scatter() helper instead of bitmap_remap(), because it's optimized for our case. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-xilinx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index a16945e8319e..f103c30cc74f 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -208,8 +208,8 @@ static void xgpio_set_multiple(struct gpio_chip *gc, unsigned long *mask, unsigned long flags; struct xgpio_instance *chip = gpiochip_get_data(gc); - bitmap_remap(hw_mask, mask, chip->sw_map, chip->hw_map, 64); - bitmap_remap(hw_bits, bits, chip->sw_map, chip->hw_map, 64); + bitmap_scatter(hw_mask, mask, chip->hw_map, 64); + bitmap_scatter(hw_bits, bits, chip->hw_map, 64); spin_lock_irqsave(&chip->gpio_lock, flags);