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
@@ -104,6 +104,14 @@ struct nvgpu_mem_sgl {
|
||||
u64 length;
|
||||
};
|
||||
|
||||
/*
|
||||
* Iterate over the SGL entries in an SGT.
|
||||
*/
|
||||
#define nvgpu_sgt_for_each_sgl(__sgl__, __sgt__) \
|
||||
for ((__sgl__) = (__sgt__)->sgl; \
|
||||
(__sgl__) != NULL; \
|
||||
(__sgl__) = nvgpu_sgt_get_next(__sgt__, __sgl__))
|
||||
|
||||
struct nvgpu_mem {
|
||||
/*
|
||||
* Populated for all nvgpu_mem structs - vidmem or system.
|
||||
|
||||
Reference in New Issue
Block a user