Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752792AbdFVIO5 (ORCPT ); Thu, 22 Jun 2017 04:14:57 -0400 Received: from canardo.mork.no ([148.122.252.1]:40667 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbdFVIOz (ORCPT ); Thu, 22 Jun 2017 04:14:55 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Jay Vosburgh Cc: Michael J Dilmore , David Miller , vfalico@gmail.com, andy@greyhouse.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, joe@perches.com Subject: Re: [PATCH] Convert BUG_ON to WARN_ON in bond_options.c Organization: m References: <20170621.173655.1945994342723484710.davem@davemloft.net> <20170621.175651.854625612625047729.davem@davemloft.net> <125b4ae9-2cb7-3532-5391-24404cf6eaec@gmail.com> <24691.1498084768@famine> Date: Thu, 22 Jun 2017 10:14:31 +0200 In-Reply-To: <24691.1498084768@famine> (Jay Vosburgh's message of "Wed, 21 Jun 2017 15:39:28 -0700") Message-ID: <87o9tg1lso.fsf@miraculix.mork.no> User-Agent: Gnus/5.130015 (Ma Gnus v0.15) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5M8F7dO017223 Content-Length: 472 Lines: 16 Jay Vosburgh writes: > Michael J Dilmore 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