Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1722663 > unrolled thread

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

Started byharsha <harshasharmaiitr@gmail.com>
First post2017-08-29 20:10 +0200
Last post2017-08-29 20:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG() harsha <harshasharmaiitr@gmail.com> - 2017-08-29 20:10 +0200
    Re: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than  BUG() Greg KH <gregkh@linuxfoundation.org> - 2017-08-29 20:10 +0200

#1722663 — [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()

Fromharsha <harshasharmaiitr@gmail.com>
Date2017-08-29 20:10 +0200
Subject[PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()
Message-ID<ujT7A-602-19@gated-at.bofh.it>
Fixes checkpatch.pl warning: Use WARN_ON() rather than BUG_ON() and BUG()

Signed-off-by: harsha <harshasharmaiitr@gmail.com>
---
 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

[toc] | [next] | [standalone]


#1722668 — Re: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-08-29 20:10 +0200
SubjectRe: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()
Message-ID<ujT7B-602-35@gated-at.bofh.it>
In reply to#1722663
On Tue, Aug 29, 2017 at 11:30:22PM +0530, harsha wrote:
> Fixes checkpatch.pl warning: Use WARN_ON() rather than BUG_ON() and BUG()
> 
> Signed-off-by: harsha <harshasharmaiitr@gmail.com>

I still need a real name here.

> ---
>  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();

You can't just change code without understanding _why_ you are changing
it.  You just changed the logic here, why do you think it is ok that
BUG() is no longer called?  Are you properly cleaning up and recovering
here now that WARN_ON() is called?

checkpatch.pl is a hint, you can't just blindly do whatever it says, you
still have to think.

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web