2017-08-29 19:23:03

by Harsha Sharma

[permalink] [raw]
Subject: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()

Hi,
harsha, this is my real name.
There is no need to call BUG() over here as this error is not very basic and BUG() tends to bring the system down so calling WARN_ON() is preferable.
Please correct me if I am wrong as this is my first contribution.
I am unable to send any direct mail from gmail( gets rejected based on some filter rule match) so trying to send it in this way.
Thanks.


2017-08-29 19:23:09

by Harsha Sharma

[permalink] [raw]
Subject: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()

Fixes checkpatch.pl warning: Use WARN_ON() rather than BUG_ON() and BUG()

Signed-off-by: harsha <[email protected]>
---
drivers/staging/android/ion/ion.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 93e2c90..a2d36b3 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -66,7 +66,7 @@ static void ion_buffer_add(struct ion_device *dev,
p = &(*p)->rb_right;
} else {
pr_err("%s: buffer already found.", __func__);
- BUG();
+ WARN_ON();
}
}

--
1.9.1

2017-08-29 20:36:40

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()

On Wed, Aug 30, 2017 at 12:51:01AM +0530, harsha wrote:
> Hi,
> harsha, this is my real name.

That's your full name that you use to sign legal documents? No last
name? No capital letter at the beginning?

> There is no need to call BUG() over here as this error is not very basic and BUG() tends to bring the system down so calling WARN_ON() is preferable.

In the original code the kernel will call BUG() once but in the new code
it will spam the dmesg forever until you pull the power cord. There is
no improvement.

regards,
dan carpenter

2017-08-30 05:58:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()

On Wed, Aug 30, 2017 at 12:51:02AM +0530, harsha wrote:
> Fixes checkpatch.pl warning: Use WARN_ON() rather than BUG_ON() and BUG()
>
> Signed-off-by: harsha <[email protected]>
> ---
> drivers/staging/android/ion/ion.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index 93e2c90..a2d36b3 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -66,7 +66,7 @@ static void ion_buffer_add(struct ion_device *dev,
> p = &(*p)->rb_right;
> } else {
> pr_err("%s: buffer already found.", __func__);
> - BUG();
> + WARN_ON();
> }
> }
>

As you did not do anything different from the last submission where I
said this patch was not correct, I'm guessing that you don't want any
feedback. So I'll go add you to my kill-file now and just ignore your
emails, as obviously, you are ignoring mine :(

good luck!

greg k-h