2022-03-25 02:49:31

by Hangyu Hua

[permalink] [raw]
Subject: [PATCH] media: mc: delete redundant code in __media_device_unregister_entity

media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
set it again.

Signed-off-by: Hangyu Hua <[email protected]>
---
drivers/media/mc/mc-device.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
index cf5e459b1d96..7727c619043e 100644
--- a/drivers/media/mc/mc-device.c
+++ b/drivers/media/mc/mc-device.c
@@ -605,7 +605,6 @@ static void __media_device_unregister_entity(struct media_entity *entity)

/* invoke entity_notify callbacks to handle entity removal?? */

- entity->graph_obj.mdev = NULL;
}

/**
--
2.25.1


2022-03-25 07:43:06

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH] media: mc: delete redundant code in __media_device_unregister_entity

Hi Hangyu,

Thank you for the patch.

On Thu, Mar 24, 2022 at 06:27:52PM +0800, Hangyu Hua wrote:
> media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
> set it again.
>
> Signed-off-by: Hangyu Hua <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
> drivers/media/mc/mc-device.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
> index cf5e459b1d96..7727c619043e 100644
> --- a/drivers/media/mc/mc-device.c
> +++ b/drivers/media/mc/mc-device.c
> @@ -605,7 +605,6 @@ static void __media_device_unregister_entity(struct media_entity *entity)
>
> /* invoke entity_notify callbacks to handle entity removal?? */
>
> - entity->graph_obj.mdev = NULL;
> }
>
> /**

--
Regards,

Laurent Pinchart

2022-03-30 20:40:52

by Sakari Ailus

[permalink] [raw]
Subject: Re: [PATCH] media: mc: delete redundant code in __media_device_unregister_entity

On Thu, Mar 24, 2022 at 03:47:10PM +0200, Laurent Pinchart wrote:
> Hi Hangyu,
>
> Thank you for the patch.
>
> On Thu, Mar 24, 2022 at 06:27:52PM +0800, Hangyu Hua wrote:
> > media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
> > set it again.
> >
> > Signed-off-by: Hangyu Hua <[email protected]>
>
> Reviewed-by: Laurent Pinchart <[email protected]>
>
> > ---
> > drivers/media/mc/mc-device.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
> > index cf5e459b1d96..7727c619043e 100644
> > --- a/drivers/media/mc/mc-device.c
> > +++ b/drivers/media/mc/mc-device.c
> > @@ -605,7 +605,6 @@ static void __media_device_unregister_entity(struct media_entity *entity)
> >
> > /* invoke entity_notify callbacks to handle entity removal?? */
> >
> > - entity->graph_obj.mdev = NULL;

Removed the extra newline above, too. Applied.

Please run scripts/checkpatch.pl on the patches, too.

> > }
> >
> > /**
>
> --
> Regards,
>
> Laurent Pinchart

--
Sakari Ailus

2022-03-31 04:43:51

by Hangyu Hua

[permalink] [raw]
Subject: Re: [PATCH] media: mc: delete redundant code in __media_device_unregister_entity

On 2022/3/30 19:05, Sakari Ailus wrote:
> On Thu, Mar 24, 2022 at 03:47:10PM +0200, Laurent Pinchart wrote:
>> Hi Hangyu,
>>
>> Thank you for the patch.
>>
>> On Thu, Mar 24, 2022 at 06:27:52PM +0800, Hangyu Hua wrote:
>>> media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
>>> set it again.
>>>
>>> Signed-off-by: Hangyu Hua <[email protected]>
>>
>> Reviewed-by: Laurent Pinchart <[email protected]>
>>
>>> ---
>>> drivers/media/mc/mc-device.c | 1 -
>>> 1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
>>> index cf5e459b1d96..7727c619043e 100644
>>> --- a/drivers/media/mc/mc-device.c
>>> +++ b/drivers/media/mc/mc-device.c
>>> @@ -605,7 +605,6 @@ static void __media_device_unregister_entity(struct media_entity *entity)
>>>
>>> /* invoke entity_notify callbacks to handle entity removal?? */
>>>
>>> - entity->graph_obj.mdev = NULL;
>
> Removed the extra newline above, too. Applied.
>
> Please run scripts/checkpatch.pl on the patches, too.

Thanks. I will make a v2 with this change.
>
>>> }
>>>
>>> /**
>>
>> --
>> Regards,
>>
>> Laurent Pinchart
>