From patchwork Fri May 12 14:14:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 93219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5150372vqo; Fri, 12 May 2023 07:29:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72lYO/QbIGwEDT8zYbJ/vzrmRuNsXwtVpsyui4caDCYKIrBpvXumM4RSl0Tp7i9F/n7RkD X-Received: by 2002:a17:90b:384b:b0:252:c3b7:6689 with SMTP id nl11-20020a17090b384b00b00252c3b76689mr683593pjb.49.1683901741036; Fri, 12 May 2023 07:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683901741; cv=none; d=google.com; s=arc-20160816; b=agFQrfcqmPezHLt0ZXRWzBwctXnGYFD1tlrK8vpuS3k32UYXtgdAnDwYPw7mglw4Rs grTZaTqJSGhOEU57ONAgJl4xRYGOtuVpt/G+E2vczEXhRMycY1BHUrtS/zA2ebnFgGmc METti95/w94ZDE2rtiuwbIWYu+yq0I+t3QPwIjgq/ZpYH3HHBRJPi4ZK+rso2fwBXX51 o7T1L9O818MwQ6Y1k//Ph+1eshDfaqI9K01+AqbUbVoWCtjQhDtacmLmph7uqCmnMgMw Us4Xx7t+kCvQgXRaiNH500F9uwGJqZzxz/vdRZS6zA7WgOArIdHZjL/D9N3z2OGrs0U8 YhfQ== 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=7kJtzV8QKLK33nINo9QDGOG+IeWyuMdmVEqS+yux294=; b=E76sysrm1BeiOTKaDygg3WavDEVPiyOa/CN6jrBwmmxOtKtUJwg7833G9KLHQ5qFaY Qztk45jsEXCKdsAXGmhVW1Qsfn7a4v6ZrF+9sqQuy6c2D6l2LWAO+YYsvBGrWfnHh6Kd r4l8hUjrAV7E5wcNgAw3lTaTnnhvRos3EOhpWxlQ4eS1WDA/1GIWTP2Prf/DHjKNo2VZ jN7MUBovpHFm5MArrv53rAIEL7Bu/eaUmyW8T2Pg3oRiObb+FfFwDMtv9Iz6edcs/RN5 SGuY+IxsA7W0AJlyDusMVDf8zVnE0qKiSFJBoLJpq0lwPxAcNbRcfzWQCxHLjuS02HJl +vlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=73+KE2jJ; 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 mn16-20020a17090b189000b00246e9abad4bsi23069402pjb.85.2023.05.12.07.28.39; Fri, 12 May 2023 07:29:01 -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=73+KE2jJ; 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 S241162AbjELOPU (ORCPT + 99 others); Fri, 12 May 2023 10:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240231AbjELOPN (ORCPT ); Fri, 12 May 2023 10:15:13 -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 3EACDA268 for ; Fri, 12 May 2023 07:15:11 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-55ffc3d2b63so98243567b3.2 for ; Fri, 12 May 2023 07:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683900911; x=1686492911; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=7kJtzV8QKLK33nINo9QDGOG+IeWyuMdmVEqS+yux294=; b=73+KE2jJZgkKQVWCaUtcFRpHwxmCoknACAnlzWzTTYdIeY0sf1xAPMDgtao4FVuH4k cIXrqnoPUk9E9aw5oY+NH0+jpuVYn11HOwCNYKqqhyAGlgtS8CuLEkii2U8zX7IDZGG3 tlE3p6UYcl+Dl7nnZLCUsFMsZHAaumD1Hky/+FyLVDvK5mKqHYq7x4LBEhc2fAIii/2H yPQQh3WUAMDhsWLQPzOgM2V6SxOObNDmTh0RskA9oAhKJX3QfNpu7Df6AIEjOpTY2N4T xslSmLB6C898lbkzltwNSx1CNN9tRFjI/b5qSyKnAI4MQmIHDWG5CVYIHlhWqrVQXrDd gaMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683900911; x=1686492911; 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=7kJtzV8QKLK33nINo9QDGOG+IeWyuMdmVEqS+yux294=; b=PBDw+ZIpMCa8FVM83v1gq3i5GGShrMnId7eNbEZW5s0/0bj7GBWqZOnj1FiKhdWNg8 ZMm76+fAg3a8TWxH1Kokie05ZIDHygHWL/vAeU7WHm8Uwc4KTXdemTXu7SV3bETorBXt f+lLj2CxxDA+9eij2cV8893khmYPUcHqA9Qi+c8+RLC1s9nUSvYv2+R4Y0gCjuHM66ZS uwA57WSkUcIxSM2+YBvb2NzGT2UnTWFXoRK10oFAfcr4ljSACCIwqZYkQHIOyWI/c2Ov aJBEQh1HA6koIzbfyfFabr3lg/bH16DdRcHgvzXpOXuglA/o/g7B59lDjTjDJc8N+zcq XAHA== X-Gm-Message-State: AC+VfDxLzPeKQNx4GUCtj0YR2kj5J6j38ZM9ttmHdei/BGyqbKfgu/No QaJXg2ZFRS9hHMmxXwUEFgOK2mh6saDbRA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:430b:0:b0:55d:9a6d:8ce5 with SMTP id q11-20020a81430b000000b0055d9a6d8ce5mr15219383ywa.1.1683900911005; Fri, 12 May 2023 07:15:11 -0700 (PDT) Date: Fri, 12 May 2023 14:14:41 +0000 In-Reply-To: <20230512141445.2026660-1-joychakr@google.com> Mime-Version: 1.0 References: <20230512141445.2026660-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.606.ga4b1b128d6-goog Message-ID: <20230512141445.2026660-3-joychakr@google.com> Subject: [PATCH v2 2/6] dmaengine: pl330: Use FFS to calculate burst size From: Joy Chakraborty To: Vinod Koul 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?1765698951932819230?= X-GMAIL-MSGID: =?utf-8?q?1765698951932819230?= 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