From patchwork Sat Jul 28 13:54:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jasmin J." X-Patchwork-Id: 10547983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B4D3139A for ; Sat, 28 Jul 2018 13:55:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82B392B300 for ; Sat, 28 Jul 2018 13:55:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76CB72B5C5; Sat, 28 Jul 2018 13:55:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 912682B5C3 for ; Sat, 28 Jul 2018 13:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbeG1PVl (ORCPT ); Sat, 28 Jul 2018 11:21:41 -0400 Received: from smtp.anw.at ([195.234.102.72]:32805 "EHLO smtp.anw.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728649AbeG1PVk (ORCPT ); Sat, 28 Jul 2018 11:21:40 -0400 Received: from hoppel.217.196.72.190 (anwhome.anw.at [195.234.103.23]) by smtp.anw.at (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w6SDsvdC022652; Sat, 28 Jul 2018 15:54:57 +0200 From: "Jasmin J." To: linux-media@vger.kernel.org Cc: mchehab+samsung@kernel.org, jasmin@anw.at, Jacopo Mondi Subject: [PATCH] media: i2c: fix warning in Aptina MT9V111 Date: Sat, 28 Jul 2018 15:54:49 +0200 Message-Id: <1532786089-15015-1-git-send-email-jasmin@anw.at> X-Mailer: git-send-email 2.7.4 X-Antivirus: checked in 0.014sec at smtp.anw.at ([195.234.102.72]) by smf-clamd v1.2.1 - http://smfs.sf.net/ Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jasmin Jessich This fixes the "'idx' may be used uninitialized in this function" warning. Cc: Jacopo Mondi Signed-off-by: Jasmin Jessich Acked-by: Jacopo Mondi --- drivers/media/i2c/mt9v111.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/mt9v111.c b/drivers/media/i2c/mt9v111.c index da8f6ab..58d5f22 100644 --- a/drivers/media/i2c/mt9v111.c +++ b/drivers/media/i2c/mt9v111.c @@ -884,7 +884,7 @@ static int mt9v111_set_format(struct v4l2_subdev *subdev, struct v4l2_mbus_framefmt new_fmt; struct v4l2_mbus_framefmt *__fmt; unsigned int best_fit = ~0L; - unsigned int idx; + unsigned int idx = 0; unsigned int i; mutex_lock(&mt9v111->stream_mutex);