Re: [PATCH 3/5] staging: tidspbridge: Lindent to drv_interface.c
2012/1/23 Víctor Manuel Jáquez Leal vjaq...@igalia.com: No functional changes. According to Lindent, the file drv_internface.c had some lines with bad indentation. This commit is the output of Lindent. Usually lindent tends to do whatever it wants, unless carefully configured... ... @@ -342,9 +342,10 @@ static void bridge_recover(struct work_struct *work) if (atomic_read(bridge_cref)) { INIT_COMPLETION(bridge_comp); while (!wait_for_completion_timeout(bridge_comp, - msecs_to_jiffies(REC_TIMEOUT))) - pr_info(%s:%d handle(s) still opened\n, - __func__, atomic_read(bridge_cref)); + msecs_to_jiffies + (REC_TIMEOUT))) Like here, it just split msecs_to_jiffies(REC_TIMEOUT) into 2 lines making it a little harder to read. + pr_info(%s:%d handle(s) still opened\n, __func__, + atomic_read(bridge_cref)); I remember the rule was to break lines as far to the right as possible, no? Chapter 2 CodingStyle, same for the other similar changes. ... @@ -547,10 +548,9 @@ static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev) pr_err(%s: Failed to retrieve the object handle\n, __func__); goto func_cont; } - Blank line removed? #ifdef CONFIG_TIDSPBRIDGE_DVFS if (cpufreq_unregister_notifier(iva_clk_notifier, - CPUFREQ_TRANSITION_NOTIFIER)) + CPUFREQ_TRANSITION_NOTIFIER)) pr_err(%s: cpufreq_unregister_notifier failed for iva2_ck\n, __func__); #endif /* #ifdef CONFIG_TIDSPBRIDGE_DVFS */ -- 1.7.8.3 Regards, Omar -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] staging: tidspbridge: Lindent to drv_interface.c
On Mon, Jan 30, 2012 at 11:25:34AM -0600, Ramirez Luna, Omar wrote: 2012/1/23 Víctor Manuel Jáquez Leal vjaq...@igalia.com: No functional changes. According to Lindent, the file drv_internface.c had some lines with bad indentation. This commit is the output of Lindent. Usually lindent tends to do whatever it wants, unless carefully configured... Thanks Omar! I'll post a v2 of this patch set, with a couple things more and with more attention on what lindent does in this one, if that's ok. vmjl ... @@ -342,9 +342,10 @@ static void bridge_recover(struct work_struct *work) if (atomic_read(bridge_cref)) { INIT_COMPLETION(bridge_comp); while (!wait_for_completion_timeout(bridge_comp, - msecs_to_jiffies(REC_TIMEOUT))) - pr_info(%s:%d handle(s) still opened\n, - __func__, atomic_read(bridge_cref)); + msecs_to_jiffies + (REC_TIMEOUT))) Like here, it just split msecs_to_jiffies(REC_TIMEOUT) into 2 lines making it a little harder to read. + pr_info(%s:%d handle(s) still opened\n, __func__, + atomic_read(bridge_cref)); I remember the rule was to break lines as far to the right as possible, no? Chapter 2 CodingStyle, same for the other similar changes. ... @@ -547,10 +548,9 @@ static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev) pr_err(%s: Failed to retrieve the object handle\n, __func__); goto func_cont; } - Blank line removed? #ifdef CONFIG_TIDSPBRIDGE_DVFS if (cpufreq_unregister_notifier(iva_clk_notifier, - CPUFREQ_TRANSITION_NOTIFIER)) + CPUFREQ_TRANSITION_NOTIFIER)) pr_err(%s: cpufreq_unregister_notifier failed for iva2_ck\n, __func__); #endif /* #ifdef CONFIG_TIDSPBRIDGE_DVFS */ -- 1.7.8.3 Regards, Omar -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] staging: tidspbridge: Lindent to drv_interface.c
On Mon, Jan 30, 2012 at 11:25:34AM -0600, Ramirez Luna, Omar wrote: + pr_info(%s:%d handle(s) still opened\n, __func__, + atomic_read(bridge_cref)); I remember the rule was to break lines as far to the right as possible, no? Chapter 2 CodingStyle, same for the other similar changes. It doesn't mean you have to right justify things, it just means indented. The original code is fine here and the new code is fine here. It's up to whoever writes the code to decide. regards, dan carpenter signature.asc Description: Digital signature
Re: [PATCH 3/5] staging: tidspbridge: Lindent to drv_interface.c
On Mon, 2012-01-30 at 22:29 +0300, Dan Carpenter wrote: On Mon, Jan 30, 2012 at 11:25:34AM -0600, Ramirez Luna, Omar wrote: + pr_info(%s:%d handle(s) still opened\n, __func__, + atomic_read(bridge_cref)); I remember the rule was to break lines as far to the right as possible, no? Chapter 2 CodingStyle, same for the other similar changes. It doesn't mean you have to right justify things, it just means indented. The original code is fine here and the new code is fine here. It's up to whoever writes the code to decide. I concur. My personal preference is to use a new line after the format string if necessary. ie: pr_level(fmt\n[, args to 80 columns if all fit]) or pr_level(fmt\n, args when single line exceeds 80 columns); So for this case: pr_info(%s:%d handle(s) still opened\n, __func__, atomic_read(bridge_cref)); I've done a patch here to tidspbridge that standardizes printk output. Basically, the patch adds #define pr_fmt(fmt) KBUILD_MODNAME %s: , __func__ to prefix tidspbridge:%s:, removes the leading %s:..., __func__ from the uses, coalesces formats and does argument alignment. It cleans up the DBC_ASSERT, DBC_REQUIRE and DBC_ENSURE macros too. I'm waiting for the Makefile change and whatever patches Víctor produces to be applied. I'll then redo my patch and submit it. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] staging: tidspbridge: Lindent to drv_interface.c
On Mon, Jan 30, 2012 at 11:53:00AM -0800, Joe Perches wrote: On Mon, 2012-01-30 at 22:29 +0300, Dan Carpenter wrote: On Mon, Jan 30, 2012 at 11:25:34AM -0600, Ramirez Luna, Omar wrote: + pr_info(%s:%d handle(s) still opened\n, __func__, + atomic_read(bridge_cref)); I remember the rule was to break lines as far to the right as possible, no? Chapter 2 CodingStyle, same for the other similar changes. It doesn't mean you have to right justify things, it just means indented. The original code is fine here and the new code is fine here. It's up to whoever writes the code to decide. I concur. My personal preference is to use a new line after the format string if necessary. ie: pr_level(fmt\n[, args to 80 columns if all fit]) or pr_level(fmt\n, args when single line exceeds 80 columns); So for this case: pr_info(%s:%d handle(s) still opened\n, __func__, atomic_read(bridge_cref)); I've done a patch here to tidspbridge that standardizes printk output. Basically, the patch adds #define pr_fmt(fmt) KBUILD_MODNAME %s: , __func__ to prefix tidspbridge:%s:, removes the leading %s:..., __func__ from the uses, coalesces formats and does argument alignment. It cleans up the DBC_ASSERT, DBC_REQUIRE and DBC_ENSURE macros too. hehehe... I also have one for this... But I prefer yours: I'm a newbie :) vmjl I'm waiting for the Makefile change and whatever patches Víctor produces to be applied. I'll then redo my patch and submit it. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] staging: tidspbridge: Lindent to drv_interface.c
On Mon, 2012-01-30 at 21:33 +0100, Víctor M. Jáquez L. wrote: On Mon, Jan 30, 2012 at 11:53:00AM -0800, Joe Perches wrote: I've done a patch here to tidspbridge that standardizes printk output. Basically, the patch adds #define pr_fmt(fmt) KBUILD_MODNAME %s: , __func__ to prefix tidspbridge:%s:, removes the leading %s:..., __func__ from the uses, coalesces formats and does argument alignment. It cleans up the DBC_ASSERT, DBC_REQUIRE and DBC_ENSURE macros too. hehehe... I also have one for this... But I prefer yours: I'm a newbie :) Well, given that you haven't done many of these, I prefer yours. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/5] staging: tidspbridge: Lindent to drv_interface.c
No functional changes. According to Lindent, the file drv_internface.c had some lines with bad indentation. This commit is the output of Lindent. Signed-off-by: Víctor Manuel Jáquez Leal vjaq...@igalia.com --- drivers/staging/tidspbridge/rmgr/drv_interface.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c index 5ea753c..c7015f5 100644 --- a/drivers/staging/tidspbridge/rmgr/drv_interface.c +++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c @@ -147,7 +147,7 @@ static int bridge_open(struct inode *ip, struct file *filp) #ifdef CONFIG_TIDSPBRIDGE_RECOVERY if (recover) { if (filp-f_flags O_NONBLOCK || - wait_for_completion_interruptible(bridge_open_comp)) + wait_for_completion_interruptible(bridge_open_comp)) return -EBUSY; } #endif @@ -245,7 +245,7 @@ static long bridge_ioctl(struct file *filp, unsigned int code, if (!status) { status = api_call_dev_ioctl(code, buf_in, retval, -filp-private_data); + filp-private_data); if (!status) { status = retval; @@ -342,9 +342,10 @@ static void bridge_recover(struct work_struct *work) if (atomic_read(bridge_cref)) { INIT_COMPLETION(bridge_comp); while (!wait_for_completion_timeout(bridge_comp, - msecs_to_jiffies(REC_TIMEOUT))) - pr_info(%s:%d handle(s) still opened\n, - __func__, atomic_read(bridge_cref)); + msecs_to_jiffies + (REC_TIMEOUT))) + pr_info(%s:%d handle(s) still opened\n, __func__, + atomic_read(bridge_cref)); } dev = dev_get_first(); dev_get_dev_node(dev, dev_node); @@ -363,10 +364,10 @@ void bridge_recover_schedule(void) #endif #ifdef CONFIG_TIDSPBRIDGE_DVFS static int dspbridge_scale_notification(struct notifier_block *op, - unsigned long val, void *ptr) + unsigned long val, void *ptr) { struct omap_dsp_platform_data *pdata = - omap_dspbridge_dev-dev.platform_data; + omap_dspbridge_dev-dev.platform_data; if (CPUFREQ_POSTCHANGE == val pdata-dsp_get_opp) pwr_pm_post_scale(PRCM_VDD1, pdata-dsp_get_opp()); @@ -413,7 +414,7 @@ static int omap3_bridge_startup(struct platform_device *pdev) CPUFREQ_TRANSITION_NOTIFIER); if (err) pr_err(%s: clk_notifier_register failed for iva2_ck\n, - __func__); + __func__); #endif #endif @@ -471,7 +472,7 @@ err2: err1: #ifdef CONFIG_TIDSPBRIDGE_DVFS cpufreq_unregister_notifier(iva_clk_notifier, - CPUFREQ_TRANSITION_NOTIFIER); + CPUFREQ_TRANSITION_NOTIFIER); #endif dsp_clk_exit(); @@ -547,10 +548,9 @@ static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev) pr_err(%s: Failed to retrieve the object handle\n, __func__); goto func_cont; } - #ifdef CONFIG_TIDSPBRIDGE_DVFS if (cpufreq_unregister_notifier(iva_clk_notifier, - CPUFREQ_TRANSITION_NOTIFIER)) + CPUFREQ_TRANSITION_NOTIFIER)) pr_err(%s: cpufreq_unregister_notifier failed for iva2_ck\n, __func__); #endif /* #ifdef CONFIG_TIDSPBRIDGE_DVFS */ -- 1.7.8.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html