Re: [PATCH] drm: Fix conflicting macro parameter in drm_mm_for_each_node_in_range()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 27, 2016 at 03:32:39PM +0100, Christian König wrote:
> Am 27.11.2016 um 12:16 schrieb Chris Wilson:
> > 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@xxxxxxxxxxxxxxxxxx>
> > Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> 
> Reviewed-by: Christian König <christian.koenig@xxxxxxx>.

*cough* make htmldocs

Fixed up while applying, thanks for the patch.
-Daniel

> 
> > ---
> >   include/drm/drm_mm.h | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
> > index 6add455c651b..a9b22379c7fd 100644
> > --- a/include/drm/drm_mm.h
> > +++ b/include/drm/drm_mm.h
> > @@ -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,
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux