Skip to contentSkip to conversation

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

PATCH In review harsha 2 participants 2 messages Aug 29, 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()

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
maintainer
#1 lore raw
Quoted 3 lines · harsha

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

I still need a real name here.

Quoted 9 lines
---
 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 69

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

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