From: =?utf-8?q?M=C3=A1rton=20N=C3=A9meth?= <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

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 <[email protected]>
Cc: Manu Abraham <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb/dvb-usb/az6027.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

---

http://git.linuxtv.org/v4l-dvb.git?a=commitdiff;h=2ca3dd80f8055e16927fe167b76ffeaa6c5030cc

diff --git a/drivers/media/dvb/dvb-usb/az6027.c 
b/drivers/media/dvb/dvb-usb/az6027.c
index d7290b2..27acbfb 100644
--- a/drivers/media/dvb/dvb-usb/az6027.c
+++ b/drivers/media/dvb/dvb-usb/az6027.c
@@ -976,17 +976,14 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, 
struct i2c_msg msg[], int n
                                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);
                        }
                }

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to