From patchwork Mon Sep 11 15:10:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 721504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3513ECA0ECA for ; Mon, 11 Sep 2023 21:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236223AbjIKVQ1 (ORCPT ); Mon, 11 Sep 2023 17:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241554AbjIKPKo (ORCPT ); Mon, 11 Sep 2023 11:10:44 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41CD3FA for ; Mon, 11 Sep 2023 08:10:39 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52889bc61b6so6062574a12.0 for ; Mon, 11 Sep 2023 08:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694445037; x=1695049837; darn=vger.kernel.org; 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=hB07AWQ6+/HjqLThhLj5XIDObxfEfer4Yjs2PDgZbco=; b=ZOtQyqzyDIvSBpOgiZn5wCN03fcMB8DKKexIkzt9gck0m4rhhhRweF+RLj+E1x22b0 W7HTTlJx9v73qxNjbP4ARBv8I6j2nnXKPllW0xMgQ+HZ4HL0XNtKfm4CFi0gE31dmSp4 zdxnYymR6lcOQwNj0Hqg05RxA8xM0qHorJY4Vlp7uS53wpywrg93uT0fC5ndfp/K4iI5 ep9jV30RkrC5j3AJFzrmgI62IxTAHcjLDnNsZg1E8BdX+b6tliC/h2X7i1ss8XP70NWV NjAJ3ozguAZdqlaV5LELJY3LgGJPBO8jH3t3y+D2zNCwP8M5lbtNE808bhdwumgTSsax oFUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694445037; x=1695049837; 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=hB07AWQ6+/HjqLThhLj5XIDObxfEfer4Yjs2PDgZbco=; b=H7sQatpi598YhjxrOxCdYt4wUP0ub5V3v5qGc9ejKJSnqNLhjP9+9xMIxK6bxrbEJf lkr6ASMa8r5lS4zo6UtQINdHDNW522EiNwFiiz7MuT41tlDeJG2uCrRKTo2+PsFs6nqb DmEaoWSjzJuED0kkkmj7IvKk/3WH/swdmyZQJDZ0pNMjZStaSR2GrQUEqpftvsRMSoEo qV3vFoxsR7xv8fE7Fcwlpc5zWRcrVMOAAqmiYnDwy5+Mqpe6LWy0jTEkMJFdJ5fkengL xkBlArEkrZLihiv4fEFUtodJtAR4AprRENcKtbucsK4Xq+UOle+1yw3NnLW/0+0XVhTV XjVA== X-Gm-Message-State: AOJu0YxD24ZlzWoVL9wT3T9AnVfLCzJcgdcX+v2MffRZPZI2GQlnjlY2 FiDGv4VrQbIqY/3Ab7YRw9+iGw== X-Google-Smtp-Source: AGHT+IHJPABWpI7Eq8rnPAY/s+Tohmf2Ji1RKKVtBhUqvuYbf4fo8qwJMluBqGhBSsrvs20bqX1bFg== X-Received: by 2002:a05:6402:8c3:b0:522:20a0:7eb8 with SMTP id d3-20020a05640208c300b0052220a07eb8mr7959403edz.33.1694445037678; Mon, 11 Sep 2023 08:10:37 -0700 (PDT) Received: from [10.167.154.1] (178235177061.dynamic-4-waw-k-1-1-0.vectranet.pl. [178.235.177.61]) by smtp.gmail.com with ESMTPSA id n4-20020a056402060400b0052a3ad836basm4681281edv.41.2023.09.11.08.10.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 08:10:37 -0700 (PDT) From: Konrad Dybcio Date: Mon, 11 Sep 2023 17:10:19 +0200 Subject: [PATCH RFT 05/20] media: venus: pm_helpers: Kill dead code MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v1-5-a7d38bf87bdb@linaro.org> References: <20230911-topic-mars-v1-0-a7d38bf87bdb@linaro.org> In-Reply-To: <20230911-topic-mars-v1-0-a7d38bf87bdb@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Philipp Zabel Cc: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694445027; l=2141; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=QMvOYSIDhNKQG6pzBZaUv6e9JhH/er8ZMPeUWk6srGI=; b=XK0JQo551H+KBf+i/fiVuIM7cxliwEN1dSWCIJuOIUFCAvdHNT1EBk3XeoIB/hy/oghd/Gh6b LIBRGGfXgMcCgxb3Vkt4cp666O9latCD1vNrsCFGEnccpEky0ql/Vv1 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org A situation like: if (!foo) goto bar; for (i = 0; i < foo; i++) ...1... bar: ...2... is totally identical to: for (i = 0; i < 0; i++) // === if (0) ...1... ...2... Get rid of such boilerplate. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 9bedb3bc7223..f5130aa3ddfc 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -875,9 +875,6 @@ static int vcodec_domains_get(struct venus_core *core) struct device *pd; unsigned int i; - if (!res->vcodec_pmdomains_num) - goto skip_pmdomains; - for (i = 0; i < res->vcodec_pmdomains_num; i++) { pd = dev_pm_domain_attach_by_name(dev, res->vcodec_pmdomains[i]); @@ -886,7 +883,6 @@ static int vcodec_domains_get(struct venus_core *core) core->pmdomains[i] = pd; } -skip_pmdomains: if (!core->res->opp_pmdomain) return 0; @@ -922,16 +918,12 @@ static void vcodec_domains_put(struct venus_core *core) const struct venus_resources *res = core->res; unsigned int i; - if (!res->vcodec_pmdomains_num) - goto skip_pmdomains; - for (i = 0; i < res->vcodec_pmdomains_num; i++) { if (IS_ERR_OR_NULL(core->pmdomains[i])) continue; dev_pm_domain_detach(core->pmdomains[i], true); } -skip_pmdomains: if (!core->has_opp_table) return; @@ -945,9 +937,6 @@ static int core_resets_reset(struct venus_core *core) unsigned int i; int ret; - if (!res->resets_num) - return 0; - for (i = 0; i < res->resets_num; i++) { ret = reset_control_assert(core->resets[i]); if (ret) @@ -970,9 +959,6 @@ static int core_resets_get(struct venus_core *core) unsigned int i; int ret; - if (!res->resets_num) - return 0; - for (i = 0; i < res->resets_num; i++) { core->resets[i] = devm_reset_control_get_exclusive(dev, res->resets[i]);