mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: Add for_each construct for nvgpu_sgts
Add a macro to iterate across nvgpu_sgts. This makes it easier on developers who may accidentally forget to move to the next SGL. JIRA NVGPU-243 Change-Id: I90154a5d23f0014cb79bbcd5b6e8d8dbda303820 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1566627 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
0e8aee1c1a
commit
7a3dbdd43f
@@ -105,7 +105,8 @@ void nvgpu_pramin_access_batched(struct gk20a *g, struct nvgpu_mem *mem,
|
||||
|
||||
alloc = get_vidmem_page_alloc(mem->priv.sgt->sgl);
|
||||
sgt = &alloc->sgt;
|
||||
for (sgl = sgt->sgl; sgl; sgl = nvgpu_sgt_get_next(sgt, sgl)) {
|
||||
|
||||
nvgpu_sgt_for_each_sgl(sgl, sgt) {
|
||||
if (offset >= nvgpu_sgt_get_length(sgt, sgl))
|
||||
offset -= nvgpu_sgt_get_length(sgt, sgl);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user