Re: [Resend PATCH] media: rc: ati_remote.c: code style and compile warning fixing
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
Re: [Resend PATCH] media: rc: ati_remote.c: code style and compile warning fixing
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. Sorry, I didn't know this rule. I just want to make a track for me. OK, I will resend this patch and remove me from it. BTW, I am looking for something to learn these basic rules when sending patches. Could you tell me where I can find it? Many thanks! [Du, Changbin] Thanks! Mauro -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Resend PATCH] media: rc: ati_remote.c: code style and compile warning fixing
Em 06-07-2012 22:49, Du Changbin escreveu: 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. Sorry, I didn't know this rule. I just want to make a track for me. OK, I will resend this patch and remove me from it. BTW, I am looking for something to learn these basic rules when sending patches. Could you tell me where I can find it? There are some rules at linuxtv wiki pages, others at the Kernel Documentation dir and other not so explicit rules like the above that you'll get as you continue contributing ;) In opposite to other open source projects, the contribution history is the git logs, and not inside the comments at the source code. Many thanks! [Du, Changbin] Thanks, Mauro -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[Resend PATCH] media: rc: ati_remote.c: code style and compile warning fixing
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -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 ati_remote_irq_out (struct urb *urb); -static void ati_remote_irq_in (struct urb *urb); -static void ati_remote_input_report(struct urb *urb); -static int ati_remote_initialize (struct ati_remote *ati_remote); -static int ati_remote_probe(struct usb_interface *interface,