Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1470870rbb; Mon, 26 Feb 2024 10:10:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXKEnaD0kb3Jq4xSi2O1J3L/PFV4m0CNO7IDTuocgf/gBrhgjkzo7ecGgEeQu1oAOBF1hQwqC68Yt5lgLuN2RfVq+s7cxyi4lE3jU2hBg== X-Google-Smtp-Source: AGHT+IFZ2wFF2ORJdMfMMhKWRFDiZVf+WndsUCXn5HNQBYHPmkel8DjpfDq30tS0hHr9nbpKM5oZ X-Received: by 2002:a17:906:d923:b0:a3f:1139:5a6b with SMTP id rn3-20020a170906d92300b00a3f11395a6bmr5976375ejb.32.1708971059618; Mon, 26 Feb 2024 10:10:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708971059; cv=pass; d=google.com; s=arc-20160816; b=IzeQPxhX8OzzXj1+hsZX6WjGgAAHtKxsiZ7z1gEYdr+AC4uS7Mbd1ehdnFyk+xWZIm htwYXh8g4qOs/4tTCBk22bjGBs1vyBwrDwkBYJhgIuMTHJs8w3aQX0tkouW9bg/exiUS KuMuYY76+sQOxUMLvwWioUiRC63zN29366ObVp2V6dPZsDMxtCJ8aVFZB2BDBfY24w0e 1d0f8qmy9yTTNh0T/4QI1wDraq8yqCAoFvdlhaMMq5HqK2NEsgT3SLpAOKAPVhBbSlUA MwRZTjWhW5tKxZO38BuUgj1555hL5c3RwXB58x/kyurEwc65yH9tam72lZPYgGv+REj/ 0K1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:subject:from:cc :content-language:to:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=yg47RDDGjmSLeRGvPjsi49ZX/HRmN9SEFjwf2EWA0b0=; fh=afb/MX/+uEZGvi6m/zWvUjlOI0WCuWfAsY03OSREzuk=; b=QuskZXdBelnm21LappDpMJNxEdm65ITD/sQVfVzETKlzvZPID7/wPe7CqaBLKGjr6V X5YsJOXYHwU1qTziZguAzcWBrxzqihutE8AHJ/4kDJcCa+5jGMAKaEaBiAoSpTyT1UPB iEbL7hSVU/V9+I7QeqaDJ/VnJqe2XkQb6jFAA/S656ymz5DmzMzyyfiG/1hAUYoBl6uQ 1MEL5yPMvXIucIju7i5Ucp2D2u3SmMqN0wO4qFo6/EpfXGvei0zkAkYZIptrBm3ij2Rh 85hFKEYd3k6xiFHpRHjJzKFUnYlDo2YFNeOTZYln3+0R5VzWcumCHrdBHxw4mf1JuVQ6 6tcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=U9uBdYs0; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-82123-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id sd8-20020a170906ce2800b00a3e9bbcaf3dsi2196986ejb.722.2024.02.26.10.10.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:10:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82123-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=U9uBdYs0; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-82123-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 60FBF1F2443E for ; Mon, 26 Feb 2024 18:10:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D449612F36D; Mon, 26 Feb 2024 18:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="U9uBdYs0" Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A92D912DDAB; Mon, 26 Feb 2024 18:10:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708971047; cv=none; b=Tg8gIvfLLeY7iP9AZ7lA4DVSJgy/RR/j9WH6EuZ1rnJAhp4u0A2GKMnfv513PBlQn9R+jHPP6vuvBNpJtXaqqarD1l+m2pR9YnvBO0ZzKxRsFVHjI6UpXXarjzZTh6QecFvgoeOgTkr7JHCzx7cp2PEgRjth+UYdkITrJMibotE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708971047; c=relaxed/simple; bh=hEcSAUnbz3n2LmN/VICAPNTSRgNLRrDuxbmA81pv+gc=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=NWO0z8GmO7zKYT7OmNPdaMJU5JoIJSbUu8QDBUIeZH78K9e2PHSmMSmuOOwzhb1ib9sORSPlhDDaD4SC3Lsr5uvNQ9pzmR11jUrrciMkGKUdH7N6KGnhfI6k3wSDAMvORLdV33m5s4Gb7FOE0hPIcm6e0ycvaOCBX4zBVsxOpf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=U9uBdYs0; arc=none smtp.client-ip=212.227.15.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1708971027; x=1709575827; i=markus.elfring@web.de; bh=hEcSAUnbz3n2LmN/VICAPNTSRgNLRrDuxbmA81pv+gc=; h=X-UI-Sender-Class:Date:To:Cc:From:Subject; b=U9uBdYs0pyb8l68xKrPVdFxo+9R6SFhdyVj0qGgcTg0RhLPhCBqMfZSsLbLwffgw NPdhLA/7pVO1KvXo9RAX7V0plpEvhzl8NZtzvJq6zC66402lXz/n7pY2KnzhsQo6o hfFvaSQ6sLF0/5WFni8w/0MY9prEcYE1cU/muPkig/kXZHucZ4sLIj/Dh4KYfWK/x ISJJllgT1chX7prypVqI7rgiQYBMXWWmda5Mqpjy46R+VOV4gQ2XRbq+PT0iThxjn 98ilyJnjZRy+20E+/eumTWhwpyNPDUcz14poOLPqqwE4+OnaADIeCsDOk6H9aibz0 jaeZPr7P7+JstHgLDw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.86.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MdfCH-1r5bnP3TLF-00ZZmS; Mon, 26 Feb 2024 19:10:26 +0100 Message-ID: <5a9e4cb8-824e-4f62-bfc0-ea4b89f27ebf@web.de> Date: Mon, 26 Feb 2024 19:10:24 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, kernel-janitors@vger.kernel.org, Abhinav Kumar , Akhil P Oommen , Daniel Vetter , David Airlie , Dmitry Baryshkov , Douglas Anderson , Konrad Dybcio , Marijn Suijten , Rob Clark , Sean Paul Content-Language: en-GB Cc: LKML From: Markus Elfring Subject: [PATCH] drm/msm/a6xx: Improve error handling in a6xx_gmu_rpmh_init() Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/rqSBuUqEf/kYjvRFzsIYsjAmaIC0le+OIDvKdMIX+8WRAJdbvl 8xwPiSyrSPo6Uq3TD7VkFy/4q1yq3KcxaapAQ8yTWrHKAUP7/6CW+W2I0E3NnApXUkdeTVy C37ffE9OObkJus66qXJuXQOSKy2Nlq1xqgpKUeMUh8cQDRpBgOzi1GIZaLtxqAksq/Uqad3 0+Sfc8wsFIIZklRtaqINA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:FdpfUuTW3hE=;qT2la4ln01wFUxHSA5KyVXPa8uk bDSBGRNcQ4L4T1mJBcXVHoxB1VWh5FJclNOYqCZ57T5LREm+BsdB5UErNW5PWjINDxAqgt9yF bHZuDp4nsQy8IHTUBVBBwdS8BYlTaommVav7DoNWzuaWSLK3bgIZ/4husDam4OHkeWvh1yA2l jSw5gRDiub6AkaTER5SqzR0isjTloSOc1JotE33+qSkMsFInCaT9Pbb/XD7cxVEICd/m0TwP/ toWrMP9BgtWS6gvJismpLsrafU1ALQmNQv9f+hKE/5/q7LOpaGBWLCgS2+gjJnTt/WIYStJDu zMxuKErCIZWdFpuuGwf19t3ToeccyXIhyzBTfrkG0m0A/PdnGzr0SZWJR3qEDc/FYTCTi5OLD Km8RMtHDAJHLmOm1ssV4oh4yyAaViUHQJ4w05J7DP0E8+Rm+5PO+RpW8mSm0Nj3gHFLE7qqad +13N4vRaAxpXuw0wRuIu1CmCKfNMmNvIlAtKUNv5bFuoOZ7lzzPfApVppqeV0Bf3RLctJHdZp kD+9awVAmnHyE8adXLKbTqidYs0fWhkOmmRoEK10UPQFD/ldum8P/e42Jc67LZ07uGTMwrkBW zyMHcsTGW2gxsLwEqyoBbmhi+CEcxANF7sny2jh5s/jAvLjPKe17oQ4qfxHBzHDRXgWegYqC4 J/m05LSMWYWYAl5amEVilbMD+bkuLejUoY1r3bXQo2ronNaxaCNgAeI7u4rWyLr3XNXsirSV7 pJvVq8B+XWt1x4uyljPbZpoopgtBEOKic+QlEushrvcR96JProjtUuobJsdeim0VFNYrkz/xs iif2Pl/N+X5WlPB1CpGE+VK9GdMf7PqPbLEWbiRJcBVaE= From: Markus Elfring Date: Mon, 26 Feb 2024 18:46:38 +0100 The label =E2=80=9Cerr=E2=80=9D was used as a target for two statements de= spite of the implementation detail that failure conditions could be handled better. * Thus return directly after a call of the function =E2=80=9Ca6xx_gmu_get_= mmio=E2=80=9D failed at the beginning. * Reorder affected statements at the end. * Adjust a jump target. * Omit an extra pointer check which became unnecessary with this refactoring. Signed-off-by: Markus Elfring =2D-- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/a= dreno/a6xx_gmu.c index 8c4900444b2c..55a34f11eb9a 100644 =2D-- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -525,7 +525,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu) bool pdc_in_aop =3D false; if (IS_ERR(pdcptr)) - goto err; + return; if (adreno_is_a650(adreno_gpu) || adreno_is_a660_family(adreno_gpu) || @@ -541,7 +541,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu) if (!pdc_in_aop) { seqptr =3D a6xx_gmu_get_mmio(pdev, "gmu_pdc_seq"); if (IS_ERR(seqptr)) - goto err; + goto unmap_io_pdc; } /* Disable SDE clock gating */ @@ -634,11 +634,11 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu) a6xx_rpmh_stop(gmu); -err: - if (!IS_ERR_OR_NULL(pdcptr)) - iounmap(pdcptr); if (!IS_ERR_OR_NULL(seqptr)) iounmap(seqptr); + +unmap_io_pdc: + iounmap(pdcptr); } /* =2D- 2.43.2