Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2250467pxb; Mon, 12 Apr 2021 19:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzof2t4dok+pajYA34tv6h/QG0M6S5BCOB02VGIsKlbKfFemGSAztmQFmphGhMeetoY9dys X-Received: by 2002:a62:14cc:0:b029:21b:b0e5:4560 with SMTP id 195-20020a6214cc0000b029021bb0e54560mr26405044pfu.69.1618281108484; Mon, 12 Apr 2021 19:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618281108; cv=none; d=google.com; s=arc-20160816; b=ApvUsCrKFrcBUT8j5NsSIKYLSYK3pPQgaVskgJ+qLFnXgyCJq6tRgLqEQ2nbUuDBO2 SpCavsdyLLrHrsND1RAeBjqL1MYZuoUeQA5+jgnZVADmEoGtFZ+fgCBTKEjTnb9lutE9 iKU/6eWGcrxtVKFVmK2HzFPa0eYXdxS8HHj6TieudLuBCDN/OLaqo22T3IipFWvfz5i3 WrNpnu7Xvu4JMklrS+eE6NFI9eAgfovfqv9xqtYwPdiL4ObEL75WlOhT9LQN7QvQh2lS ltxUipyn7Zjza6MtO3nB06emZLzA0Gzysx3lSs8+75bAYNsSCUrdkvQnd0cZW0kUBSYx s06g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eRJdvBkmVeYxLLf/ibjeX6N5s9y3JN6yse9dtwWmHTA=; b=lzia+3Sz7rdNcAhAFVj0Qruj7bb7xpE6txH4bCf4S/Lf3YopVMX4Zy0YQaFNjtD/qY 6BB59e0lI2JlGXZYN9HXvbizMSuW65TsKYUUts/4ZpazMtHzpRnLKtQJKxOjXm+ZMUuk tdcfTqdJRKYOZvkZaAecfv/oB10j7s/0wv+MuLEdLnXTKmM6+quzFTWFLohswIU2b86c B8/Z/MtfqlPv+zjR45AHD9VbzOirTIWAhNNbvo3Eg5A//7fyLa4/cVtmXkKe+X1cP8p0 PTy/nDkNN3glMLx7HkwNC9TAA56rSB1Lg28nqlfLYhtnml95u5o51wmeJvxbIjHB1MV3 XfdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m1xeaBNN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si1453490pjk.7.2021.04.12.19.31.23; Mon, 12 Apr 2021 19:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m1xeaBNN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241613AbhDLNFV (ORCPT + 99 others); Mon, 12 Apr 2021 09:05:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:35004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241518AbhDLNFU (ORCPT ); Mon, 12 Apr 2021 09:05:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17B2761261; Mon, 12 Apr 2021 13:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618232702; bh=vD2eYyoPS4jxroHHmL/LuAOn9cgDbkT8Oc6bPY6qgzM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m1xeaBNNR2u0eedACveIL+oyv1/ucClMVO/EwLyDdUNgi6CT2mseVPq9MoAKTLnjj DCCGco58nFoweuTKC5zBI1nNqe01n6FCrkKMgow0F055zt88Kp/RRH1L6WLo8wkNyF gyXaM6gkY4pve+MXr5ZykqwAJzfzlyGCixcSZndrJKVTMg5Rn/VcGo7hUQlnpfDe6X UfeQouMaiNNYUqIbQajrdMPIN+6HeaK+gw7xBgQdvh2TmEouLdt69D/9SKHYcQ280V z+BVktQTkiR6TZV1DGVNHxSFI9Ia8OZ3gX4zQXpbYxRkNu4V+PY6gHCoj3WTMdCyHH JQmJomv78hXvA== Date: Mon, 12 Apr 2021 15:04:58 +0200 From: Jessica Yu To: zhouchuangao Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/module: Use BUG_ON instead of if condition followed by BUG. Message-ID: References: <1617106055-6295-1-git-send-email-zhouchuangao@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1617106055-6295-1-git-send-email-zhouchuangao@vivo.com> X-OS: Linux gunter 5.11.6-1-default x86_64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ zhouchuangao [30/03/21 05:07 -0700]: >It can be optimized at compile time. > >Signed-off-by: zhouchuangao Hi, Could you please provide a more descriptive changelog? I.e., Is this a fix for a cocinelle warning? What are the optimization(s)? Thanks, Jessica >--- > kernel/module.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/kernel/module.c b/kernel/module.c >index 3047935..f46fc4f 100644 >--- a/kernel/module.c >+++ b/kernel/module.c >@@ -1014,8 +1014,8 @@ void __symbol_put(const char *symbol) > }; > > preempt_disable(); >- if (!find_symbol(&fsa)) >- BUG(); >+ BUG_ON(!find_symbol(&fsa)); >+ > module_put(fsa.owner); > preempt_enable(); > } >-- >2.7.4 >