lkml.org 
[lkml]   [2021]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH] mm: Use BUG_ON instead of if condition followed by BUG
    From
    On 24.11.21 04:08, cgel.zte@gmail.com wrote:
    > From: chiminghao <chi.minghao@zte.com.cn>

    "mm/memory_hotplug: Use BUG_ON instead of if condition followed by BUG"

    Would be better

    >
    > Fix the following coccinelle report:
    > ./mm/memory_hotplug.c:2210:2-5:
    > WARNING Use BUG_ON instead of if condition followed by BUG.
    >
    > Reported-by: Zeal Robot <zealci@zte.com.cn>
    > Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
    > ---
    > mm/memory_hotplug.c | 3 +--
    > 1 file changed, 1 insertion(+), 2 deletions(-)
    >
    > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
    > index 3de7933e5302..aecb12bb7513 100644
    > --- a/mm/memory_hotplug.c
    > +++ b/mm/memory_hotplug.c
    > @@ -2212,8 +2212,7 @@ void __remove_memory(u64 start, u64 size)
    > * trigger BUG() if some memory is not offlined prior to calling this
    > * function
    > */
    > - if (try_remove_memory(start, size))
    > - BUG();
    > + BUG_ON(try_remove_memory(start, size));
    > }
    >
    > /*
    >

    Acked-by: David Hildenbrand <david@redhat.com>


    --
    Thanks,

    David / dhildenb

    \
     
     \ /
      Last update: 2021-11-24 12:11    [W:2.741 / U:0.496 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site