Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1644395lqg; Sun, 3 Mar 2024 21:41:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXRVric+OloDMpgpBBoSP1J2YXmMAnBcM/CnWtCl9/mt8jlB8GNZLn5S0Z+jIU7a2PGoDOcJQgkojUvT3EMDG2GNP8CipadKuzRntjhAw== X-Google-Smtp-Source: AGHT+IE01c3QbeM5e6wfSEHO69mYrbg+2KAueJepZdk77RKa1Oonvo4OH+OkiJglk1zj32VYx5lK X-Received: by 2002:a05:6358:7e99:b0:17a:d4c0:d59f with SMTP id o25-20020a0563587e9900b0017ad4c0d59fmr13266395rwn.4.1709530894564; Sun, 03 Mar 2024 21:41:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709530894; cv=pass; d=google.com; s=arc-20160816; b=berM3VFueInjqaiTSG6/ySelUE2LVeztdavpBSzQIbj6bS0TkMuvn7/9jCKZfG0cFQ qhJvoJeOuY7ql8GenBo380aMYYeq1So9NcUqIjEkf7RpgasYMHg0+uwFyw6iDB9opcD5 JhRGbxGEWl1LKaas1ZYjqm/Iqu/Xny0IrKAmlm4VEcNxGQCrG6T2krJfY81waTJN/JOg 2w/zrHhYNOcuaegP3zhtonP9ASoMtb3cTgqU4l0XAh42ubSYB24tE2NCF9+HDShApGpF URmP9jTMXJEOpewphhmhOmKqt2VTRD6jjTXkW536ypzZoTPEYzv9sXzKrYrcsL13HmmM KAHQ== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=bC9iBVAChzkURz7MLks8bBE/LC2FqLowzHb6mhD5U0o=; fh=l93zIHXyMEdGgv/YBnM8dl+iIeD4yDszaEdpnp/NB80=; b=hH07cZRwPP8qEUKZwJgYWRsupGvgPEbRHYTUjS6OTVpc89SILKq1qBZzXBqYhOdcaD mu1qlJgRBDBiDMl2GhELGzTkxrdQTiKV2oEgieyflv37KwrPWi2042tEFI6vYZMVuBkY GTFO5kBT4Nd9nxllJVG4Dw7vNntw+uKNsvVFX1lE7nyTwjVl9yV/nxS0JSW+tEVEYqxZ XXHKfcy/R1C1ks0UZM4rc+qplzYbsIiO++STmsWDjTWCgiopPvOZY8ny8OUltIuxWji6 S5qwj/fwCsKB9cfa0YH7KxA3NzjMeieh3vjnMozjR78GqP3n7gN8XR5OfA9XnyTERj81 8/TA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lMBGTcRo; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-90061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d22-20020a631d56000000b005dc788f3750si7749599pgm.465.2024.03.03.21.41.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 21:41:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lMBGTcRo; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-90061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 255BA281180 for ; Mon, 4 Mar 2024 05:41:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A08AFC133; Mon, 4 Mar 2024 05:41:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="lMBGTcRo" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 357D4AD5E; Mon, 4 Mar 2024 05:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709530883; cv=none; b=JhRjmk4D5luw1+tT7MkGFgblZKHzaveThTLssSi2F+00HsIeRLpJlomjX2IckXb3JLHcL1XtEgmN9bhp9ZI7B4iosX1tDP6Ew1pbxlWIddmdDYjtBc/4bas9SevutVRXN9KYUwZYroNwfS7enk4pHvgH8BY0A/NFmgJHBSgkVW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709530883; c=relaxed/simple; bh=r86wOO+DCKm7iBUKQXQCDVfjbm5Vx1zUufgM+XeeASw=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=igf3JTYkiERvWZkm6zpxbtpmGp/iJ2qAp4IbJ/scGR3JY39XXm6Wip0bdmMerds8cK7N6uUMgyb6LEFDSSkycPpyIaXG3lna3bvQ7eSaAs5MM9+Qr7l+5O3OjJTCaF1Mj/fBpGz0Pv4dMUZDbrWd1CMJorg9Dn9rNhdPNIfU+JU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=lMBGTcRo; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4245UWt3020204; Mon, 4 Mar 2024 05:41:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=bC9iBVAChzkURz7MLks8bBE/LC2FqLowzHb6mhD5U0o=; b=lM BGTcRoXHMqdpzQPdX2Io7bk648S4aWe/69Zac7oZIVliB3SpxgmZEUWDdo9NCQL1 c56ycjqcpwR72Lv7LMP+lEGN1fBbgsbVZvaX4LW4v8+LX2zqFZE0g+VLiHxx0lUu Hkj6ZwMx0Z3kxEj06sZVS5r/xo6sXZ/iyUX1slZfQNcba/PdTKD7dP6gpoFBp3W2 2ypvOaw+ssWuUs6mi31n9oyxq6B76+AhKZIrXFuxbdeAiJCoj10xfpLzLG5Vcyf4 ZlfqZVIrXFIMhqPDt/sMpz1RyxAEtXLOKmBqwI+lnFtqtV+oIYGJSEup2xS6nrIv 9eVlGE8yAwZN4LwlVXIg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wmsqnrxmg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Mar 2024 05:41:08 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4245f86v002787 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Mar 2024 05:41:08 GMT Received: from [10.50.22.179] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sun, 3 Mar 2024 21:41:03 -0800 Message-ID: <5e0656ac-badf-dd37-b598-8e4a6f23d2c2@quicinc.com> Date: Mon, 4 Mar 2024 11:10:52 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 05/20] media: venus: pm_helpers: Kill dead code Content-Language: en-US To: Konrad Dybcio , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , "Mauro Carvalho Chehab" , Philipp Zabel CC: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , , , References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> <20230911-topic-mars-v2-5-3dac84b88c4b@linaro.org> From: Dikshita Agarwal In-Reply-To: <20230911-topic-mars-v2-5-3dac84b88c4b@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: gk1jUqsTBhi5fYHR-XLQcXI0DNaTXove X-Proofpoint-GUID: gk1jUqsTBhi5fYHR-XLQcXI0DNaTXove X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-04_02,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 spamscore=0 impostorscore=0 clxscore=1011 mlxlogscore=999 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403040040 On 2/10/2024 2:39 AM, 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 1ba65345a5e2..7193075e8c04 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; > - Removing the if check and relying only on for loop is good. but I don't see the for loop here. > ret = dev_pm_domain_attach_list(dev, &vcodec_data, &core->pmdomains); > if (ret < 0) > return ret; > Also, what's the base of this change? I don't see above API in the code anywhere. > -skip_pmdomains: > if (!core->res->opp_pmdomain) > return 0; > > @@ -928,9 +924,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) > @@ -953,9 +946,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]); >