From patchwork Thu May 4 14:57:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp391534vqo; Thu, 4 May 2023 08:08:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ByIS3rWq4GW9zV+uj1cO/sQCOmNz+TYXse2x+spk+pLjL80z4hJ8xLG6nF8gzFqivQ0Vr X-Received: by 2002:a6b:6107:0:b0:769:82a4:4419 with SMTP id v7-20020a6b6107000000b0076982a44419mr9998617iob.14.1683212890589; Thu, 04 May 2023 08:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683212890; cv=none; d=google.com; s=arc-20160816; b=MwKN6Quh4p1yaRN5+VzvexH0aLtFjgvWhwZtnGk5D0lL9vjXDbzIr4DkV91uO2hEOj HnFc4Uy5CkHNWKVP6lcCTtoFUTVXQ21Z1xAhiluFuNLWTsr/BHW6aacbPHgGoq5gVsyL c3TnlNTMXk/3jKjdRXu8Grpinaj4O6H+sw1mW7BYDlECF/LFk0uCIA4QWEhvEWTYQ8ET PH5PFKmmS5El0xb/nPjPMjBuPICmrZ/9fwNNSWXnS82j+P/foaDfA30P2iseqhfKnnDV Gl3L2CGwKimXFc2CAAal7+g8o1s/h+lahplPiyObf5dOurmHEbxlvVVhcmrtTUd4aBZR 1j6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=FA/v04s+rMO6cV89w8yi7EFtwX7zbYFrIK72OYPFMEw=; b=ByTeGD9aBmzmqByTKze6TP3sZcXSx9eFFiZVNTqBzQVeE6Kb3XgMj6HhoGR+7afTG6 rUWbuU6+hPq7DBYSlVeUZMcbu4ad37ZPOoQ7lhQKWTRZTyjE24ojpFNPqWbCBV1+QE6a CsA3HyFFknkrUQ+dxITzocOfNgOM26mss4U28Vdao0I2XabCF02Dppy7XG8cp+LpPmAu OwDRP1+yicIhkec94h+Wnuuwum8x9gP4n33wJwvBVbm9E/ai59b40e21F6eRjnmbtchm 66B0zjtdWE25t24UYCTkKOUxk0OWOzHCDobz52NHmlIpNBEbzm5EJPFEohHynNXMexD2 IWJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=FMJmvHZO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a05663813d200b0040faa822c8esi29692108jaj.39.2023.05.04.08.07.54; Thu, 04 May 2023 08:08:10 -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=@google.com header.s=20221208 header.b=FMJmvHZO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbjEDO7K (ORCPT + 99 others); Thu, 4 May 2023 10:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbjEDO7D (ORCPT ); Thu, 4 May 2023 10:59:03 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F06683AA3 for ; Thu, 4 May 2023 07:58:36 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-55a7d1f6914so8438867b3.1 for ; Thu, 04 May 2023 07:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212290; x=1685804290; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FA/v04s+rMO6cV89w8yi7EFtwX7zbYFrIK72OYPFMEw=; b=FMJmvHZO0oQQ142FoQrFK15pvzpeXL1Lo2mjHlVRciBbfAk63P5FASSKbn0+TctAPZ 9WnMt+oGJjdflLbJEEShaU6sl2k2KcRxUM5D4yNimLQz+vAMsWCX1PSVlaxoIAkX9yen jw+7QzQyL8uQJwb6Cc8wkavUL9Y1N9OFgp2yMwDiBOXBVIp9M90E3G8P+2iGB9XHYJK/ mcrAQUTuRiiNbcgV4GuYDOpNbDdyANQxTJxpn+AVruKnn4/mG+Zrz6l+a0CKYzFjJVw1 R/F9OkCp0LXptXNjrM/2oSWTf6t1etVlMi4TtK9SsxiJd6gPu7Uglx7mJC72ZGft99P7 psPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212290; x=1685804290; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FA/v04s+rMO6cV89w8yi7EFtwX7zbYFrIK72OYPFMEw=; b=RFwktXcNtOd5pOYDCNKfj4HaGWOUw1cOS/vLfUPrubhJowWR/uith/+5H99RF+r+xt 3Qxqh/xjatH7D1v2HAnB7SRr/Aj2oABICteOpEMMsgII09KJUZkukx7rP+Iii75p25g9 pDWoYiLnJpa2HopyorbW1QnRG0bsGTKd+7Rb1M2uA1z5aQOO+mxSECBy/PXtqWEVbWwQ WA4SDp7WAdMHKZ6KtAyI62Pwn7sObHp/vXpzxFkvxBJ1b2Prgq5xXAQkZKnkEseSGSYq 6yz7BZWRa9Pr4v038im2HamorrUPWt2hBZT8H4c9jcm4pUb9ajkBTW+G3mySJuS5kEmD 4UXw== X-Gm-Message-State: AC+VfDyZQ7vDMv6OFSVK+mh8CIO7hxRcTWfqRI7VswCSPk/fuJRvtjnF hJUJSqwp51VKB4kDNPts3QoQLtbW+j0NmQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:c148:0:b0:559:d8ad:560d with SMTP id e8-20020a81c148000000b00559d8ad560dmr1388760ywl.5.1683212290122; Thu, 04 May 2023 07:58:10 -0700 (PDT) Date: Thu, 4 May 2023 14:57:32 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-3-joychakr@google.com> Subject: [PATCH 2/7] dmaengine: pl330: Use FFS to calculate burst size From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764976639571958846?= X-GMAIL-MSGID: =?utf-8?q?1764976639571958846?= Use __ffs to calculate burst size in pl330_prep_dma_memcpy() for consistency across the driver as other functions already use __ffs for the same functionality. Signed-off-by: Joy Chakraborty --- drivers/dma/pl330.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index c006e481b4c5..39a66ff29e27 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2804,10 +2804,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst, while ((src | dst | len) & (burst - 1)) burst /= 2; - desc->rqcfg.src_brst_size = 0; - while (burst != (1 << desc->rqcfg.src_brst_size)) - desc->rqcfg.src_brst_size++; - + desc->rqcfg.src_brst_size = __ffs(burst); desc->rqcfg.src_brst_len = get_burst_len(desc, len); /* * If burst size is smaller than bus width then make sure we only