Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2540169imm; Mon, 10 Sep 2018 02:46:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaOewM50CH9THYtLok18mcE8Izv1/hqhBR85E+QYW9DXSvn/3ndLGxPNo0qgIIcMhpzGscu X-Received: by 2002:a63:5b1b:: with SMTP id p27-v6mr21706624pgb.322.1536572796644; Mon, 10 Sep 2018 02:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536572796; cv=none; d=google.com; s=arc-20160816; b=LUhFDxsi+q1BwidCacRuvB3HT55wb78c+LsA0V4q8sv3ZY64DA71ZxZsclqvgsrVxf oi3vIoAciobBUkJTsi7IZhc71cG8nhqGR3q938y3QKzOMnn1eJLHoyf1IOmfNLqDcoM6 Eh7RDUj7ym3t+8XyfVwTCbVQL1ckHHrhFy6vcosYCnEATRCW1ZuG1x8D3/y+tGfO1M96 GgAkmH9Oxr7r+MWnFyIUHDomVq76kAiV1hSoHtUVERwpquZfA5DLqV91BHUy70dpfefd +9t2Y7jI4hyeMDshyoIQl0LB8k0swBTN0IYIh28n5Cg0E0wae58PnscRvv5UB/vd0udx Ux6Q== 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:references:cc:to:subject:dkim-signature; bh=Wa8dwKIZZXT39GhJu2oZlG5y/j2pwoOUpKuZN+ukFXQ=; b=TB+SRcHb39RhGDMaNF/2kmwy5Pm+dCJrjRVuL2B2Uzn/t6XvPLYsExcP5ctVSilI5s xSoQk3vcvFNH5+lqBzQnkdoiupY5Un0qaeoCXU98Z6/A3OKlZiJFFk3xXKbEjOT0Vb+A T2J29ga4UnfrsLqrcas0ZKB80gAB3lgY8FR8yc3on+ToPgjgCIXbdf/lp9Gcrf7ZLhZ6 Ncp+rIjt6PJJI/Pnk6DNMI1/RQl22D0lxqzshTcBk1F7BxlD7VXXqnM9MQ5SdYBzR6wg 2gNW60euTSX/bIBtz6NRLsA0uR/5825ElK5jF3mIBbA1w5cP1ZykLV/S0QYIGtmj0nC5 rrXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CtiX8ezV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u76-v6si18471222pfj.58.2018.09.10.02.46.21; Mon, 10 Sep 2018 02:46:36 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CtiX8ezV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728030AbeIJOiS (ORCPT + 99 others); Mon, 10 Sep 2018 10:38:18 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43073 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbeIJOiS (ORCPT ); Mon, 10 Sep 2018 10:38:18 -0400 Received: by mail-lj1-f194.google.com with SMTP id m84-v6so17286992lje.10 for ; Mon, 10 Sep 2018 02:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Wa8dwKIZZXT39GhJu2oZlG5y/j2pwoOUpKuZN+ukFXQ=; b=CtiX8ezVk4BVK142DIScWfCQt18B5on3P6c3mrpgqH30spgQP4L4g28FnwJzd6newi f9PIbEsnGjpU5FNN2iW/bfvZ8Kub5h0bF+WcrrMrQU17/fxENg+y/e6/IwrNZ8YjbTcH gCS4fxl3WrMcSbePKqFIu+UVhgJyGlLlPqs9SoqlGpkltHUO8F3BIceXigjB3B5bMcUz LB3g6geFyPCNT/q7V77Xp/G1TwuD6jSr7xYo6Sv/UnOTz/6Lv65WWc4T70wEI2DGuiZh uTQ/rm4gyrMKj4ycC9Jx+Ux2Q1cCLHZ3sKnc6moa/Y1xmuJyTNxiZb8ihT/3TdRJpkgW avHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Wa8dwKIZZXT39GhJu2oZlG5y/j2pwoOUpKuZN+ukFXQ=; b=gIW7jdwb8SMHy+OJz+PNtkb38KaxJXEinXApNR8k2HEUVUdnqf0p6qPJZ8OEFHDOuT S4fWYRbVGKwBvIfWmc6kWOOwNjzW2B7dOvPGsexbhKBsewlU7BVQBFoVpSgyj4AjwQYk 08Tfs/fH/pRtDFGdoJFUYhlMwSXp6dwIwhjBEZBI+n65b2So8/4CB6ROfML1GPb1XJSk yBYunXdlihcl5V8NWNHgEOONBLISevohDlTK92vztTsB+DfFiv6tSzGHvY+HU8HnK8JM u0sKqbYDSyabTp0ne/e75s/yD9mKUy4h2h/2O4uZ1mXVAuUKqOe98419Ri0nZyhqhBj+ +Pzg== X-Gm-Message-State: APzg51DYtD+KA2+uZcrSMRE2r5RrJjjsLbnT3kheLkYxkn6n0r5eaKuk eX3KSHNpOTY+rS5hOM5SbxtuIEUinPE= X-Received: by 2002:a2e:4242:: with SMTP id p63-v6mr11696507lja.83.1536572705412; Mon, 10 Sep 2018 02:45:05 -0700 (PDT) Received: from ?IPv6:2001:14bb:43:46b3:d135:7d7c:caf7:1c82? (dkqdnjzl1s10p1948tk-4.rev.dnainternet.fi. [2001:14bb:43:46b3:d135:7d7c:caf7:1c82]) by smtp.gmail.com with ESMTPSA id q85-v6sm2635503lfg.20.2018.09.10.02.45.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 02:45:04 -0700 (PDT) Subject: Re: [PATCH] mips: bug: add unlikely() to BUG_ON() To: Paul Burton Cc: David Daney , Igor Stoppa , Ralf Baechle , James Hogan , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org References: <20180907180302.656-1-igor.stoppa@huawei.com> <20180907220208.nqucxycxsxmyxt4m@pburton-laptop> From: Igor Stoppa Message-ID: Date: Mon, 10 Sep 2018 12:45:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180907220208.nqucxycxsxmyxt4m@pburton-laptop> Content-Type: text/plain; charset=utf-8; format=flowed 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 Hi Paul, On 08/09/18 01:02, Paul Burton wrote: > I'm not sure this will actually do anything. > > __BUG_ON() doesn't use the value of its condition argument for regular > control flow unless it's compile-time constant anyway, in which case > unlikely() should be redundant because the compiler knows the value > already. > > If the condition isn't compile-time constant then we just emit a tne > (trap-if-not-equal) instruction using inline asm. That will generate an > exception if the value is non-zero at runtime. I don't see how adding > unlikely() is going to help the compiler do anything differently with > that. Thank you for the explanation. Please discard this patch. -- igor