From patchwork Tue Dec 5 14:37:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10093037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFE7860327 for ; Tue, 5 Dec 2017 14:37:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A43F0288ED for ; Tue, 5 Dec 2017 14:37:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 979282895A; Tue, 5 Dec 2017 14:37:59 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 0A9E4288ED for ; Tue, 5 Dec 2017 14:37:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997AbdLEOhz (ORCPT ); Tue, 5 Dec 2017 09:37:55 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:48050 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752994AbdLEOhx (ORCPT ); Tue, 5 Dec 2017 09:37:53 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.21/8.16.0.21) with SMTP id vB5EaqbQ184654; Tue, 5 Dec 2017 14:37:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=V8BKkPUYyuI1vDci90sRsFqAYx1QkEVZxz2C7mijzGM=; b=fe9KRgbaY+PkVfEjUJo0ew/UNNLQWEDpAfNAkwy3EvzDyIo0cDacDo3AqBZCCFZnRx9H WqhAj08R+6v4ZbK0tv9+zRytOIBfU2TwKy4Gk7gdHPkS4Pj034TACOq2qL67VKuzKR0T Rz/wPdT28NnE4J+RZ/q0YxZj6+0/VvPzrj4w9Jc/G8LfEBpcSudocEUHM6PDXoxAAzSt 86vBUFVOeaYa9H9R4gZF8s+4Xz04S5HbdqNFcgKOk10+yzY1TdUpiwSRBxyDJsi5i2ym 1OxD/dDS4jgle5XZt9U/SnKFuB20wlH024vqcsOC/bdQ2CHiW54Z+8B6xuLNjioNOnfp Kg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2enc4rar6q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Dec 2017 14:37:48 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vB5EblHi022521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Dec 2017 14:37:47 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vB5EbkaY013215; Tue, 5 Dec 2017 14:37:46 GMT Received: from mwanda (/197.157.0.30) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 Dec 2017 06:37:46 -0800 Date: Tue, 5 Dec 2017 17:37:39 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab , Leon Luo Cc: Sakari Ailus , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] media: imx274: Silence uninitialized variable warning Message-ID: <20171205143739.uoct55nitjrt4xun@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8735 signatures=668637 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712050211 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 Smatch complains that "err" can be uninitialized if we have a zero size write. The flow analysis is a little complicated so I'm not sure if that's possible or not, but it's harmless to set this to zero and it makes the code easier to read. Signed-off-by: Dan Carpenter diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index 800b9bf9cdd3..e7c12933cfd2 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -634,7 +634,7 @@ static int imx274_regmap_util_write_table_8(struct regmap *regmap, const struct reg_8 table[], u16 wait_ms_addr, u16 end_addr) { - int err; + int err = 0; const struct reg_8 *next; u8 val;