* [PATCH 1/2] media: mc-entity: Fix documentation typo in function name
@ 2026-05-06 16:54 Laurent Pinchart
2026-05-06 16:54 ` [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition Laurent Pinchart
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Laurent Pinchart @ 2026-05-06 16:54 UTC (permalink / raw)
To: linux-media; +Cc: Sakari Ailus
The media_entity_pads_init() function name is misspelled. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/media/media-entity.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index b91ff6f8c3bb..904f61c14dc1 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -726,7 +726,7 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
* the entity (currently, it does nothing).
*
* Calling media_entity_cleanup() on a media_entity whose memory has been
- * zeroed but that has not been initialized with media_entity_pad_init() is
+ * zeroed but that has not been initialized with media_entity_pads_init() is
* valid and is a no-op.
*/
#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
base-commit: 3cd9b7011519c3fffffb7b6752fc7603be52dc1d
--
Regards,
Laurent Pinchart
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition
2026-05-06 16:54 [PATCH 1/2] media: mc-entity: Fix documentation typo in function name Laurent Pinchart
@ 2026-05-06 16:54 ` Laurent Pinchart
2026-05-07 12:48 ` Jacopo Mondi
2026-05-07 12:46 ` [PATCH 1/2] media: mc-entity: Fix documentation typo in function name Jacopo Mondi
2026-05-08 16:10 ` Frank Li
2 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2026-05-06 16:54 UTC (permalink / raw)
To: linux-media; +Cc: Sakari Ailus
The media_entity_cleanup() function is defined in media-entity.h as a
static inline no-op when CONFIG_MEDIA_CONTROLLER is enabled, and as a
no-op macro otherwise. This complexity is unneeded. Use a static inline
function in all cases.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/media/media-entity.h | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 904f61c14dc1..d9b72cd87d52 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -729,11 +729,9 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
* zeroed but that has not been initialized with media_entity_pads_init() is
* valid and is a no-op.
*/
-#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
-static inline void media_entity_cleanup(struct media_entity *entity) {}
-#else
-#define media_entity_cleanup(entity) do { } while (false)
-#endif
+static inline void media_entity_cleanup(struct media_entity *entity)
+{
+}
/**
* media_get_pad_index() - retrieves a pad index from an entity
--
Regards,
Laurent Pinchart
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] media: mc-entity: Fix documentation typo in function name
2026-05-06 16:54 [PATCH 1/2] media: mc-entity: Fix documentation typo in function name Laurent Pinchart
2026-05-06 16:54 ` [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition Laurent Pinchart
@ 2026-05-07 12:46 ` Jacopo Mondi
2026-05-08 16:10 ` Frank Li
2 siblings, 0 replies; 7+ messages in thread
From: Jacopo Mondi @ 2026-05-07 12:46 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, Sakari Ailus
Hi Laurent
On Wed, May 06, 2026 at 07:54:37PM +0300, Laurent Pinchart wrote:
> The media_entity_pads_init() function name is misspelled. Fix it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Thanks
j
> ---
> include/media/media-entity.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> index b91ff6f8c3bb..904f61c14dc1 100644
> --- a/include/media/media-entity.h
> +++ b/include/media/media-entity.h
> @@ -726,7 +726,7 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
> * the entity (currently, it does nothing).
> *
> * Calling media_entity_cleanup() on a media_entity whose memory has been
> - * zeroed but that has not been initialized with media_entity_pad_init() is
> + * zeroed but that has not been initialized with media_entity_pads_init() is
> * valid and is a no-op.
> */
> #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
>
> base-commit: 3cd9b7011519c3fffffb7b6752fc7603be52dc1d
> --
> Regards,
>
> Laurent Pinchart
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition
2026-05-06 16:54 ` [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition Laurent Pinchart
@ 2026-05-07 12:48 ` Jacopo Mondi
2026-05-07 12:54 ` Laurent Pinchart
0 siblings, 1 reply; 7+ messages in thread
From: Jacopo Mondi @ 2026-05-07 12:48 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, Sakari Ailus
Hi Laurent
On Wed, May 06, 2026 at 07:54:38PM +0300, Laurent Pinchart wrote:
> The media_entity_cleanup() function is defined in media-entity.h as a
> static inline no-op when CONFIG_MEDIA_CONTROLLER is enabled, and as a
> no-op macro otherwise. This complexity is unneeded. Use a static inline
> function in all cases.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> include/media/media-entity.h | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> index 904f61c14dc1..d9b72cd87d52 100644
> --- a/include/media/media-entity.h
> +++ b/include/media/media-entity.h
> @@ -729,11 +729,9 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
> * zeroed but that has not been initialized with media_entity_pads_init() is
> * valid and is a no-op.
I wonder if the documentation really applies
* Calling media_entity_cleanup() on a media_entity whose memory has been
* zeroed but that has not been initialized with media_entity_pad_init() is
* valid and is a no-op.
But a few lines above it says
* This function must be called during the cleanup phase after unregistering
* the entity (currently, it does nothing).
Not that the documentation is wrong, but if the functions is a nop, of
course it is valid to call it on non initialized entities :)
> */
> -#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
> -static inline void media_entity_cleanup(struct media_entity *entity) {}
> -#else
> -#define media_entity_cleanup(entity) do { } while (false)
> -#endif
> +static inline void media_entity_cleanup(struct media_entity *entity)
> +{
> +}
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
>
> /**
> * media_get_pad_index() - retrieves a pad index from an entity
> --
> Regards,
>
> Laurent Pinchart
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition
2026-05-07 12:48 ` Jacopo Mondi
@ 2026-05-07 12:54 ` Laurent Pinchart
0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2026-05-07 12:54 UTC (permalink / raw)
To: Jacopo Mondi; +Cc: linux-media, Sakari Ailus
On Thu, May 07, 2026 at 02:48:23PM +0200, Jacopo Mondi wrote:
> On Wed, May 06, 2026 at 07:54:38PM +0300, Laurent Pinchart wrote:
> > The media_entity_cleanup() function is defined in media-entity.h as a
> > static inline no-op when CONFIG_MEDIA_CONTROLLER is enabled, and as a
> > no-op macro otherwise. This complexity is unneeded. Use a static inline
> > function in all cases.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > include/media/media-entity.h | 8 +++-----
> > 1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> > index 904f61c14dc1..d9b72cd87d52 100644
> > --- a/include/media/media-entity.h
> > +++ b/include/media/media-entity.h
> > @@ -729,11 +729,9 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
> > * zeroed but that has not been initialized with media_entity_pads_init() is
> > * valid and is a no-op.
>
> I wonder if the documentation really applies
>
> * Calling media_entity_cleanup() on a media_entity whose memory has been
> * zeroed but that has not been initialized with media_entity_pad_init() is
> * valid and is a no-op.
>
> But a few lines above it says
>
> * This function must be called during the cleanup phase after unregistering
> * the entity (currently, it does nothing).
>
> Not that the documentation is wrong, but if the functions is a nop, of
> course it is valid to call it on non initialized entities :)
We could probably drop the "currently, it does nothing" part. It's true,
but not relevant. The function was added because we thought we will at
some point have to perform cleanup tasks, and patching lots of drivers
to add cleanup calls then would be error-prone.
> > */
> > -#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
> > -static inline void media_entity_cleanup(struct media_entity *entity) {}
> > -#else
> > -#define media_entity_cleanup(entity) do { } while (false)
> > -#endif
> > +static inline void media_entity_cleanup(struct media_entity *entity)
> > +{
> > +}
>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
>
> >
> > /**
> > * media_get_pad_index() - retrieves a pad index from an entity
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] media: mc-entity: Fix documentation typo in function name
2026-05-06 16:54 [PATCH 1/2] media: mc-entity: Fix documentation typo in function name Laurent Pinchart
2026-05-06 16:54 ` [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition Laurent Pinchart
2026-05-07 12:46 ` [PATCH 1/2] media: mc-entity: Fix documentation typo in function name Jacopo Mondi
@ 2026-05-08 16:10 ` Frank Li
2026-05-08 20:07 ` Laurent Pinchart
2 siblings, 1 reply; 7+ messages in thread
From: Frank Li @ 2026-05-08 16:10 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, Sakari Ailus
On Wed, May 06, 2026 at 07:54:37PM +0300, Laurent Pinchart wrote:
> The media_entity_pads_init() function name is misspelled. Fix it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Nit: suggest put real functions name in subject.
documentation typo in media_entity_pads_init()
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> include/media/media-entity.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> index b91ff6f8c3bb..904f61c14dc1 100644
> --- a/include/media/media-entity.h
> +++ b/include/media/media-entity.h
> @@ -726,7 +726,7 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
> * the entity (currently, it does nothing).
> *
> * Calling media_entity_cleanup() on a media_entity whose memory has been
> - * zeroed but that has not been initialized with media_entity_pad_init() is
> + * zeroed but that has not been initialized with media_entity_pads_init() is
> * valid and is a no-op.
> */
> #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
>
> base-commit: 3cd9b7011519c3fffffb7b6752fc7603be52dc1d
> --
> Regards,
>
> Laurent Pinchart
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] media: mc-entity: Fix documentation typo in function name
2026-05-08 16:10 ` Frank Li
@ 2026-05-08 20:07 ` Laurent Pinchart
0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2026-05-08 20:07 UTC (permalink / raw)
To: Frank Li; +Cc: linux-media, Sakari Ailus
On Fri, May 08, 2026 at 12:10:13PM -0400, Frank Li wrote:
> On Wed, May 06, 2026 at 07:54:37PM +0300, Laurent Pinchart wrote:
> > The media_entity_pads_init() function name is misspelled. Fix it.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Nit: suggest put real functions name in subject.
>
> documentation typo in media_entity_pads_init()
I've left it out to avoid a too long subject. If the person picking this
patch (Sakari ?) would prefer adding it I'm fine with that too.
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> > ---
> > include/media/media-entity.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> > index b91ff6f8c3bb..904f61c14dc1 100644
> > --- a/include/media/media-entity.h
> > +++ b/include/media/media-entity.h
> > @@ -726,7 +726,7 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
> > * the entity (currently, it does nothing).
> > *
> > * Calling media_entity_cleanup() on a media_entity whose memory has been
> > - * zeroed but that has not been initialized with media_entity_pad_init() is
> > + * zeroed but that has not been initialized with media_entity_pads_init() is
> > * valid and is a no-op.
> > */
> > #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
> >
> > base-commit: 3cd9b7011519c3fffffb7b6752fc7603be52dc1d
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-05-08 20:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-06 16:54 [PATCH 1/2] media: mc-entity: Fix documentation typo in function name Laurent Pinchart
2026-05-06 16:54 ` [PATCH 2/2] media: mc-entity: Drop ifdef for media_entity_cleanup definition Laurent Pinchart
2026-05-07 12:48 ` Jacopo Mondi
2026-05-07 12:54 ` Laurent Pinchart
2026-05-07 12:46 ` [PATCH 1/2] media: mc-entity: Fix documentation typo in function name Jacopo Mondi
2026-05-08 16:10 ` Frank Li
2026-05-08 20:07 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox