Re: [PATCH] v4l2-dev.h: fix symbol collision in media_entity_to_video_device()

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

 



Hi guys,

On Thu, Jan 25, 2018 at 08:59:35AM +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> On Thu, Jan 25, 2018 at 1:34 AM, Niklas Söderlund
> <niklas.soderlund+renesas@xxxxxxxxxxxx> wrote:
> > A recent change to the media_entity_to_video_device() macro breaks some
> > use-cases for the macro due to a symbol collision. Before the change
> > this worked:
> >
> >     vdev = media_entity_to_video_device(link->sink->entity);
> >
> > While after the change it results in a compiler error "error: 'struct
> > video_device' has no member named 'link'; did you mean 'lock'?". While
> > the following still works after the change.
> >
> >     struct media_entity *entity = link->sink->entity;
> >     vdev = media_entity_to_video_device(entity);
> >
> > Fix the collision by renaming the macro argument to 'media_entity'.
> 
> Thanks!
> Given there also exists a "struct media_entity", using "_media_entity" seems
> safe to me.

That doesn't matter, does it? As long as the macro argument is used as a
field name of a struct. I.e. "__entity" would be fine, as well as "e". I'd
vote for __entity. :-)

In any case,

Acked-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>

-- 
Sakari Ailus
e-mail: sakari.ailus@xxxxxx



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux