Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2256798rwl; Sat, 1 Apr 2023 04:57:42 -0700 (PDT) X-Google-Smtp-Source: AKy350Z5EOkS1kH8qkz8k6InSaCQqqAxMRx4xCIobYobHTpQoROkFB+1gnvTx+qgJ2PvLoQ+qoyR X-Received: by 2002:a17:907:c25:b0:895:58be:957 with SMTP id ga37-20020a1709070c2500b0089558be0957mr37051976ejc.2.1680350261927; Sat, 01 Apr 2023 04:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680350261; cv=none; d=google.com; s=arc-20160816; b=m12KbteD8X6fDOAU++lH57RR7F3Bx7ovZdZvyI6hWclV21E3XoALqf+VZ+eEqPCgBk N1Qvdj36Ef4IJa0XLc6VYJP+JHp+SbRx7z0gpZqt7lyUwZ1JvEZvr1v+xiF+li69HQ4j ieWgnDwOzLKoo3GakR9TpfKtuscN8FVgNA+3SRpko+d66PAoby4HJNCC31CC/1mnZD+9 coBxwTIP6hPBFbfoUS7P9eUiz1gwFBxJTv8rAWwvZNFcmMJjAL5eShL6haMM08G1rUm8 6VlOczBHJJRZRA0abSyVui/cAe2vp8KLCTFkzFJoyeOxrGuflhpdx74phFPpnt4uxM/Q mTew== 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=V2TYwAn1Jyo9PBH+9U5+LtUDgGXL54gtjUvzWRdUK1Y=; b=WXdHqNbi7ehuhXi3Pyz2cn2jdoVX0um2eppqo2Rd7E2ZrLdnFLRom8OWNc2ZAId1Am r/B5rqJ3091Tt7n9oO6QfOpoFnJtfRGftkpeOk21ZBAezq9ZifmWo9rNH6Bwbv5MkNzY kfiEJDW54B3CVIpFCqAAZrtNReiJz0mCAKNKgje2D9izxxjXVT68rpUCSWapmfCENdPH DijvGthSyS+dA3iVwl26qQLerhU/iLNBJGkJOYiVNpd6FhCfsR5/pvKNNFf4c6sTxZRX K3cOxS6+phSp96i9TI0qTRS1aENFFpY81JUaIc8oB1DDK9LPQk9Dq9cNPMvspkWtszH8 JyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MCDfAhre; 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 n11-20020a1709062bcb00b00947432cee78si4373501ejg.791.2023.04.01.04.57.17; Sat, 01 Apr 2023 04:57:41 -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=MCDfAhre; 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 S230140AbjDAL40 (ORCPT + 99 others); Sat, 1 Apr 2023 07:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbjDALzy (ORCPT ); Sat, 1 Apr 2023 07:55:54 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F942659C for ; Sat, 1 Apr 2023 04:55:36 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id br6so32194798lfb.11 for ; Sat, 01 Apr 2023 04:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680350124; 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=V2TYwAn1Jyo9PBH+9U5+LtUDgGXL54gtjUvzWRdUK1Y=; b=MCDfAhrecL41SY1SS6uJ7vUnQxBWQ8vuGxBhgLKL9MOgthQlKYzvUk4YwBsCv5jJ2p GSJAMnbGJl+nQXlULJs1FSsSD74MryfUHLHiDNZRDBUHd7b58qX9d1s+KCKVmcvraKc0 W533Hf9iG2IsGN7c1+DXlBFdGjAN9FQXLXxFkNafV/3JCOQxuN+0u2Qm7I+8VGbvgiff PB0Fb+PWONoH7YXQOWBKts8gCSqJIDbtTHRq4iXrZ4K3YFnaXEyCP6o9W9BWuvXoYevS Wj/JDr+sYgjWfagMoWqNFMgub18cjNITLh4rTI4gRpRIdi6L8enhVDzo3x2WQ+rxwlLy i4NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680350124; 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=V2TYwAn1Jyo9PBH+9U5+LtUDgGXL54gtjUvzWRdUK1Y=; b=O3bw1oh8qgttJx3WCryX1Qk6yzOcNsxGEZiPLqRlyVrDxe/2OtR/NBHZFI5aAralIL VjJElF2iBWnlbhJGmKND5/1UHrd8HtSuOt5bZeip7RecBppuy0lFYchI2GaojcDYWmgN lxMfcOhaH5k2S2YjyKYxTzx/rM80oU6hz1qvKplMlBGhamf2Mr1FJP7iwgLneAbts5I3 qmbws9RY9d/6JmIW9TYL6UOwOB7MEOEKBPUG5Ezf2TZskkq/N1R8o67lQwEStPXbaXKT ckNk6yiUd2vqiOEhP4I74runz+bvsF5ykMuajtMiAaGiKcSROIbEMuimS13cIAs2din8 7k2g== X-Gm-Message-State: AAQBX9eplfd2TtkiYQWWkRh8EfoVZ+m6jqVyQiz6UQxLLa777T7j8X9X CimUdBf6dGjdUjGe+gb8IwP64w== X-Received: by 2002:a19:550b:0:b0:4e9:c627:195d with SMTP id n11-20020a19550b000000b004e9c627195dmr8145645lfe.57.1680350124471; Sat, 01 Apr 2023 04:55:24 -0700 (PDT) Received: from [192.168.1.101] (abxj225.neoplus.adsl.tpnet.pl. [83.9.3.225]) by smtp.gmail.com with ESMTPSA id w8-20020ac254a8000000b004e83f386878sm786737lfk.153.2023.04.01.04.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 04:55:24 -0700 (PDT) From: Konrad Dybcio Date: Sat, 01 Apr 2023 13:54:49 +0200 Subject: [PATCH v6 12/15] 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-v6-12-2034115bb60c@linaro.org> References: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@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 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=1680350084; l=1434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=PUHRMhG2i7xarnxRfpZn2n4mbPzcd2Fd9BsLsPanfMM=; b=9m5H4CFtN6EC+FWJ//p7SwY92+XoqEoJDeGxyad+OdlVR2aSCDzbfBKcJ+7PZ/AAsHVPruU1PezJ w6wcitFEBKR7VUABWMNzhZ/JHGR8NcVQdKNySSAZiH+5yNl8KZbU X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 389a1f7251fe..a802a29f8173 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2171,16 +2171,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.0