Re: [PATCHv2 11/11] si4713: coding style cleanups
Em Fri, 6 Dec 2013 11:17:14 +0100 Hans Verkuil hverk...@xs4all.nl escreveu: From: Hans Verkuil hans.verk...@cisco.com Fix most checkpatch errors/warnings. It's mostly whitespace changes, except for replacing msleep with usleep_range and the jiffies comparison with time_is_after_jiffies(). Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/radio/si4713/radio-usb-si4713.c | 4 +- drivers/media/radio/si4713/si4713.c | 104 +- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index d978844..691e487 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -207,7 +207,7 @@ static int si4713_send_startup_command(struct si4713_usb_device *radio) } if (time_is_before_jiffies(until_jiffies)) return -EIO; - msleep(3); + usleep_range(3000, 5000); } return retval; @@ -354,7 +354,7 @@ static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len) data[0] = 0; return 0; } - msleep(3); + usleep_range(3000, 5000); } } diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 6f28a2b..451b9c0 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c @@ -50,12 +50,12 @@ MODULE_VERSION(0.0.1); #define DEFAULT_RDS_PS_REPEAT_COUNT 0x0003 #define DEFAULT_LIMITER_RTIME0x1392 #define DEFAULT_LIMITER_DEV 0x102CA -#define DEFAULT_PILOT_FREQUENCY 0x4A38 +#define DEFAULT_PILOT_FREQUENCY 0x4A38 #define DEFAULT_PILOT_DEVIATION 0x1A5E #define DEFAULT_ACOMP_ATIME 0x #define DEFAULT_ACOMP_RTIME 0xF4240L #define DEFAULT_ACOMP_GAIN 0x0F -#define DEFAULT_ACOMP_THRESHOLD (-0x28) +#define DEFAULT_ACOMP_THRESHOLD (-0x28) #define DEFAULT_MUTE 0x01 #define DEFAULT_POWER_LEVEL 88 #define DEFAULT_FREQUENCY8800 @@ -252,8 +252,8 @@ static int si4713_send_command(struct si4713_device *sdev, const u8 command, if (client-irq) return -EBUSY; - msleep(1); - } while (jiffies = until_jiffies); + usleep_range(1000, 2000); + } while (time_is_after_jiffies(until_jiffies)); Condition seems to be wrong here: it should be time_is_before_jiffies(). Also, the better is to put this on a separate patch. return -EBUSY; } @@ -269,9 +269,9 @@ static int si4713_read_property(struct si4713_device *sdev, u16 prop, u32 *pv) int err; u8 val[SI4713_GET_PROP_NRESP]; /* - * .First byte = 0 - * .Second byte = property's MSB - * .Third byte = property's LSB + * .First byte = 0 + * .Second byte = property's MSB + * .Third byte = property's LSB */ const u8 args[SI4713_GET_PROP_NARGS] = { 0x00, @@ -306,11 +306,11 @@ static int si4713_write_property(struct si4713_device *sdev, u16 prop, u16 val) int rval; u8 resp[SI4713_SET_PROP_NRESP]; /* - * .First byte = 0 - * .Second byte = property's MSB - * .Third byte = property's LSB - * .Fourth byte = value's MSB - * .Fifth byte = value's LSB + * .First byte = 0 + * .Second byte = property's MSB + * .Third byte = property's LSB + * .Fourth byte = value's MSB + * .Fifth byte = value's LSB */ const u8 args[SI4713_SET_PROP_NARGS] = { 0x00, @@ -352,8 +352,8 @@ static int si4713_powerup(struct si4713_device *sdev) int err; u8 resp[SI4713_PWUP_NRESP]; /* - * .First byte = Enabled interrupts and boot function - * .Second byte = Input operation mode + * .First byte = Enabled interrupts and boot function + * .Second byte = Input operation mode */ u8 args[SI4713_PWUP_NARGS] = { SI4713_PWUP_GPO2OEN | SI4713_PWUP_FUNC_TX, @@ -505,18 +505,18 @@ static int si4713_wait_stc(struct si4713_device *sdev, const int usecs) } if (jiffies_to_usecs(jiffies - start_jiffies) usecs) return err 0 ? err : -EIO; - /* We sleep here for 3 ms in order to avoid flooding the device + /* We sleep here for 3-4 ms in order to avoid flooding the device * with USB requests. The si4713 USB driver was developed * by reverse engineering the Windows USB driver. The windows * driver also has a
Re: [PATCHv2 11/11] si4713: coding style cleanups
On 12/09/2013 04:51 PM, Mauro Carvalho Chehab wrote: Em Fri, 6 Dec 2013 11:17:14 +0100 Hans Verkuil hverk...@xs4all.nl escreveu: From: Hans Verkuil hans.verk...@cisco.com Fix most checkpatch errors/warnings. It's mostly whitespace changes, except for replacing msleep with usleep_range and the jiffies comparison with time_is_after_jiffies(). Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/radio/si4713/radio-usb-si4713.c | 4 +- drivers/media/radio/si4713/si4713.c | 104 +- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index d978844..691e487 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -207,7 +207,7 @@ static int si4713_send_startup_command(struct si4713_usb_device *radio) } if (time_is_before_jiffies(until_jiffies)) return -EIO; -msleep(3); +usleep_range(3000, 5000); } return retval; @@ -354,7 +354,7 @@ static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len) data[0] = 0; return 0; } -msleep(3); +usleep_range(3000, 5000); } } diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 6f28a2b..451b9c0 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c @@ -50,12 +50,12 @@ MODULE_VERSION(0.0.1); #define DEFAULT_RDS_PS_REPEAT_COUNT 0x0003 #define DEFAULT_LIMITER_RTIME 0x1392 #define DEFAULT_LIMITER_DEV 0x102CA -#define DEFAULT_PILOT_FREQUENCY 0x4A38 +#define DEFAULT_PILOT_FREQUENCY 0x4A38 #define DEFAULT_PILOT_DEVIATION 0x1A5E #define DEFAULT_ACOMP_ATIME 0x #define DEFAULT_ACOMP_RTIME 0xF4240L #define DEFAULT_ACOMP_GAIN 0x0F -#define DEFAULT_ACOMP_THRESHOLD (-0x28) +#define DEFAULT_ACOMP_THRESHOLD (-0x28) #define DEFAULT_MUTE0x01 #define DEFAULT_POWER_LEVEL 88 #define DEFAULT_FREQUENCY 8800 @@ -252,8 +252,8 @@ static int si4713_send_command(struct si4713_device *sdev, const u8 command, if (client-irq) return -EBUSY; -msleep(1); -} while (jiffies = until_jiffies); +usleep_range(1000, 2000); +} while (time_is_after_jiffies(until_jiffies)); Condition seems to be wrong here: it should be time_is_before_jiffies(). No, the condition is good. 'time_is_after_jiffies(until_jiffies)' means 'until_jiffies jiffies' which is 'jiffies = until_jiffies'. Also, the better is to put this on a separate patch. OK. Regards, Hans -- 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: [PATCHv2 11/11] si4713: coding style cleanups
Em Mon, 09 Dec 2013 17:17:41 +0100 Hans Verkuil hverk...@xs4all.nl escreveu: On 12/09/2013 04:51 PM, Mauro Carvalho Chehab wrote: Em Fri, 6 Dec 2013 11:17:14 +0100 Hans Verkuil hverk...@xs4all.nl escreveu: From: Hans Verkuil hans.verk...@cisco.com Fix most checkpatch errors/warnings. It's mostly whitespace changes, except for replacing msleep with usleep_range and the jiffies comparison with time_is_after_jiffies(). Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/radio/si4713/radio-usb-si4713.c | 4 +- drivers/media/radio/si4713/si4713.c | 104 +- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index d978844..691e487 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -207,7 +207,7 @@ static int si4713_send_startup_command(struct si4713_usb_device *radio) } if (time_is_before_jiffies(until_jiffies)) return -EIO; - msleep(3); + usleep_range(3000, 5000); } return retval; @@ -354,7 +354,7 @@ static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len) data[0] = 0; return 0; } - msleep(3); + usleep_range(3000, 5000); } } diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 6f28a2b..451b9c0 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c @@ -50,12 +50,12 @@ MODULE_VERSION(0.0.1); #define DEFAULT_RDS_PS_REPEAT_COUNT 0x0003 #define DEFAULT_LIMITER_RTIME 0x1392 #define DEFAULT_LIMITER_DEV 0x102CA -#define DEFAULT_PILOT_FREQUENCY 0x4A38 +#define DEFAULT_PILOT_FREQUENCY 0x4A38 #define DEFAULT_PILOT_DEVIATION 0x1A5E #define DEFAULT_ACOMP_ATIME 0x #define DEFAULT_ACOMP_RTIME 0xF4240L #define DEFAULT_ACOMP_GAIN0x0F -#define DEFAULT_ACOMP_THRESHOLD (-0x28) +#define DEFAULT_ACOMP_THRESHOLD (-0x28) #define DEFAULT_MUTE 0x01 #define DEFAULT_POWER_LEVEL 88 #define DEFAULT_FREQUENCY 8800 @@ -252,8 +252,8 @@ static int si4713_send_command(struct si4713_device *sdev, const u8 command, if (client-irq) return -EBUSY; - msleep(1); - } while (jiffies = until_jiffies); + usleep_range(1000, 2000); + } while (time_is_after_jiffies(until_jiffies)); Condition seems to be wrong here: it should be time_is_before_jiffies(). No, the condition is good. 'time_is_after_jiffies(until_jiffies)' means 'until_jiffies jiffies' which is 'jiffies = until_jiffies'. Ah, yeah, this one is correct. Those macro names sound a little confusing :) Also, the better is to put this on a separate patch. OK. Regards, Hans -- Cheers, 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
[PATCHv2 11/11] si4713: coding style cleanups
From: Hans Verkuil hans.verk...@cisco.com Fix most checkpatch errors/warnings. It's mostly whitespace changes, except for replacing msleep with usleep_range and the jiffies comparison with time_is_after_jiffies(). Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/radio/si4713/radio-usb-si4713.c | 4 +- drivers/media/radio/si4713/si4713.c | 104 +- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index d978844..691e487 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -207,7 +207,7 @@ static int si4713_send_startup_command(struct si4713_usb_device *radio) } if (time_is_before_jiffies(until_jiffies)) return -EIO; - msleep(3); + usleep_range(3000, 5000); } return retval; @@ -354,7 +354,7 @@ static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len) data[0] = 0; return 0; } - msleep(3); + usleep_range(3000, 5000); } } diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 6f28a2b..451b9c0 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c @@ -50,12 +50,12 @@ MODULE_VERSION(0.0.1); #define DEFAULT_RDS_PS_REPEAT_COUNT0x0003 #define DEFAULT_LIMITER_RTIME 0x1392 #define DEFAULT_LIMITER_DEV0x102CA -#define DEFAULT_PILOT_FREQUENCY0x4A38 +#define DEFAULT_PILOT_FREQUENCY0x4A38 #define DEFAULT_PILOT_DEVIATION0x1A5E #define DEFAULT_ACOMP_ATIME0x #define DEFAULT_ACOMP_RTIME0xF4240L #define DEFAULT_ACOMP_GAIN 0x0F -#define DEFAULT_ACOMP_THRESHOLD(-0x28) +#define DEFAULT_ACOMP_THRESHOLD(-0x28) #define DEFAULT_MUTE 0x01 #define DEFAULT_POWER_LEVEL88 #define DEFAULT_FREQUENCY 8800 @@ -252,8 +252,8 @@ static int si4713_send_command(struct si4713_device *sdev, const u8 command, if (client-irq) return -EBUSY; - msleep(1); - } while (jiffies = until_jiffies); + usleep_range(1000, 2000); + } while (time_is_after_jiffies(until_jiffies)); return -EBUSY; } @@ -269,9 +269,9 @@ static int si4713_read_property(struct si4713_device *sdev, u16 prop, u32 *pv) int err; u8 val[SI4713_GET_PROP_NRESP]; /* -* .First byte = 0 -* .Second byte = property's MSB -* .Third byte = property's LSB +* .First byte = 0 +* .Second byte = property's MSB +* .Third byte = property's LSB */ const u8 args[SI4713_GET_PROP_NARGS] = { 0x00, @@ -306,11 +306,11 @@ static int si4713_write_property(struct si4713_device *sdev, u16 prop, u16 val) int rval; u8 resp[SI4713_SET_PROP_NRESP]; /* -* .First byte = 0 -* .Second byte = property's MSB -* .Third byte = property's LSB -* .Fourth byte = value's MSB -* .Fifth byte = value's LSB +* .First byte = 0 +* .Second byte = property's MSB +* .Third byte = property's LSB +* .Fourth byte = value's MSB +* .Fifth byte = value's LSB */ const u8 args[SI4713_SET_PROP_NARGS] = { 0x00, @@ -352,8 +352,8 @@ static int si4713_powerup(struct si4713_device *sdev) int err; u8 resp[SI4713_PWUP_NRESP]; /* -* .First byte = Enabled interrupts and boot function -* .Second byte = Input operation mode +* .First byte = Enabled interrupts and boot function +* .Second byte = Input operation mode */ u8 args[SI4713_PWUP_NARGS] = { SI4713_PWUP_GPO2OEN | SI4713_PWUP_FUNC_TX, @@ -505,18 +505,18 @@ static int si4713_wait_stc(struct si4713_device *sdev, const int usecs) } if (jiffies_to_usecs(jiffies - start_jiffies) usecs) return err 0 ? err : -EIO; - /* We sleep here for 3 ms in order to avoid flooding the device + /* We sleep here for 3-4 ms in order to avoid flooding the device * with USB requests. The si4713 USB driver was developed * by reverse engineering the Windows USB driver. The windows * driver also has a ~2.5 ms delay between responses. */ - msleep(3); + usleep_range(3000, 4000); } } /* * si4713_tx_tune_freq - Sets the state of the RF
Re: [PATCHv2 11/11] si4713: coding style cleanups
On Fri, Dec 6, 2013 at 6:17 AM, Hans Verkuil hverk...@xs4all.nl wrote: From: Hans Verkuil hans.verk...@cisco.com Fix most checkpatch errors/warnings. It's mostly whitespace changes, except for replacing msleep with usleep_range and the jiffies comparison with time_is_after_jiffies(). Signed-off-by: Hans Verkuil hans.verk...@cisco.com Acked-by: Eduardo Valentin edubez...@gmail.com --- drivers/media/radio/si4713/radio-usb-si4713.c | 4 +- drivers/media/radio/si4713/si4713.c | 104 +- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index d978844..691e487 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -207,7 +207,7 @@ static int si4713_send_startup_command(struct si4713_usb_device *radio) } if (time_is_before_jiffies(until_jiffies)) return -EIO; - msleep(3); + usleep_range(3000, 5000); } return retval; @@ -354,7 +354,7 @@ static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len) data[0] = 0; return 0; } - msleep(3); + usleep_range(3000, 5000); } } diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 6f28a2b..451b9c0 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c @@ -50,12 +50,12 @@ MODULE_VERSION(0.0.1); #define DEFAULT_RDS_PS_REPEAT_COUNT0x0003 #define DEFAULT_LIMITER_RTIME 0x1392 #define DEFAULT_LIMITER_DEV0x102CA -#define DEFAULT_PILOT_FREQUENCY0x4A38 +#define DEFAULT_PILOT_FREQUENCY0x4A38 #define DEFAULT_PILOT_DEVIATION0x1A5E #define DEFAULT_ACOMP_ATIME0x #define DEFAULT_ACOMP_RTIME0xF4240L #define DEFAULT_ACOMP_GAIN 0x0F -#define DEFAULT_ACOMP_THRESHOLD(-0x28) +#define DEFAULT_ACOMP_THRESHOLD(-0x28) #define DEFAULT_MUTE 0x01 #define DEFAULT_POWER_LEVEL88 #define DEFAULT_FREQUENCY 8800 @@ -252,8 +252,8 @@ static int si4713_send_command(struct si4713_device *sdev, const u8 command, if (client-irq) return -EBUSY; - msleep(1); - } while (jiffies = until_jiffies); + usleep_range(1000, 2000); + } while (time_is_after_jiffies(until_jiffies)); return -EBUSY; } @@ -269,9 +269,9 @@ static int si4713_read_property(struct si4713_device *sdev, u16 prop, u32 *pv) int err; u8 val[SI4713_GET_PROP_NRESP]; /* -* .First byte = 0 -* .Second byte = property's MSB -* .Third byte = property's LSB +* .First byte = 0 +* .Second byte = property's MSB +* .Third byte = property's LSB */ const u8 args[SI4713_GET_PROP_NARGS] = { 0x00, @@ -306,11 +306,11 @@ static int si4713_write_property(struct si4713_device *sdev, u16 prop, u16 val) int rval; u8 resp[SI4713_SET_PROP_NRESP]; /* -* .First byte = 0 -* .Second byte = property's MSB -* .Third byte = property's LSB -* .Fourth byte = value's MSB -* .Fifth byte = value's LSB +* .First byte = 0 +* .Second byte = property's MSB +* .Third byte = property's LSB +* .Fourth byte = value's MSB +* .Fifth byte = value's LSB */ const u8 args[SI4713_SET_PROP_NARGS] = { 0x00, @@ -352,8 +352,8 @@ static int si4713_powerup(struct si4713_device *sdev) int err; u8 resp[SI4713_PWUP_NRESP]; /* -* .First byte = Enabled interrupts and boot function -* .Second byte = Input operation mode +* .First byte = Enabled interrupts and boot function +* .Second byte = Input operation mode */ u8 args[SI4713_PWUP_NARGS] = { SI4713_PWUP_GPO2OEN | SI4713_PWUP_FUNC_TX, @@ -505,18 +505,18 @@ static int si4713_wait_stc(struct si4713_device *sdev, const int usecs) } if (jiffies_to_usecs(jiffies - start_jiffies) usecs) return err 0 ? err : -EIO; - /* We sleep here for 3 ms in order to avoid flooding the device + /* We sleep here for 3-4 ms in order to avoid flooding the device * with USB requests. The si4713 USB driver was developed * by reverse engineering the Windows USB