All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Németh Márton" <nm127@freemail.hu>
To: Adams Xu <Adams.xu@azwave.com.cn>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	V4L Mailing List <linux-media@vger.kernel.org>
Subject: [PATCH] az6027: remove redundant condition check
Date: Mon, 01 Mar 2010 08:10:52 +0100	[thread overview]
Message-ID: <4B8B687C.4090306@freemail.hu> (raw)
In-Reply-To: <4B8B6853.3050801@freemail.hu>

From: Márton Németh <nm127@freemail.hu>

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 <nm127@freemail.hu>
---
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);
 			}
 		}


      reply	other threads:[~2010-03-01  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-28 19:49 [cron job] v4l-dvb daily build 2.6.22 and up: ERRORS, 2.6.16-2.6.21: ERRORS Hans Verkuil
2010-03-01  7:10 ` az6027: variables may be used uninitialized in az6027_i2c_xfer() Németh Márton
2010-03-01  7:10   ` Németh Márton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B8B687C.4090306@freemail.hu \
    --to=nm127@freemail.hu \
    --cc=Adams.xu@azwave.com.cn \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.