Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2274294imm; Fri, 7 Sep 2018 13:42:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYPeTi8tt6VkkqwBmpJX7hsAh2OCLYeq96gNjXPzxqxpvo4SyV366fi6mKfApQQJjUl6/cw X-Received: by 2002:a62:444d:: with SMTP id r74-v6mr10493593pfa.96.1536352959958; Fri, 07 Sep 2018 13:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536352959; cv=none; d=google.com; s=arc-20160816; b=p48o/dr155G5SHFl+5PKMMPeolGLzwV2a1jvViiU9DUkEgv1qyjyBtp4optD6Jcwiy dmxgWeDmJYOO9qTrHApQH4WLtmSH9YoXk/Nxlone1i89B3F5+YJ8moDJE6X0yRyO5zLt Ea6gujGWhPWQn8BbMCRVSkb5ox8ZAY/b8mmTACAQofA7k81GscHSVFgcbjw755ERi5Fh oiRGga7s2OCR/NjLcLJMzfha3mmvQwVOksNW1DecEwQAudbJ+0By3ZQ0Len+uY9GG278 iyps561DrKU4t7EgeKdViZSBvACCevqt6wPFKbhB44K/d+p1eqP3yM8Vi5dmTj1lYkJ0 z63A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=P3+TnzBzRjl/+q3WNfERb7eXELGhew0G/cSwLCGVnrc=; b=cTsS2OIFgHJl4UvZK+8WUkbzwCMDJ+EdvzWf7fHIQ6w0UopqOM5ffvrOmN+WIgzTAf UaXYTjaOI7mVO8ZEdxRdqBHyJ24OIveNirwKUt4wxmvePfdFdRpiWHISnRzxDY1I4QO0 YsNeT2oxAsY5+UBaieaDiC/VwUQEpfUVUE16uDGKc8T0tmQYKL6LVaz/I6usVdlP/3WL ZzH6kaol/aDpaa9EpCrAZD394WBugVgv4z7kdoDZRheyiW9qf9BxP8LDwiYdIUJmOhoZ QM+fptEaConptWL/+tV4090bRacD9XUT+jKgIZPGaZxSHduu+P0mIcyDLx96d6zs15xa atGQ== 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 b4-v6si9499844pgg.537.2018.09.07.13.42.24; Fri, 07 Sep 2018 13:42:39 -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 S1726284AbeIHBXy (ORCPT + 99 others); Fri, 7 Sep 2018 21:23:54 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43255 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbeIHBXy (ORCPT ); Fri, 7 Sep 2018 21:23:54 -0400 Received: by mail-qk1-f193.google.com with SMTP id 130-v6so10511036qkd.10; Fri, 07 Sep 2018 13:41:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P3+TnzBzRjl/+q3WNfERb7eXELGhew0G/cSwLCGVnrc=; b=f3HIDzV0QaqPIeefgkKZNAlyz4iwtle7m9bMsZZKTPp9xDiUJueeTWJzstOrsdRb1x v7Ihseaw9wXsTdaNnX/Wl709WMCNIrq1BcKobLQX94ZFR8cOaz87WULWGiIcRJ/dbibf Oa5cTCmKw7Zuc0khS1Ji2bBtccr8xoutXBujxN4tJDkBt4OMCT2DwwLIt45u3CiV1hLp 7gkWy1VpQvh0xOdcwaQdekdaJifDPOa3Y7yUbfpiw+ZqSjTjuHpkpiAX+5v2HiYrKaAa r+VCQYk+6AY+HsdpRVbsIhCMmxIac01H/upA1Tfiq6TAL7qhw8rNZqtJm6e7sND2eODc AuVQ== X-Gm-Message-State: APzg51CV7jxgegaFZdfhsvG+Hom74HIRcFbqPUBssY83nFtXspOX36PT 1AuUVvgURfqAUoh3vbNP1ATRu/EqyomdInAToBEM6FBI X-Received: by 2002:a37:1b62:: with SMTP id b95-v6mr6955425qkb.343.1536352876079; Fri, 07 Sep 2018 13:41:16 -0700 (PDT) MIME-Version: 1.0 References: <20180907192119.4931-1-igor.stoppa@huawei.com> In-Reply-To: <20180907192119.4931-1-igor.stoppa@huawei.com> From: Arnd Bergmann Date: Fri, 7 Sep 2018 22:41:00 +0200 Message-ID: Subject: Re: [PATCH] asm-generic: bug: add unlikely() to BUG_ON() To: Igor Stoppa Cc: igor.stoppa@huawei.com, linux-arch , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 7, 2018 at 9:21 PM Igor Stoppa wrote: > > Add a hint to the compiler. > If BUG_ON() is used instead of BUG(), it means that probably the > preferred outcome is to not BUG(). > > The optimization is disabled, in case CONFIG_PROFILE_ANNOTATED_BRANCHES > is turned on. This sounds like a good idea, as this is one of the more likely causes of false-positive -Wmaybe-uninitialized warnings with CONFIG_PROFILE_ANNOTATED_BRANCHES Could you add a comment about -Wmaybe-uninitialized next to the definition? Otherwise that is easily lost. Also, I see that the file has two separate definitions of BUG_ON(), and the other one does have an unlikely() in it already. Can you change both to do the same thing with unlikely() or not unlikely()? Arnd