Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3203316rwd; Mon, 29 May 2023 07:09:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KvJnyiYh5Dk8ylHj9Ju0keu907C5fAul96/gKtGivDbGENHChiLfV2DwTtc5KS0NVqDEu X-Received: by 2002:a17:902:ab91:b0:1af:a293:e155 with SMTP id f17-20020a170902ab9100b001afa293e155mr9675075plr.16.1685369368820; Mon, 29 May 2023 07:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685369368; cv=none; d=google.com; s=arc-20160816; b=o0x/URG6npt7WsVXNrjlYQ9qaStAd16Sq3VuamjMgn7HIYbL3PC49tl1SRHuZ/+4CQ cSOq1gqsUqkJbCU6neZ0YBvFbGoBwS391VHEpZyY8CY+g5lMzqEj8C/hT7rCSH48hVQJ MM6/NkvVyHSqplyl3+eAoKXHb4n6E9FWh6Mg7TJQiIRS2gY6fSYmenFYcyqg2+9trjjb 12ms59nnXXIujhrnAf9v5mES3iPbQuXvh56AkX5ofFTZ3U7aD6O09rrbS4FBBWCuJha1 472rrWDspsmp8THZMe0yoGfgjoyzEHmcdIQR7VQH3JquxzVNqRUJl9bS963BD0Jd5zCS 3m2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=qmQPbfO+F1oBJQkI9K6akAThU3d6RkZKcfSUr9dQgtc=; b=ZbwNVQlhLeIEAm5vPo/lgQ0YzgculzWPGdjeWx8ifzltTpFZgJifoZlS5JM8qYtiKS wWYSZbh7875D0O1ZrDmP+e/ePOaUe4OEoIvYitfBvw84l2/WbRnxJNYL2iTXtXXQwr9n U1BaJaY1fGACzBhsn6/54ZrEaUMxdJLkTCXYWOilJzrYPZ2ofFU2xsLoklHBIBXpfhuu vwL200NAXefljPqkOZgDoNnsKynu5JSQstnFg6+8h/NIN97DpmrXOEtEg3Ol74pRm9R2 5/oVmUjdwqjFVRitYrstB/X7PwBcuQ/r8z6f6fkSnbmnT6ipA3il8UvucjAQMUu+F4JB 0XYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=prhQ9z13; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170903228500b001b03df75986si2225961plh.94.2023.05.29.07.09.13; Mon, 29 May 2023 07:09:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=prhQ9z13; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbjE2Nx6 (ORCPT + 99 others); Mon, 29 May 2023 09:53:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbjE2Nx0 (ORCPT ); Mon, 29 May 2023 09:53:26 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 496C7100 for ; Mon, 29 May 2023 06:52:52 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f4b384c09fso3776699e87.3 for ; Mon, 29 May 2023 06:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685368367; x=1687960367; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qmQPbfO+F1oBJQkI9K6akAThU3d6RkZKcfSUr9dQgtc=; b=prhQ9z135A/XL4btw/gHLarhsQTq1qSmqcG9EJ/CgoAkvg5xhCypAQNSmY6M7r9FVK DgxDVZ3bZ74uiCWStRYQkHwb2hONVAeYtRqz0SlVxGEj1nCkXPuyajvRxhSQWt7SvyKg 5GuXouEjufiAondg96OBTe8iEx7lnu0mz0zF2fnYnUDW1U/vkuCMCSHEdnuvbg31jw9T yC7BDN5uKBJGnNT0nZZfG71ell3GbPey3XmF6oZE8rgS0ttmsht2TSjsK9djvW4XRo5B s5hK2/ewptLEFFIPCRX/M3d7z2OITer4ow43PzVZ4rUwNHLf932bLJ8gDf6YRdksDLZY 9RMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685368367; x=1687960367; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qmQPbfO+F1oBJQkI9K6akAThU3d6RkZKcfSUr9dQgtc=; b=gUxJ2kjqEjeJAKkNpx4eJKgWNc1HDoJnI0rJxQLLS0IDNR0/YYu+sdOAYMDNMTjKYi nOpJANbtOO7KpubWAE7PSiKjB4RpoyOmaf4bR1EMja8rkv0lLMelQLGaqQNhXj7/xOPt nPNXWNCjRlDW2kPKeO42r/Ib2f46iRDysObBUVzW2CVtSmsYb6Atfnv5E+1MOxpnBti7 MyON8lhnBF0R/Don8OqG1Ac3PaASG5bzVB4th0TSJI3kxJqMxNYOUY6TW0IV/YzugRoW ZMkJjWte6QobFaoNEoi8Oqp9MRPpezlGcxyAwjLHSH1lYb4vR3mszql364+Nd+ul0+7I E2pQ== X-Gm-Message-State: AC+VfDyWaqZO6J0eCP9a6kSIsBmq9nndiYAzY99Hd1VKjx9FJ0kC7zP+ ajsGwqbsZ0leiqVESa4Gf+gsFg== X-Received: by 2002:a05:6512:64:b0:4f0:c18:5114 with SMTP id i4-20020a056512006400b004f00c185114mr3608499lfo.26.1685368367275; Mon, 29 May 2023 06:52:47 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id c16-20020ac25310000000b004f2532cfbc1sm4700lfh.81.2023.05.29.06.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 06:52:46 -0700 (PDT) From: Konrad Dybcio Date: Mon, 29 May 2023 15:52:34 +0200 Subject: [PATCH v8 15/18] drm/msm/a6xx: Use "else if" in GPU speedbin rev matching MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230223-topic-gmuwrapper-v8-15-69c68206609e@linaro.org> References: <20230223-topic-gmuwrapper-v8-0-69c68206609e@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v8-0-69c68206609e@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Bjorn Andersson , Konrad Dybcio , Akhil P Oommen , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Clark , Marijn Suijten , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1685368343; l=1434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=H2Z7peqqE8oAE8U3nTlARepFCY8M4ZLiVH3inaSxkyA=; b=cJIeKzGQe+QN5PWfsZoxB2X1FWjbe0uOO7QgbvODui4tH5P1SROuXZRm59GAYZ5IXYQ/FggUp lfKc6RPYy8kCvM8sJpZC8p+ZpSbu87BNBxXpAZDsP1d72JhvWbstku7 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The GPU can only be one at a time. Turn a series of ifs into if + elseifs to save some CPU cycles. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 1a29e7dd9975..5faa85543428 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2170,16 +2170,16 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse) if (adreno_cmp_rev(ADRENO_REV(6, 1, 8, ANY_ID), rev)) val = a618_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 1, 9, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 1, 9, ANY_ID), rev)) val = a619_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev)) val = adreno_7c3_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev)) val = a640_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev)) val = a650_get_speed_bin(fuse); if (val == UINT_MAX) { -- 2.40.1