Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp715932pxm; Fri, 25 Feb 2022 18:08:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzj4ruE5EmtPg9J8HSzwj80t1nFanVo6lr6KFxIOFv1fwpt2Xq/kfNukFWn4uJwYfzyM7Nd X-Received: by 2002:a05:6a02:18b:b0:362:c8e4:d8f4 with SMTP id bj11-20020a056a02018b00b00362c8e4d8f4mr8441774pgb.86.1645841293862; Fri, 25 Feb 2022 18:08:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645841293; cv=none; d=google.com; s=arc-20160816; b=qLa1pn1omIDzKbO+kFLkmC+InjzRNF8LYnAYkZ5erg+TOd5+W1QgUoVG7jK9COQXbH 6qw0UoSacp+hBmyroOpAvx2RF3rutWedoXTlqcoeGsqfpkkJ/VuBe9QuW1uJjRhDEB39 eP1W78aUu0wK0Wa69/ix/WfL3Uq5gTHzlTm7T3sKnMY1NmGbRFu2ED6ypJtS0XMU0AVU 8Ljs3/s4X/IGgoFwetq5VRGyhxoZ2C97kwAEUOAvbt9VXZONsu9GP8Fdb/UstR2POgB0 XUWN242N3SY78iIRgKwRQP5iydFYFEKS/lKpSmM1NjPCuK2hZ9mJzckSeahxFWv523mY 9Rgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=YT1w2AZLnASwpm6CED0EAySuUj+jSdU+E0jhV6FVmcg=; b=QJEig39s6LY3KJBJ9qDEu+uuErQRg5i2pRo02ZjsRT/JHa8/PKPmS3lpwNSzSpf57u iw0gpU1OT6pDRLe9p4sScfq+6cTDf6GCqCf3vk6TdcE9Y96FAZa6XFHkBpOGjfNFWtjs AeRZuVW8M63UgRRcI9tWFUt5ULSRcduk9yHUQ/9R70h/zsBo6gzXvxHi2F14ydjersjp 5mDn/0vQJb4v2pzEmO43uIiCKbwqChMdw6IwRLTPA1JDgjulctNcKXyu0Z/4h9x7WQws 0mHy9DFqF8MWQkilKDxYZj9ng58cRg3v2K9U8YKYFLoQHDZ7OTIDhdDfFxW8OFcWXvoS ekUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XSq27hNW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mt4-20020a17090b230400b001bc64e7c0f3si3376867pjb.23.2022.02.25.18.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:08:13 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XSq27hNW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 746372AF155; Fri, 25 Feb 2022 17:46:24 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243930AbiBYRl5 (ORCPT + 99 others); Fri, 25 Feb 2022 12:41:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbiBYRlz (ORCPT ); Fri, 25 Feb 2022 12:41:55 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D6001EBA98; Fri, 25 Feb 2022 09:41:23 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: usama.anjum) with ESMTPSA id B90521F46598 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1645810882; bh=g0A6Uimeahydl9ph1AOCmp+Nlt9LsBikz3PaHAbqQik=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=XSq27hNWEmg+dff4RWcqF8uRjKG41+rebGEt6dY+bVLIfhgB+/s8dF0ew02+wVCdk ImnWiIpzlCJ2dwbhkJdxIVhdOijT52QuSb0hQJi8SKJ5CN+WUN453G3UGp+tGrPfyp KKJbcfr6e/bm5/DN4G7Y2UhloQAFDkuHGRT9+N7HQL1EdvBvfXIB5nz2WcC57NZG1r eIRkDZpyCmBVQeSR1lRZff/YAu8P35X3CZAa7P4t1TW91vN0F6512w52raITKS7uoY 0Iz3cf7kzwuuAfx4xe2DOoYXIfQ3mge13nLFrPSsrc+/boy69ArNkgOCz1V7iMWFmF O5BFwY9hygLXg== Message-ID: <98ef3e84-e17e-d1b9-5109-ec631d77905e@collabora.com> Date: Fri, 25 Feb 2022 22:41:14 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Cc: usama.anjum@collabora.com, kernel@collabora.com, kernel-janitors@vger.kernel.org Subject: Re: [PATCH V2] media: imx: imx8mq-mipi_csi2: Remove unneeded code Content-Language: en-US To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , "open list:MEDIA DRIVERS FOR FREESCALE IMX" , "open list:STAGING SUBSYSTEM" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , open list , mkl@pengutronix.de, Hans Verkuil References: <20220128170722.1624767-1-usama.anjum@collabora.com> From: Muhammad Usama Anjum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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 From: https://patchwork.linuxtv.org/project/linux-media/patch/20220128170722.1624767-1-usama.anjum@collabora.com/ State Under Review Delegated to: Hans Verkuil On 2/18/22 4:08 PM, Muhammad Usama Anjum wrote: > Reminder. > > On 1/28/22 10:07 PM, Muhammad Usama Anjum wrote: >> ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot >> return error. Remove the return variable. Simplify other functions which >> are using this function. >> >> Signed-off-by: Muhammad Usama Anjum >> --- >> Changes in V2: >> Removed fixes tag >> --- >> drivers/staging/media/imx/imx8mq-mipi-csi2.c | 16 ++++------------ >> 1 file changed, 4 insertions(+), 12 deletions(-) >> >> diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c >> index 3b9fa75efac6b..c992b845e63d1 100644 >> --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c >> +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c >> @@ -693,11 +693,10 @@ static int imx8mq_mipi_csi_async_register(struct csi_state *state) >> * Suspend/resume >> */ >> >> -static int imx8mq_mipi_csi_pm_suspend(struct device *dev) >> +static void imx8mq_mipi_csi_pm_suspend(struct device *dev) >> { >> struct v4l2_subdev *sd = dev_get_drvdata(dev); >> struct csi_state *state = mipi_sd_to_csi2_state(sd); >> - int ret = 0; >> >> mutex_lock(&state->lock); >> >> @@ -708,8 +707,6 @@ static int imx8mq_mipi_csi_pm_suspend(struct device *dev) >> } >> >> mutex_unlock(&state->lock); >> - >> - return ret ? -EAGAIN : 0; >> } >> >> static int imx8mq_mipi_csi_pm_resume(struct device *dev) >> @@ -742,15 +739,12 @@ static int __maybe_unused imx8mq_mipi_csi_suspend(struct device *dev) >> { >> struct v4l2_subdev *sd = dev_get_drvdata(dev); >> struct csi_state *state = mipi_sd_to_csi2_state(sd); >> - int ret; >> >> - ret = imx8mq_mipi_csi_pm_suspend(dev); >> - if (ret) >> - return ret; >> + imx8mq_mipi_csi_pm_suspend(dev); >> >> state->state |= ST_SUSPENDED; >> >> - return ret; >> + return 0; >> } >> >> static int __maybe_unused imx8mq_mipi_csi_resume(struct device *dev) >> @@ -770,9 +764,7 @@ static int __maybe_unused imx8mq_mipi_csi_runtime_suspend(struct device *dev) >> struct csi_state *state = mipi_sd_to_csi2_state(sd); >> int ret; >> >> - ret = imx8mq_mipi_csi_pm_suspend(dev); >> - if (ret) >> - return ret; >> + imx8mq_mipi_csi_pm_suspend(dev); >> >> ret = icc_set_bw(state->icc_path, 0, 0); >> if (ret)