From 8b2fb7b6518d143b382c3490d4a90f8676259ef9 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 27 Nov 2016 11:16:23 +0000 Subject: [PATCH] drm: Fix conflicting macro parameter in drm_mm_for_each_node_in_range() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Cc: Joonas Lahtinen Reviewed-by: Christian König . [danvet: Fixup kerneldoc.] Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20161127111623.11124-1-chris@chris-wilson.co.uk --- include/drm/drm_mm.h | 16 ++++++++-------- 1 file 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); /** * drm_mm_for_each_node_in_range - iterator to walk over a range of * allocated nodes - * @node: drm_mm_node structure to assign to in each iteration step - * @mm: drm_mm allocator to walk - * @start: starting offset, the first node will overlap this - * @end: ending offset, the last node will start before this (but may overlap) + * @node__: drm_mm_node structure to assign to in each iteration step + * @mm__: drm_mm allocator to walk + * @start__: starting offset, the first node will overlap this + * @end__: ending offset, the last node will start before this (but may overlap) * * This iterator walks over all nodes in the range allocator that lie * 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); * starting node, and so not safe against removal of elements. It assumes * that @end is within (or is the upper limit of) the drm_mm allocator. */ -#define drm_mm_for_each_node_in_range(node, mm, start, end) \ - for (node = __drm_mm_interval_first((mm), (start), (end)-1); \ - node && node->start < (end); \ - node = list_next_entry(node, node_list)) \ +#define drm_mm_for_each_node_in_range(node__, mm__, start__, end__) \ + for (node__ = __drm_mm_interval_first((mm__), (start__), (end__)-1); \ + node__ && node__->start < (end__); \ + node__ = list_next_entry(node__, node_list)) void drm_mm_init_scan(struct drm_mm *mm, u64 size, -- 2.39.5