Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp363008pxh; Wed, 10 Nov 2021 03:03:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+QG1ry3UujL9Hqa5u0tXymp58mrmUfYg6PJcZ/KIsIYE7YweR21B8/82R37KMKwgV7ps2 X-Received: by 2002:a17:907:1629:: with SMTP id hb41mr20436038ejc.328.1636542212012; Wed, 10 Nov 2021 03:03:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636542212; cv=none; d=google.com; s=arc-20160816; b=HTj36Lg4sABjH87WDRJQ/gl5wVnQCtPa9khn2KDhm7GG/S2xwAEXSlf2UZR/wNkVUm kv6AkXx3agMHIrZHe+R4HbJbnm0bM7JCit7OoplJdMOFkLiOvf+EXO9cDvHlXA/9WxRn ga66B3/sqeb2IhpqJTTl8hYrcgy8xzE0pBdC7sGihw4vXyyuSQj9uEA1AGs8GJppHyrT jhF6ezoRQ41e9tWsvM3n38Xd67OG+QhtUH507hsYq1s+M84/EEnJEbORUYtflbSri71C oo2V3IiLU9ynZiyVnHljuQ45Sijsmj0Z87/1C5oJG8Mjx/MPxl9DgrZ3+1uIBgRguIpE FlSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=+gNprOzlRe/wyUkafKRDeKGhYsyXtn2PxThZpioktAE=; b=xDavqHasW2BSMeKZiQxkIbaphJR0MjOtOZDD4I9OCQtHe+K/+xvdj71rjBAp/6CQtt SELNLXfUJoY3sqFCDXaAZibRzE1FtlPVWmO2BVQh8S/anmNzeUMDR8CeHIj4+lezMZaC +/omfyqyht9bcD4LxYiN9PurcyrFC1ODkaP5MiHvejlNI/Bk4sdS1XjUMFq/p1hwdeTU i+satC+S1l86CKyIzSjUsyvO1pGYQzErDvUhnb0O9Y4EtWHMKnzaaXMkUlX0P+UiMpfy PwxOVWtcH6idLiTU7NbebrxAFbGjw+pYqhJeoM2B/UJTONRXM1aTR0nxMf/VBy9mRGtC 2/HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=WsAyqdyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ji6si30856039ejc.168.2021.11.10.03.03.08; Wed, 10 Nov 2021 03:03:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=WsAyqdyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231329AbhKJLCA (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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); -- 2.33.1