From patchwork Wed Nov 10 10:59:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12611827 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69B53C433F5 for ; Wed, 10 Nov 2021 10:59:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52B1861078 for ; Wed, 10 Nov 2021 10:59:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231360AbhKJLCA (ORCPT ); Wed, 10 Nov 2021 06:02:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:38748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231248AbhKJLB7 (ORCPT ); Wed, 10 Nov 2021 06:01:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 55276611BF; Wed, 10 Nov 2021 10:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636541952; bh=5TIG1BRWAdpzcni9lSwygVrJFoLLUWjoMyvM0Rtg+Ro=; h=From:To:Cc:Subject:Date:From; b=WsAyqdyKsc1yI/6YFYo2V/W7+NfjKeqsU3tQudqBOKv4ExGPL1Riz57Xee5R+g/lB vu/D3/3884Wsr/KY0m2o2/kTmHFZS2TIcEzeot0R+LW4aqjAay5I5j5rnleALgouCS 6w+2fxyFx8Dsu/nk0kvdBHXoLhkKIve/n1cgPJErRwO3yrchQg6eTiaxMIPbJT/MoH e+tQ32PxVScuB7rdsTi0a/jJED5LgLVjoWfUkLYV1vERNwrHrgrVCpgoY6QKhrk5jV Gsvpt1XIz44LQ+5P1PUN/CfyO00N6LzqA+6rQyV3S90PUQ5m7HtPCsUpCd2lJbPccv OBM7rznI6CNaw== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mklJt-002rxD-8E; Wed, 10 Nov 2021 10:59:09 +0000 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Deepak R Varma , Greg Kroah-Hartman , Hans Verkuil , Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Tomi Valkeinen , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, Hans Verkuil Subject: [PATCH 1/2] media: atomisp-ov2680: initialize return var Date: Wed, 10 Nov 2021 10:59:07 +0000 Message-Id: <46ec939d911fc94b8a5e217874655e60512ad773.1636541941.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org As the settings are only applied when the device is powered on, it should return 0 when the device is not powered. Not doing that causes a warning: drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function 'ov2680_ioctl': drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:390:16: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] 390 | return ov2680_set_exposure(sd, coarse_itg, analog_gain, digital_gain); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:359:13: note: 'ret' was declared here 359 | int ret; | ^~~ Reported-by: Hans Verkuil Cc: Hans de Goede Fixes: 6b5b60687ada ("media: atomisp-ov2680: Save/restore exposure and gain over sensor power-down") Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Hans de Goede --- drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 34d008236bd9..497884d332e1 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -356,7 +356,7 @@ static int ov2680_set_exposure(struct v4l2_subdev *sd, int exposure, int gain, int digitgain) { struct ov2680_device *dev = to_ov2680_sensor(sd); - int ret; + int ret = 0; mutex_lock(&dev->input_lock);