Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2176360lqe; Tue, 9 Apr 2024 11:37:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXW/fAsCrs2SY5UnWiRDTsxPI/OTbELaeq94NkDkuaXHoVAC682lQmHXZgbqx65W1AU25fId6JKrq81hZ52vZJm121+UN3Vle4SukvYGQ== X-Google-Smtp-Source: AGHT+IH5wG3Ap5NNYYf5ELbp26GI2gAHeSSARv5NU+oj9wGm+zW7KGLx0bFEtnfgyJoT0vfhAhIZ X-Received: by 2002:a05:6a21:4981:b0:1a7:2924:7317 with SMTP id ax1-20020a056a21498100b001a729247317mr751594pzc.49.1712687835362; Tue, 09 Apr 2024 11:37:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712687835; cv=pass; d=google.com; s=arc-20160816; b=Q3feN1lo5E3rb4BDwYPLUUxJdfHddO/z3VG54VSEpMEFnpZKs6/PKoQIVHKeYsttUm aw5AG81GAXjnVDUM7eUA4npTaLK9tAn0QAe8a6EbTWLce9uTJ2QPyeoYcxHt6F/26Owk ibntyLvrYbUHnETgWME+p9ovLI91Xx7OVA4Oqurar9NvLsQjT06fBYgqX0lkJ2x2+Nb4 T5tDrWcP4OBVEfSvfkIdomKfl4FPFkvpZwkXoPxqQ1jsLcRy/HWK8HD0aAESBMZ6wnZF kMTXiQ6sZsdUS4PMdk+1SJAC91HalqnqCSfa3DhJL44OaXn0XQSkxDUapcxt1+ZCGP5A 3wtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=+wZb9A72MwDJrPbXbqaYUytPBMFCCM9T0SRAGYwfDmk=; fh=KvLUGZaoGijtoSBGu57dikxEAYYefwrlZaxtg39jJ9c=; b=OtxgT8IswiNc4sT0/r+yBZcYVUWzHAqqtTRsbaAQsoFOtaUKtwxLas6EMBgwrdvLGm V0WidAlAJHdyILPzK5BwLxYmBJknzae3B8tDSJAgbyxaHOLilvIekQkdVKFkr/znOKEZ AnlXGjiq168hm61Lf4S5WhqqDPSm4+nOfZBDsflIiqAlq+Qi5NJWR1yvnQbszJfiAnvZ ibR1hCVwXersg5Erliuq3rX0H0TO3RV82MREJVoXys96NJSTNpzkCDJ92evB0+PoifQ+ Gf1SJUwMcTKhyQhkHKJIw3M51Wh7/IIZzy+xSuW0EReW7yBV0dBszFhcNMwq/V4vBBQY aVLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VNZSe1pb; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-137463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i12-20020aa787cc000000b006e69fdb9967si8904860pfo.3.2024.04.09.11.37.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 11:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VNZSe1pb; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-137463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 32E49B244D1 for ; Tue, 9 Apr 2024 18:24:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2AA79156C4D; Tue, 9 Apr 2024 18:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VNZSe1pb" Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6D8B156975 for ; Tue, 9 Apr 2024 18:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712687077; cv=none; b=pvfja4YuGbLlHVDJb72g725tXasAf2uqgwHMCgFR2/k9jJEfVZNRYXD1tQtzis8XOxBE8c/aZJxDnyY45gVSB5SWsJgfh33dB56G/Sz6xKHvz9TgJUQ9WMrcbSWTbvEKf0qtuSF6eZEa8KAiFVrNfgOKTWU6+NUQsPDpIp7OkPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712687077; c=relaxed/simple; bh=nOnsfl0GsfC4VdYtGwNa9Kp0Hw9JKCJNwUkrKLiFAWs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=q2NGHw2c70IyrtJXcaNVWRIMPUdLYNh79fjLPwpH4+PQFFBhx7v/kWPP6X2O6UePHRHO8QnAcP8SpbUhz754dyDUl8pAJqGrbxgTwxI08BC050rXcOoJrFL49v015J5GctMD15cGAWoBLBdqmKKcc8VGA6Kwm3tOWPZdQGmEjlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VNZSe1pb; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-516d3a470d5so5549061e87.3 for ; Tue, 09 Apr 2024 11:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712687074; x=1713291874; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+wZb9A72MwDJrPbXbqaYUytPBMFCCM9T0SRAGYwfDmk=; b=VNZSe1pbWyK3yczEpXTdEfGoJWM+hW4aCMPUXm2qNzG8J8cK8bjJ2sZbuInJN6wGAh +NAbHahTp4sClmEHEUGMZkuu6fVW6khWhmFMTgNl9cZDT9SznoNZUENspekDVEWk9O6T 779hTRCFtAzUouMWsndUvBtqhW/pqHjYK7YXfIINvINwvXBu6Zt6DlugHP60OyHjeThC y1WYXuACy05qlQQNE/ZGyfUjX/u+gEId+Ky4tppGIQswWuFzcsJSPgmnE2tiUGhmDlm9 h2Z3M9tnZ9GyE09y0/U3/04zkOMDO/oMsiA7HI4Gcg/3akasRdx5zVGIeFgxaRrTTXxe IbEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712687074; x=1713291874; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+wZb9A72MwDJrPbXbqaYUytPBMFCCM9T0SRAGYwfDmk=; b=pnIUqFb99ztJBpQ7d/6+NqzTQXu003bs/ITs77pk0LOgmqAEnna09zIT+K3CmXhyYq ASPhwM3z4lGY0gEI7h7K2baSjyHzpjZzxTjvtxIm70R9RtrKfn9dScMU+97bgda7F286 lGUWFFYo6PHjt5z/9JEjoLUjnHcwMs0yteXBvRNfggTG9pH17LT0pjDADu9vD5N4Hghu O4784EtYkZUIsDJMOLO48voIguQs4BaS/Y/dw0gUPaP6L0MlKiOeNVW1sEa8b10NEWbu d0e/nbxSg5JID4+kJhEGhN9tiitrItA+JdKVk++X26oXEz8w6ah3UMZWnVgaSkcpbTob pJUg== X-Forwarded-Encrypted: i=1; AJvYcCWX9EDcz+VmLhQkVX7OCOXoXcbbv75Vu4+4/jfLQBMv5JTd5SJMdoOlOkbC5o6E9oyJdjxTZ5oZY2naLGB4it7o9Ex4WLJU252mO2kk X-Gm-Message-State: AOJu0Yx5ddlW+6necti4FPi0p1qDeC7gpbuO+KRDrMgqKo6Oau8Mp/X4 Z+wW1bg1OHh8FatrCWj5ESfqL+7X5fxZqHXwGNN2eteew/ahO6/zb3u2ZkDvgv0= X-Received: by 2002:a19:ae1a:0:b0:515:b8d5:c5b7 with SMTP id f26-20020a19ae1a000000b00515b8d5c5b7mr167459lfc.56.1712687073914; Tue, 09 Apr 2024 11:24:33 -0700 (PDT) Received: from [172.30.205.99] (UNUSED.212-182-62-129.lubman.net.pl. [212.182.62.129]) by smtp.gmail.com with ESMTPSA id y18-20020a196412000000b00516ce0257a8sm1627709lfb.105.2024.04.09.11.24.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Apr 2024 11:24:33 -0700 (PDT) Message-ID: Date: Tue, 9 Apr 2024 20:24:31 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 05/19] media: venus: pm_helpers: Kill dead code To: Dikshita Agarwal , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , 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 References: <20230911-topic-mars-v3-0-79f23b81c261@linaro.org> <20230911-topic-mars-v3-5-79f23b81c261@linaro.org> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/5/24 09:49, Dikshita Agarwal wrote: > > > On 3/27/2024 11:38 PM, Konrad Dybcio wrote: >> 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 | 10 ---------- >> 1 file changed, 10 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c >> index ef4b0f0da36f..730c4b593cec 100644 >> --- a/drivers/media/platform/qcom/venus/pm_helpers.c >> +++ b/drivers/media/platform/qcom/venus/pm_helpers.c >> @@ -878,14 +878,10 @@ static int vcodec_domains_get(struct venus_core *core) >> .pd_flags = PD_FLAG_NO_DEV_LINK, >> }; >> >> - if (!res->vcodec_pmdomains_num) >> - goto skip_pmdomains; >> - > this condition should still be there to skip calling > dev_pm_domain_attach_list if vcodec_pmdomains_num is 0. That should be totally fine, within that function there's this bit if (num_pds <= 0) return 0; which bails out gracefully Konrad