[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3eba90dc-128f-49da-41a6-81494653d535@infradead.org>
Date: Fri, 21 Aug 2020 09:25:26 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Tomer Samara <tomersamara98@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Arve Hjønnevåg <arve@...roid.com>,
Riley Andrews <riandrews@...roid.com>,
Laura Abbott <labbott@...hat.com>,
Sumit Semwal <sumit.semwal@...aro.org>,
Todd Kjos <tkjos@...roid.com>,
Martijn Coenen <maco@...roid.com>,
Joel Fernandes <joel@...lfernandes.org>,
Christian Brauner <christian@...uner.io>,
Hridya Valsaraju <hridya@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
devel@...verdev.osuosl.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] staging: android: Remove BUG from
ion_system_heap.c
On 8/21/20 8:28 AM, Tomer Samara wrote:
> Remove BUG() from ion_sytem_heap.c
>
> this fix the following checkpatch issue:
> Avoid crashing the kernel - try using WARN_ON &
> recovery code ratherthan BUG() or BUG_ON().
>
> Signed-off-by: Tomer Samara <tomersamara98@...il.com>
> ---
> drivers/staging/android/ion/ion_system_heap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
> index eac0632ab4e8..00d6154aec34 100644
> --- a/drivers/staging/android/ion/ion_system_heap.c
> +++ b/drivers/staging/android/ion/ion_system_heap.c
> @@ -30,7 +30,7 @@ static int order_to_index(unsigned int order)
> for (i = 0; i < NUM_ORDERS; i++)
> if (order == orders[i])
> return i;
> - BUG();
> + /* This is impossible. */
> return -1;
> }
Hi,
Please explain why this is impossible.
If some caller calls order_to_index(5), it will return -1, yes?
--
~Randy
Powered by blists - more mailing lists