Skip to contentSkip to conversation

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

PATCH In review harsha 3 participants 4 messages Aug 29, 2017 – Aug 30, 2017 Staging

lore
Share & tools
lore

harsha

author
#0 lore raw

PATCH 1/1 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.

author
#1 lore raw

PATCH 1/1 Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()

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

---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion.c +1 -1
index 93e2c90..a2d36b3 100644
@@ -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();
 		}
 	}
 
Signature · 1 line
1.9.1
#3 lore raw
In reply to harsha
Quoted 2 lines · harsha

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?

Quoted 1 line

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

maintainer
#2 lore raw
In reply to harsha
Quoted 12 lines · harsha

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

---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion.c +0 -0
index 93e2c90..a2d36b3 100644

drivers/staging/android/ion/ion.c static void ion_buffer_add(struct ion_device *dev, · line 72

Quoted 8 lines
drivers/staging/android/ion/ion.c +1 -1
@@ -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