Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1403774ybl; Wed, 28 Aug 2019 14:14:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2Em2kFTGHFERrq+4vV8FDdGgqnA5F9KpNNc4C6Y5eMpbAu8WOGUVYPPf3vzWsbI8w20cD X-Received: by 2002:a63:f907:: with SMTP id h7mr5232352pgi.418.1567026899524; Wed, 28 Aug 2019 14:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567026899; cv=none; d=google.com; s=arc-20160816; b=WycMD1FmhdC5XgL8LdhHPPpqUD6VM2QhhO2ux+hdByeACUVssDNzI63nS+2JPP4Qly 9t7DF9uHW2ICRVOVeGkH4KGvOc6XRdc+7+VOKYjkhlM6E2OgWezBsmtITTuOb6WulhmT Mn7I/IllLSsC/EZUbhSe45K4MRa92D4TpmZHpgMvEogrScpjpfYK9aVZbLYwFYFeu1lF phzTqsZ8Ar807aPSZcGo1L9ViY6AsqNidqGMrdcTAwrpCWDtyYEbqpUzjbuLq5nz7/r7 +FsvBgMmNYyr1db93PphbroAd1NB2YUpfRTyMD745OV6w4jpp1tQbkn4ez89U8mmn2SS 6vag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:to:references:cc:subject; bh=scK6EtL0VQwZVHWRtxKBD1vWCx0TbIgqwfjMtIULIk0=; b=yqn6FOLzxDfnuah1DTi5XQvsch9UlNK3bV8EkedPrLtqBHPG8+AD/19YnnqXlVR68G ELKtq/dKHGK5DVQVi3yG6soVPtpY/aAfawKYqCnkGPKsKcuDlYG7Vikpb9Rp5gCNFhyE vUuQF4FjaUP8TAvzXG+32xz8vlwHWEwvOGc/ka6B7bAmQNCKnatvkrl56+fBzvIN/awV 90a6sMNpx+odLMd2QMAcB1Poef9mqBzXYL4N50X350iD/T9nFGf7XsxsCpx+i7xQ8H53 1+95GMXXsuHQliAh/h07obq81bT2S4RCuZ6Bz5YfVpI5o+wAchrpq4T+3pwLQDdeK7x5 bdug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si203940pgq.282.2019.08.28.14.14.43; Wed, 28 Aug 2019 14:14:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726894AbfH1VNt (ORCPT + 99 others); Wed, 28 Aug 2019 17:13:49 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:38393 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbfH1VNt (ORCPT ); Wed, 28 Aug 2019 17:13:49 -0400 Received: by mail-ed1-f66.google.com with SMTP id r12so1571326edo.5; Wed, 28 Aug 2019 14:13:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:cc:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=scK6EtL0VQwZVHWRtxKBD1vWCx0TbIgqwfjMtIULIk0=; b=FSPd/nWqslwbGt9CLhe1VUgpL9sHFETICjfqNaCy9WzjDA8qjI3jVLJDv58xVmqRzy Y4qNQlqBc05RdZVCavZ92clY8GTO+660b0QGlkUVa7SnupzWC87UQisOwQU35Kz5y9uU aV5ZGubjAuOGlGYymFcYxZueS3URL4avM6rlUFXAwnJ2Kyo4NzTgZ0nHyU8aCsdoi/ig oWpxJLSRU5wF/vUNCaPBC3IFf8aPVPdHzHz96/mpTbfBTeWBZYHgLt+quLT0dNT+zZM3 ChsVoc3rFVr6uDEDoyLGttU5VwSV3UOqW45QwcR6a11F3OBM38Ba/F69uzzzkU3q/vTN h0HA== X-Gm-Message-State: APjAAAWCF/NNpUwEHk0PFimTNIV46oxft3DjehYeZEmQ8VQFItNyWjhk hnrvgwVSWVEC3JzNDu9CUVzNYlmh X-Received: by 2002:a17:906:2596:: with SMTP id m22mr5219849ejb.253.1567026827020; Wed, 28 Aug 2019 14:13:47 -0700 (PDT) Received: from [10.68.32.192] (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.gmail.com with ESMTPSA id g22sm66386ejr.87.2019.08.28.14.13.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Aug 2019 14:13:46 -0700 (PDT) Subject: Re: [PATCH] asm-generic: add unlikely to default BUG_ON(x) Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org References: <20190828210934.17711-1-efremov@linux.com> To: Arnd Bergmann From: Denis Efremov Message-ID: <4ad61875-f694-58a6-f5d8-fca52c093c1d@linux.com> Date: Thu, 29 Aug 2019 00:13:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190828210934.17711-1-efremov@linux.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Maybe it will be better to move this define out of ifdef, i.e.: #ifdef CONFIG_BUG ... -#define BUG_ON()... ... #else ... -#define BUG_ON()... ... #endif +#define BUG_ON()... I can prepare a patch if you think it worth it. Thanks, Denis On 29.08.2019 00:09, Denis Efremov wrote: > Add unlikely to default BUG_ON(x) in !CONFIG_BUG. It makes > the define consistent with BUG_ON(x) in CONFIG_BUG. > > Signed-off-by: Denis Efremov > Cc: Arnd Bergmann > Cc: > --- > include/asm-generic/bug.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h > index aa6c093d9ce9..7357a3c942a0 100644 > --- a/include/asm-generic/bug.h > +++ b/include/asm-generic/bug.h > @@ -185,7 +185,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint, > #endif > > #ifndef HAVE_ARCH_BUG_ON > -#define BUG_ON(condition) do { if (condition) BUG(); } while (0) > +#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) > #endif > > #ifndef HAVE_ARCH_WARN_ON >