Re: [PATCH] Convert BUG_ON to WARN_ON in bond_options.c

From: BjÃrn Mork
Date: Thu Jun 22 2017 - 04:15:01 EST


Jay Vosburgh <jay.vosburgh@xxxxxxxxxxxxx> writes:
> Michael J Dilmore <michael.j.dilmore@xxxxxxxxx> wrote:
>
>>if (WARN_ON(!new_active_slave) {
>> netdev_dbg("Can't add new active slave - pointer null");
>> return ERROR_CODE
>>}
>
> In general, yes, but in this case, the condition should be
> impossible to hit, so BUG_ON seems appropriate.

If it really is impossible then you should simply remove the test. No
need to test for the impossible, is there?


BjÃrn