diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-11-27 06:16:23 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-11-28 02:07:58 -0500 |
commit | 8b2fb7b6518d143b382c3490d4a90f8676259ef9 (patch) | |
tree | f751d0908656e75a76abf0349b87a75983379fc0 | |
parent | 218adc17b0d362331f2df37304ba467881241d80 (diff) |
drm: Fix conflicting macro parameter in drm_mm_for_each_node_in_range()
start is being used as both a macro parameter and as a member of struct
drm_mm_node (node->start). This causes a conflict as cpp then tries to
replace node->start with the passed in string for "start". Work just
fine so long as you also happened to using local variables called start!
Fixes: 522e85dd8677 ("drm: Define drm_mm_for_each_node_in_range()")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>.
[danvet: Fixup kerneldoc.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161127111623.11124-1-chris@chris-wilson.co.uk
-rw-r--r-- | include/drm/drm_mm.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 6add455c651b..0b8371795aeb 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -313,10 +313,10 @@ __drm_mm_interval_first(struct drm_mm *mm, u64 start, u64 last); | |||
313 | /** | 313 | /** |
314 | * drm_mm_for_each_node_in_range - iterator to walk over a range of | 314 | * drm_mm_for_each_node_in_range - iterator to walk over a range of |
315 | * allocated nodes | 315 | * allocated nodes |
316 | * @node: drm_mm_node structure to assign to in each iteration step | 316 | * @node__: drm_mm_node structure to assign to in each iteration step |
317 | * @mm: drm_mm allocator to walk | 317 | * @mm__: drm_mm allocator to walk |
318 | * @start: starting offset, the first node will overlap this | 318 | * @start__: starting offset, the first node will overlap this |
319 | * @end: ending offset, the last node will start before this (but may overlap) | 319 | * @end__: ending offset, the last node will start before this (but may overlap) |
320 | * | 320 | * |
321 | * This iterator walks over all nodes in the range allocator that lie | 321 | * This iterator walks over all nodes in the range allocator that lie |
322 | * between @start and @end. It is implemented similarly to list_for_each(), | 322 | * between @start and @end. It is implemented similarly to list_for_each(), |
@@ -324,10 +324,10 @@ __drm_mm_interval_first(struct drm_mm *mm, u64 start, u64 last); | |||
324 | * starting node, and so not safe against removal of elements. It assumes | 324 | * starting node, and so not safe against removal of elements. It assumes |
325 | * that @end is within (or is the upper limit of) the drm_mm allocator. | 325 | * that @end is within (or is the upper limit of) the drm_mm allocator. |
326 | */ | 326 | */ |
327 | #define drm_mm_for_each_node_in_range(node, mm, start, end) \ | 327 | #define drm_mm_for_each_node_in_range(node__, mm__, start__, end__) \ |
328 | for (node = __drm_mm_interval_first((mm), (start), (end)-1); \ | 328 | for (node__ = __drm_mm_interval_first((mm__), (start__), (end__)-1); \ |
329 | node && node->start < (end); \ | 329 | node__ && node__->start < (end__); \ |
330 | node = list_next_entry(node, node_list)) \ | 330 | node__ = list_next_entry(node__, node_list)) |
331 | 331 | ||
332 | void drm_mm_init_scan(struct drm_mm *mm, | 332 | void drm_mm_init_scan(struct drm_mm *mm, |
333 | u64 size, | 333 | u64 size, |