From nobody Sun Feb 8 16:24:19 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 652E23559D3; Thu, 13 Nov 2025 15:16:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763046981; cv=none; b=VxQ2egRlpF9t/CWIAKP2SrfcCHCoZ6ghuk/cLI7uObJdH1/VsN41cBUuh/Cv5tKUZhV+J6ET44korB3RfbTeqeCI2hauf2dcZaxo4eeb0pnZVRuBpv1bo0PqgxSAv0kKIlYU4ZmGQYs2JYgeE2jVR9tMocN2KvIkmrrl6LiuwfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763046981; c=relaxed/simple; bh=3FTR/BGUP+Jif1zotbkvzWhNiBsBN/SOnlvS3OB5AC0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WpijORBqKfyu6LujKnowI2IS4+01R9DqAV/rM6yfJO9Z2Fdo3srKiWHsbnCo8fN3JGwNAIf2lOBpg0gMc3ta6dfL6E211dpPutqj0CvnB6KocLxgT/XzVApivJVm4uelKqG4/FM6kz3fv+IzVRXB/Al6oc4RxZjryxEiNc9BFhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Zde39cYH; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Zde39cYH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763046980; x=1794582980; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3FTR/BGUP+Jif1zotbkvzWhNiBsBN/SOnlvS3OB5AC0=; b=Zde39cYHbHtX6s+AoRzKd9A9A8Yc6QrCxzAl+c0614joYud4DdV0k3Z9 esqo5MMHJ9DJekJqAhsgNUpnQ3MjtVLsMBA6vF9Myl7A17wYQqpeJ9sRj +ZelNd0JEdG5zPu/yHXmxCIqb0Wd9xnfZy4hHFMk9PpALnncR/Ypz+pzK JqCalWZfOEztzUzcAiz8DbTIv88UtVbp4oNPRN0GlKb/KztNNUKMqmxpZ rFj7O3hiGFCeuqiAdiruqAvwPPEtnpBuG945EMGOSGS5yog3yOdq+N0dO YZN6ZfeNs5FDeJpd7qptY4WT6d4keAEYRaJ9IWchLfjbCZcCzJ9MKMGHj A==; X-CSE-ConnectionGUID: ytB3fz9sRbuA6a7hI0b5Jg== X-CSE-MsgGUID: Gd0FfUCBSdq02MKHNuj44w== X-IronPort-AV: E=McAfee;i="6800,10657,11612"; a="75740572" X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="75740572" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2025 07:16:17 -0800 X-CSE-ConnectionGUID: oe33S9NdSVCKz0Aw3l685A== X-CSE-MsgGUID: R5LCAFi/RxubMtn/y2mShg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="189792125" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa008.fm.intel.com with ESMTP; 13 Nov 2025 07:16:12 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id E6ED6A2; Thu, 13 Nov 2025 16:16:04 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , Bjorn Andersson , Stefan Wahren , Vinod Koul , Thomas Andreatta , Caleb Sander Mateos , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Olivier Dautricourt , Stefan Roese , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Lars-Peter Clausen , Eugeniy Paltsev , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Lizhi Hou , Brian Xu , Raj Kumar Rampelli , Michal Simek , Andrew Morton Subject: [PATCH v3 12/13] dmaengine: sh: use sg_nents_for_dma() helper Date: Thu, 13 Nov 2025 16:13:08 +0100 Message-ID: <20251113151603.3031717-13-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251113151603.3031717-1-andriy.shevchenko@linux.intel.com> References: <20251113151603.3031717-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Instead of open coded variant let's use recently introduced helper. Reviewed-by: Bjorn Andersson Signed-off-by: Andy Shevchenko --- drivers/dma/sh/shdma-base.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c index 834741adadaa..1e1b65e46668 100644 --- a/drivers/dma/sh/shdma-base.c +++ b/drivers/dma/sh/shdma-base.c @@ -577,12 +577,11 @@ static struct dma_async_tx_descriptor *shdma_prep_sg(= struct shdma_chan *schan, struct scatterlist *sg; struct shdma_desc *first =3D NULL, *new =3D NULL /* compiler... */; LIST_HEAD(tx_list); - int chunks =3D 0; + int chunks; unsigned long irq_flags; int i; =20 - for_each_sg(sgl, sg, sg_len, i) - chunks +=3D DIV_ROUND_UP(sg_dma_len(sg), schan->max_xfer_len); + chunks =3D sg_nents_for_dma(sgl, sg_len, schan->max_xfer_len); =20 /* Have to lock the whole loop to protect against concurrent release */ spin_lock_irqsave(&schan->chan_lock, irq_flags); --=20 2.50.1