From patchwork Mon Mar 1 07:10:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOpbWV0aCBNw6FydG9u?= X-Patchwork-Id: 2862 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Mon, 01 Mar 2010 07:10:56 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Mon, 01 Mar 2010 10:29:31 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NlzmK-0003vX-Ef; Mon, 01 Mar 2010 07:10:56 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751176Ab0CAHKz (ORCPT + 1 other); Mon, 1 Mar 2010 02:10:55 -0500 Received: from relay01.digicable.hu ([92.249.128.189]:56377 "EHLO relay01.digicable.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139Ab0CAHKz (ORCPT ); Mon, 1 Mar 2010 02:10:55 -0500 Received: from [78.131.104.169] by relay01.digicable.hu with esmtpa id 1NlzmH-00023S-Vu ; Mon, 01 Mar 2010 08:10:54 +0100 Message-ID: <4B8B687C.4090306@freemail.hu> Date: Mon, 01 Mar 2010 08:10:52 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Adams Xu CC: Hans Verkuil , V4L Mailing List Subject: [PATCH] az6027: remove redundant condition check References: <201002281949.o1SJnGO7064642@smtp-vbr12.xs4all.nl> <4B8B6853.3050801@freemail.hu> In-Reply-To: <4B8B6853.3050801@freemail.hu> X-Original: 78.131.104.169 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Márton Németh The condition (msg[i].addr == 0xd0) is checked twice the second one is not necessary. This will remove the following compiler warning: az6027.c: In function 'az6027_i2c_xfer': az6027.c:942: warning: 'index' may be used uninitialized in this function az6027.c:943: warning: 'value' may be used uninitialized in this function az6027.c:944: warning: 'length' may be used uninitialized in this function az6027.c:945: warning: 'req' may be used uninitialized in this function Signed-off-by: Márton Németh --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r 37581bb7e6f1 linux/drivers/media/dvb/dvb-usb/az6027.c --- a/linux/drivers/media/dvb/dvb-usb/az6027.c Wed Feb 24 22:48:50 2010 -0300 +++ b/linux/drivers/media/dvb/dvb-usb/az6027.c Mon Mar 01 08:09:35 2010 +0100 @@ -976,17 +976,14 @@ i++; } else { - if (msg[i].addr == 0xd0) { - /* demod 16bit addr */ - req = 0xBD; - index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff)); - value = msg[i].addr + (2 << 8); - length = msg[i].len - 2; - len = msg[i].len - 2; - for (j = 0; j < len; j++) - data[j] = msg[i].buf[j + 2]; - - } + /* demod 16bit addr */ + req = 0xBD; + index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff)); + value = msg[i].addr + (2 << 8); + length = msg[i].len - 2; + len = msg[i].len - 2; + for (j = 0; j < len; j++) + data[j] = msg[i].buf[j + 2]; az6027_usb_out_op(d, req, value, index, data, length); } }