public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: harsha <harshasharmaiitr@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG()
Date: Tue, 29 Aug 2017 20:07:42 +0200	[thread overview]
Message-ID: <20170829180742.GA27586@kroah.com> (raw)
In-Reply-To: <1504029622-9295-1-git-send-email-harshasharmaiitr@gmail.com>

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

  reply	other threads:[~2017-08-29 18:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 18:00 [PATCH] Staging:android:ion:ion.c : Using WARN_ON() rather than BUG() harsha
2017-08-29 18:07 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-29 19:21 harsha
2017-08-29 19:21 ` harsha
2017-08-30  5:58   ` Greg KH
2017-08-29 20:36 ` Dan Carpenter
2017-08-29 17:19 harsha
2017-08-29 17:28 ` Greg KH
2017-09-01  9:07 ` kbuild test robot
2017-09-01  9:11 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170829180742.GA27586@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=harshasharmaiitr@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox