Em 04-07-2012 05:08, Du, Changbin escreveu:
changes:
1. break some lines that are longer than 80 characters.
2. remove local function prototype declarations which do not
need.
3. replace TAB character with a space character in function
comments.
4. change the types of array init1[] and init2[] to
unsigned char to avoid compile warning.
Signed-off-by: Du, Changbin changbin...@gmail.com
---
drivers/media/rc/ati_remote.c | 139
+
1 file changed, 84 insertions(+), 55 deletions(-)
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 7be377f..0df66ac 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -23,6 +23,8 @@
*Vincent Vanackere vanack...@lif.univ-mrs.fr
*Added support for the Lola remote contributed by:
*Seth Cohn sethc...@yahoo.com
+ * Jul 2012: Du, Changbin changbin...@gmail.com
+ *Code style and compile warning fixing
You shouldn't be changing the driver's authorship just due to codingstyle
and warning fixes. Btw, Please split Coding Style form Compilation warnings,
as they're two different matters.
Thanks!
Mauro
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
*
@@ -147,7 +149,8 @@ static bool mouse = true;
module_param(mouse, bool, 0444);
MODULE_PARM_DESC(mouse, Enable mouse device, default = yes);
-#define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format
, ## arg); } while (0)
+#define dbginfo(dev, format, arg...) \
+ do { if (debug) dev_info(dev , format , ## arg); } while (0)
#undef err
#define err(format, arg...) printk(KERN_ERR format , ## arg)
@@ -191,17 +194,41 @@ static const char *get_medion_keymap(struct
usb_interface *interface)
return RC_MAP_MEDION_X10;
}
-static const struct ati_receiver_type type_ati = {
.default_keymap
= RC_MAP_ATI_X10 };
-static const struct ati_receiver_type type_medion= {
.get_default_keymap = get_medion_keymap };
-static const struct ati_receiver_type type_firefly = { .default_keymap
= RC_MAP_SNAPSTREAM_FIREFLY };
+static const struct ati_receiver_type type_ati = {
+ .default_keymap = RC_MAP_ATI_X10
+};
+static const struct ati_receiver_type type_medion= {
+ .get_default_keymap = get_medion_keymap
+};
+static const struct ati_receiver_type type_firefly = {
+ .default_keymap = RC_MAP_SNAPSTREAM_FIREFLY
+};
static struct usb_device_id ati_remote_table[] = {
- { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID),
.driver_info = (unsigned long)type_ati },
- { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID),
.driver_info = (unsigned long)type_ati },
- { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID),
.driver_info = (unsigned long)type_ati },
- { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID),
.driver_info = (unsigned long)type_ati },
- { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID),
.driver_info = (unsigned long)type_medion },
- { USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID),
.driver_info = (unsigned long)type_firefly },
+ {
+ USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID),
+ .driver_info = (unsigned long)type_ati
+ },
+ {
+ USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID),
+ .driver_info = (unsigned long)type_ati
+ },
+ {
+ USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID),
+ .driver_info = (unsigned long)type_ati
+ },
+ {
+ USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID),
+ .driver_info = (unsigned long)type_ati
+ },
+ {
+ USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID),
+ .driver_info = (unsigned long)type_medion
+ },
+ {
+ USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID),
+ .driver_info = (unsigned long)type_firefly
+ },
{} /* Terminating entry */
};
@@ -215,8 +242,8 @@ MODULE_DEVICE_TABLE(usb, ati_remote_table);
#define SEND_FLAG_COMPLETE 2
/* Device initialization strings */
-static char init1[] = { 0x01, 0x00, 0x20, 0x14 };
-static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };
+static unsigned char init1[] = { 0x01, 0x00, 0x20, 0x14 };
+static unsigned char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20
};
struct ati_remote {
struct input_dev *idev;
@@ -296,25 +323,8 @@ static const struct {
{KIND_END, 0x00, EV_MAX + 1, 0, 0}
};
-/* Local function prototypes */
-static int ati_remote_sendpacket (struct ati_remote *ati_remote, u16
cmd, unsigned char *data);
-static void