diff mbox series

[02/11] staging: vchiq_arm: Drop obsolete comment

Message ID 20240604172904.61613-3-wahrenst@gmx.net (mailing list archive)
State New, archived
Headers show
Series staging: vc04_services: Random cleanups | expand

Commit Message

Stefan Wahren June 4, 2024, 5:28 p.m. UTC
The BUG_ON has been replaced with WARN_ON. So we can drop the
comment.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 -
 1 file changed, 1 deletion(-)

--
2.34.1

Comments

Laurent Pinchart June 5, 2024, 6:52 a.m. UTC | #1
Hi Stefan,

Thank you for the patch.

On Tue, Jun 04, 2024 at 07:28:55PM +0200, Stefan Wahren wrote:
> The BUG_ON has been replaced with WARN_ON. So we can drop the
> comment.

Note https://lwn.net/Articles/969923/ :-)

This being said, I think the comment can be dropped, regardless of
whether or not we drop the WARN_ON() later.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index e2f4aa00cb70..515cdcba043d 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -1451,7 +1451,6 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
> 
>  	write_lock_bh(&arm_state->susp_res_lock);
>  	if (!arm_state->videocore_use_count || !(*entity_uc)) {
> -		/* Don't use BUG_ON - don't allow user thread to crash kernel */
>  		WARN_ON(!arm_state->videocore_use_count);
>  		WARN_ON(!(*entity_uc));
>  		ret = -EINVAL;
Stefan Wahren June 5, 2024, 10:02 a.m. UTC | #2
Hi Laurent,

Am 05.06.24 um 08:52 schrieb Laurent Pinchart:
> Hi Stefan,
>
> Thank you for the patch.
>
> On Tue, Jun 04, 2024 at 07:28:55PM +0200, Stefan Wahren wrote:
>> The BUG_ON has been replaced with WARN_ON. So we can drop the
>> comment.
> Note https://lwn.net/Articles/969923/ :-)
>
> This being said, I think the comment can be dropped, regardless of
> whether or not we drop the WARN_ON() later.
thanks i wasn't aware of that article. I think, we can address this in a
separate series and try to replace WARN_ON() with dev_warn() in cases it
makes sense.
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
>> ---
>>   drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
>> index e2f4aa00cb70..515cdcba043d 100644
>> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
>> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
>> @@ -1451,7 +1451,6 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
>>
>>   	write_lock_bh(&arm_state->susp_res_lock);
>>   	if (!arm_state->videocore_use_count || !(*entity_uc)) {
>> -		/* Don't use BUG_ON - don't allow user thread to crash kernel */
>>   		WARN_ON(!arm_state->videocore_use_count);
>>   		WARN_ON(!(*entity_uc));
>>   		ret = -EINVAL;
Dan Carpenter June 5, 2024, 10:32 a.m. UTC | #3
On Wed, Jun 05, 2024 at 12:02:40PM +0200, Stefan Wahren wrote:
> Hi Laurent,
> 
> Am 05.06.24 um 08:52 schrieb Laurent Pinchart:
> > Hi Stefan,
> > 
> > Thank you for the patch.
> > 
> > On Tue, Jun 04, 2024 at 07:28:55PM +0200, Stefan Wahren wrote:
> > > The BUG_ON has been replaced with WARN_ON. So we can drop the
> > > comment.
> > Note https://lwn.net/Articles/969923/ :-)
> > 
> > This being said, I think the comment can be dropped, regardless of
> > whether or not we drop the WARN_ON() later.
> thanks i wasn't aware of that article. I think, we can address this in a
> separate series and try to replace WARN_ON() with dev_warn() in cases it
> makes sense.

I looked at the callers and it does look like a user could trigger these
via the VCHIQ_IOC_RELEASE_SERVICE ioctl so it should be dev_warn(), yes.
It's not necessarily in use at the time.


regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index e2f4aa00cb70..515cdcba043d 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -1451,7 +1451,6 @@  vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)

 	write_lock_bh(&arm_state->susp_res_lock);
 	if (!arm_state->videocore_use_count || !(*entity_uc)) {
-		/* Don't use BUG_ON - don't allow user thread to crash kernel */
 		WARN_ON(!arm_state->videocore_use_count);
 		WARN_ON(!(*entity_uc));
 		ret = -EINVAL;