From: Daniel Scally <djrscally@gmail.com>
To: Jacopo Mondi <jacopo@jmondi.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
paul.elder@ideasonboard.com
Subject: Re: [PATCH 1/2] media: media-entity.h: Add iterator for entity data links
Date: Wed, 22 Jun 2022 10:30:29 +0100 [thread overview]
Message-ID: <7d9d1fc9-b1e5-98eb-74c3-64da8f08dabd@gmail.com> (raw)
In-Reply-To: <20220622092231.2dwa6besmff6732x@uno.localdomain>
Morning both
On 22/06/2022 10:22, Jacopo Mondi wrote:
> hi Laurent,
>
> On Wed, Jun 22, 2022 at 12:17:56PM +0300, Laurent Pinchart wrote:
>> On Wed, Jun 22, 2022 at 11:08:59AM +0200, Jacopo Mondi wrote:
>>> Hi Dan
>>>
>>> On Tue, Jun 21, 2022 at 05:34:56PM +0100, Daniel Scally wrote:
>>>> Iterating over the links for an entity is a somewhat common need
>>>> through the media subsystem, but generally the assumption is that
>>>> they will all be data links. To meet that assumption add a new macro
>>>> that iterates through an entity's links and skips non-data links.
>>> Do you foresee usages of a similar iterator but for ancillary (or
>>> interface) links ?
>>>
>>> In that case you could add a 'link_type' flag to
>>> __media_entity_next_data_link
>>>
>>>> Signed-off-by: Daniel Scally <djrscally@gmail.com>
>>>> ---
>>>> include/media/media-entity.h | 26 ++++++++++++++++++++++++++
>>>> 1 file changed, 26 insertions(+)
>>>>
>>>> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
>>>> index a9a1c0ec5d1c..b13f67f33508 100644
>>>> --- a/include/media/media-entity.h
>>>> +++ b/include/media/media-entity.h
>>>> @@ -550,6 +550,32 @@ static inline bool media_entity_enum_intersects(
>>>> min(ent_enum1->idx_max, ent_enum2->idx_max));
>>>> }
>>>>
>>>> +static inline struct media_link *
>>> Isn't this a bit too much for inlining ? Also I heard many times that
>>> it's not worth anymore trying to outsmart the compiler and inline is
>>> discouraged in most cases ? (and it kind of makes sense to me, but I
>>> sometimes wonder if that's some form of cargo cult..)
>> That's right, but in .h files you need to manually inline, otherwise
>> you'll end up with one copy per compilation unit.
>>
> I was suggesting to move it to a .c file in facts, likely mc-entity.c
The one copy per compilation unit problem spurred the inline indeed -
but no problem, I'll move it to the .c
next prev parent reply other threads:[~2022-06-22 9:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 16:34 [PATCH 0/2] Add iterator for an entity's data links Daniel Scally
2022-06-21 16:34 ` [PATCH 1/2] media: media-entity.h: Add iterator for entity " Daniel Scally
2022-06-22 9:08 ` Jacopo Mondi
2022-06-22 9:17 ` Laurent Pinchart
2022-06-22 9:22 ` Jacopo Mondi
2022-06-22 9:30 ` Daniel Scally [this message]
2022-06-22 9:40 ` Daniel Scally
2022-06-22 9:16 ` Laurent Pinchart
2022-06-21 16:34 ` [PATCH 2/2] media: entity: Use dedicated data link iterator Daniel Scally
2022-06-22 9:18 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7d9d1fc9-b1e5-98eb-74c3-64da8f08dabd@gmail.com \
--to=djrscally@gmail.com \
--cc=jacopo@jmondi.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=paul.elder@ideasonboard.com \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox