Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1145078ybk; Wed, 20 May 2020 23:07:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPKYSc+F84g7/SuM8AF8eE2KxvFL9dCro+veV8wfd+9A2pHomvATZIjCzLcWXFhAYvrdg7 X-Received: by 2002:a50:b286:: with SMTP id p6mr6748126edd.350.1590041230212; Wed, 20 May 2020 23:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590041230; cv=none; d=google.com; s=arc-20160816; b=uXpHNFKHEeBokGraP/GTch02wHWTNFH241Scv+22Xns5IeU/Ydo+FtNDLRBg0tNm7h 8fOlWqbIlajOgmSGZkXtLc8PCpEn4ZbSBZW13E67F5rr4FNodxtPDkFL36fKN1lsbMOg PRDjxBSQsNgLitVP5pRYe17N4ySsSdmMWgw5SCasFzLJQcq549srpJwhuAypc/aQzb/u aZj2kDqLMc96I6k+k7bwzOka9sKVYgTdizJEqCbuheGBCdCp4AKcvpXj5ZxgddUpXO0i t8ye9TxcX+hL5frqL8BcHE2NGqDMr1GCI25gX86lkr0HzESr60CcPGGwi9SvNrVsfxNj +vRA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sLzO6AaZGCnFvcbXowTQDfE+AbORO1+b/Wmhk6/yp2A=; b=eEpctHHg7mi1730pILLO/adEMOUwPZ6LnynD21Oxvy4/stDWLf/0LsOJbHYu7/NtxF yD7G416q40iokiT8vfj68vTc86PecEMhokn9VcAxGKRiMUu1e/yhihKXlbuPo5/pjgDW c1fqx4Gj0HquFXb/6u79iwR9KyY370t85bY6jBjS/41EZjz6H7aIdZyYfp8tQ91FP/CB mK0XqgvYN5q7hcoXtVg3BfIsc8qnvn5DAO5798L+n/l6MApUS4p0g1ZsgUKjK6BcL96T dsqcVpFAkQldExi6c7c66NveZa9eFovkguIMnGhSBU4pn5hZuKn0BkO+2HwQfGltB2kw m8ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d46jY1Wi; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si3025314eja.143.2020.05.20.23.06.46; Wed, 20 May 2020 23:07:10 -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=@chromium.org header.s=google header.b=d46jY1Wi; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728224AbgEUGEg (ORCPT + 99 others); Thu, 21 May 2020 02:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728198AbgEUGEc (ORCPT ); Thu, 21 May 2020 02:04:32 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA74EC061A0E for ; Wed, 20 May 2020 23:04:31 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id r10so2674478pgv.8 for ; Wed, 20 May 2020 23:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sLzO6AaZGCnFvcbXowTQDfE+AbORO1+b/Wmhk6/yp2A=; b=d46jY1WiNtT+TTR21OXzy5EmRyieh4DSvvJyo4Pt9onu1LVvN5WX7HqqGHlVtCkYiM qpTUN6CWnGDj/SSaJU9fR9nH1q/oXTrWJ5pDLU48kVqqgxIrvWSp2QHDecMw2dMXOpvm mdUOyOiOa2uvTJ7Dd3pD3CR4rAxxOLpxPPcMI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sLzO6AaZGCnFvcbXowTQDfE+AbORO1+b/Wmhk6/yp2A=; b=i/7N+yYNOrgdM/xHIQalVRXJUU42Sa5Uy1+pJGScE3gW6O+p46W9gsfsCRbH1JtsWu 8jht23jgWQA2QF7LKznvJLTImxzMx9aK/CjWz23CX2sGunOHZGSh/fNt9M9gD+Zq93h3 Mb9p0CauJG8ywhajHBe3KTw27d62aPJ2vqzL1AqQPWs3JIABH4n70HpUpv9zmhKqMFi5 Rks41DHfytBOt3RvbxY6HRAB/YetoOzcmEJq5rtrkkDkvJQmUdsMAKlMVhV5mIlif7+G GoRn7FUrAWgKOMpu7Vuee3XhrDuzLJEQhfX9WM2jg/jpsKZDuy02BN8wXizeQC0mehzj Wg/A== X-Gm-Message-State: AOAM531tFYf8H6tT6DU4fodYQYzSTZpPYgoXKGWV6Etq8vVaGm82QtuJ y3tlxYrRQaKrASEGLjc0H5mpAQ== X-Received: by 2002:aa7:9297:: with SMTP id j23mr7693039pfa.15.1590041071392; Wed, 20 May 2020 23:04:31 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id k18sm3590146pfg.217.2020.05.20.23.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 23:04:30 -0700 (PDT) From: Stephen Boyd To: Andy Gross , Bjorn Andersson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Maulik Shah , Douglas Anderson Subject: [PATCHv3/RESEND 3/3] soc: qcom: rpmh-rsc: Fold WARN_ON() into if condition Date: Wed, 20 May 2020 23:04:25 -0700 Message-Id: <20200521060425.24285-4-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.761.g0e0b3e54be-goog In-Reply-To: <20200521060425.24285-1-swboyd@chromium.org> References: <20200521060425.24285-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the WARN_ON() into the if condition so the compiler can see that the branch is unlikely() and possibly optimize it better. Cc: Maulik Shah Reviewed-by: Douglas Anderson Reviewed-by: Bjorn Andersson Signed-off-by: Stephen Boyd --- drivers/soc/qcom/rpmh-rsc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index ce725d4ff097..8381bd012de4 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -385,10 +385,8 @@ static irqreturn_t tcs_tx_done(int irq, void *p) for_each_set_bit(i, &irq_status, BITS_PER_TYPE(u32)) { req = get_req_from_tcs(drv, i); - if (!req) { - WARN_ON(1); + if (WARN_ON(!req)) goto skip; - } err = 0; for (j = 0; j < req->num_cmds; j++) { -- Sent by a computer, using git, on the internet