Skip to contentSkip to conversation

v4l: 790: added support for terratec cinergy 250 usb

PATCH Dan Carpenter 1 participant 1 message Apr 21, 2016 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hello Markus Rechberger,

The patch e43f14af1439: "[PATCH] v4l: 790: added support for terratec cinergy 250 usb" from Nov 8, 2005, leads to the following static checker warning:

	drivers/media/usb/em28xx/em28xx-input.c:307 em28xx_i2c_ir_handle_key()
	error: uninitialized symbol 'protocol'.

drivers/media/usb/em28xx/em28xx-input.c

    84  static int em28xx_get_key_terratec(struct i2c_client *i2c_dev,
    85                                     enum rc_type *protocol, u32 *scancode)
    86  {
    87          unsigned char b;
    88  
    89          /* poll IR chip */
    90          if (1 != i2c_master_recv(i2c_dev, &b, 1))
    91                  return -EIO;
    92  
    93          /* it seems that 0xFE indicates that a button is still hold
    94             down, while 0xff indicates that no button is hold down. */
    95  
    96          if (b == 0xff)
    97                  return 0;
    98  
    99          if (b == 0xfe)

100 /* keep old data */
101 return 1;

This is only called from em28xx_i2c_ir_handle_key() and the "old data" is uninitialized garbage.

   102  
   103          *protocol = RC_TYPE_UNKNOWN;
   104          *scancode = b;
   105          return 1;
   106  }

regards,
dan carpenter