Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbdFVIFD (ORCPT ); Thu, 22 Jun 2017 04:05:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:55466 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751161AbdFVIFA (ORCPT ); Thu, 22 Jun 2017 04:05:00 -0400 Date: Thu, 22 Jun 2017 10:04:56 +0200 From: Michal Kubecek To: Michael J Dilmore Cc: Jay Vosburgh , 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 Message-ID: <20170622080456.GC6104@unicorn.suse.cz> References: <20170621.173655.1945994342723484710.davem@davemloft.net> <20170621.175651.854625612625047729.davem@davemloft.net> <125b4ae9-2cb7-3532-5391-24404cf6eaec@gmail.com> <24691.1498084768@famine> <6dd7cfa3-9d3f-ed54-3278-af37e9d0f266@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6dd7cfa3-9d3f-ed54-3278-af37e9d0f266@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 561 Lines: 16 On Thu, Jun 22, 2017 at 12:04:54AM +0100, Michael J Dilmore wrote: > > Is it worth at least wrapping BUG_ON in an unlikely macro then? See BUG_ON() definition: #ifndef HAVE_ARCH_BUG_ON #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) #endif where HAVE_ARCH_BUG_ON is defined only on powerpc and mips. It makes good sense, you don't want to BUG_ON() on a condition unless it's extremely unlikely. (Except for debugging purpose but even then you don't really care about fine optimization when you are going to oops.) Michal Kubecek