* [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define
@ 2015-09-04 3:21 Alexey Klimov
2015-09-04 3:21 ` [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init Alexey Klimov
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Alexey Klimov @ 2015-09-04 3:21 UTC (permalink / raw)
To: daniel.lezcano, linux-mediatek, matthias.bgg
Cc: yingjoe.chen, tglx, linux-kernel, klimov.linux, Alexey Klimov
It's a bit uncler what subsystem/driver emits some messages
to dmesg in function mtk_init_timer().
Use pr_fmt to auto-prefix the messages appropriately.
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
drivers/clocksource/mtk_timer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index 50f0641..ca5ea9e 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -16,6 +16,8 @@
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init
2015-09-04 3:21 [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define Alexey Klimov
@ 2015-09-04 3:21 ` Alexey Klimov
2015-09-04 3:40 ` Joe Perches
2015-09-04 8:50 ` Matthias Brugger
2015-09-04 3:21 ` [RFC PATCH 3/3] clocksource: mtk_timer: fix memleak in mtk_timer_init() Alexey Klimov
2015-09-04 8:51 ` [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define Matthias Brugger
2 siblings, 2 replies; 7+ messages in thread
From: Alexey Klimov @ 2015-09-04 3:21 UTC (permalink / raw)
To: daniel.lezcano, linux-mediatek, matthias.bgg
Cc: yingjoe.chen, tglx, linux-kernel, klimov.linux, Alexey Klimov
These messages are actually errors and not warnings.
Use pr_err() macro for them and add missing \n.
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
drivers/clocksource/mtk_timer.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index ca5ea9e..fbaacbf 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -184,7 +184,7 @@ static void __init mtk_timer_init(struct device_node *node)
evt = kzalloc(sizeof(*evt), GFP_KERNEL);
if (!evt) {
- pr_warn("Can't allocate mtk clock event driver struct");
+ pr_err("Can't allocate mtk clock event driver struct\n");
return;
}
@@ -200,24 +200,24 @@ static void __init mtk_timer_init(struct device_node *node)
evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
if (IS_ERR(evt->gpt_base)) {
- pr_warn("Can't get resource\n");
+ pr_err("Can't get resource\n");
return;
}
evt->dev.irq = irq_of_parse_and_map(node, 0);
if (evt->dev.irq <= 0) {
- pr_warn("Can't parse IRQ");
+ pr_err("Can't parse IRQ\n");
goto err_mem;
}
clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
- pr_warn("Can't get timer clock");
+ pr_err("Can't get timer clock\n");
goto err_irq;
}
if (clk_prepare_enable(clk)) {
- pr_warn("Can't prepare clock");
+ pr_err("Can't prepare clock\n");
goto err_clk_put;
}
rate = clk_get_rate(clk);
@@ -226,7 +226,7 @@ static void __init mtk_timer_init(struct device_node *node)
if (request_irq(evt->dev.irq, mtk_timer_interrupt,
IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
- pr_warn("failed to setup irq %d\n", evt->dev.irq);
+ pr_err("failed to setup irq %d\n", evt->dev.irq);
goto err_clk_disable;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [RFC PATCH 3/3] clocksource: mtk_timer: fix memleak in mtk_timer_init()
2015-09-04 3:21 [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define Alexey Klimov
2015-09-04 3:21 ` [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init Alexey Klimov
@ 2015-09-04 3:21 ` Alexey Klimov
2015-09-04 8:39 ` Matthias Brugger
2015-09-04 8:51 ` [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define Matthias Brugger
2 siblings, 1 reply; 7+ messages in thread
From: Alexey Klimov @ 2015-09-04 3:21 UTC (permalink / raw)
To: daniel.lezcano, linux-mediatek, matthias.bgg
Cc: yingjoe.chen, tglx, linux-kernel, klimov.linux, Alexey Klimov
Add error path to clear evt struct allocated by kzalloc()
in the beginning of function mtk_timer_init().
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
drivers/clocksource/mtk_timer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index fbaacbf..9c5a2cc 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -201,7 +201,7 @@ static void __init mtk_timer_init(struct device_node *node)
evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
if (IS_ERR(evt->gpt_base)) {
pr_err("Can't get resource\n");
- return;
+ goto err_kzalloc;
}
evt->dev.irq = irq_of_parse_and_map(node, 0);
@@ -256,5 +256,7 @@ err_mem:
iounmap(evt->gpt_base);
of_address_to_resource(node, 0, &res);
release_mem_region(res.start, resource_size(&res));
+err_kzalloc:
+ kfree(evt);
}
CLOCKSOURCE_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_timer_init);
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init
2015-09-04 3:21 ` [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init Alexey Klimov
@ 2015-09-04 3:40 ` Joe Perches
2015-09-04 8:50 ` Matthias Brugger
1 sibling, 0 replies; 7+ messages in thread
From: Joe Perches @ 2015-09-04 3:40 UTC (permalink / raw)
To: Alexey Klimov
Cc: daniel.lezcano, linux-mediatek, matthias.bgg, yingjoe.chen, tglx,
linux-kernel, klimov.linux
On Fri, 2015-09-04 at 06:21 +0300, Alexey Klimov wrote:
> These messages are actually errors and not warnings.
> Use pr_err() macro for them and add missing \n.
[]
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
[]
> @@ -184,7 +184,7 @@ static void __init mtk_timer_init(struct device_node *node)
>
> evt = kzalloc(sizeof(*evt), GFP_KERNEL);
> if (!evt) {
> - pr_warn("Can't allocate mtk clock event driver struct");
> + pr_err("Can't allocate mtk clock event driver struct\n");
> return;
> }
Might as well remove this one as there's
a generic stack_dump() on alloc failures.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH 3/3] clocksource: mtk_timer: fix memleak in mtk_timer_init()
2015-09-04 3:21 ` [RFC PATCH 3/3] clocksource: mtk_timer: fix memleak in mtk_timer_init() Alexey Klimov
@ 2015-09-04 8:39 ` Matthias Brugger
0 siblings, 0 replies; 7+ messages in thread
From: Matthias Brugger @ 2015-09-04 8:39 UTC (permalink / raw)
To: Alexey Klimov, daniel.lezcano, linux-mediatek
Cc: yingjoe.chen, tglx, linux-kernel, klimov.linux
On 04/09/15 05:21, Alexey Klimov wrote:
> Add error path to clear evt struct allocated by kzalloc()
> in the beginning of function mtk_timer_init().
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> ---
> drivers/clocksource/mtk_timer.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index fbaacbf..9c5a2cc 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -201,7 +201,7 @@ static void __init mtk_timer_init(struct device_node *node)
> evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
> if (IS_ERR(evt->gpt_base)) {
> pr_err("Can't get resource\n");
> - return;
> + goto err_kzalloc;
> }
>
> evt->dev.irq = irq_of_parse_and_map(node, 0);
> @@ -256,5 +256,7 @@ err_mem:
> iounmap(evt->gpt_base);
> of_address_to_resource(node, 0, &res);
> release_mem_region(res.start, resource_size(&res));
> +err_kzalloc:
> + kfree(evt);
> }
> CLOCKSOURCE_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_timer_init);
>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init
2015-09-04 3:21 ` [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init Alexey Klimov
2015-09-04 3:40 ` Joe Perches
@ 2015-09-04 8:50 ` Matthias Brugger
1 sibling, 0 replies; 7+ messages in thread
From: Matthias Brugger @ 2015-09-04 8:50 UTC (permalink / raw)
To: Alexey Klimov, daniel.lezcano, linux-mediatek
Cc: yingjoe.chen, tglx, linux-kernel, klimov.linux
On 04/09/15 05:21, Alexey Klimov wrote:
> These messages are actually errors and not warnings.
> Use pr_err() macro for them and add missing \n.
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/clocksource/mtk_timer.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index ca5ea9e..fbaacbf 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -184,7 +184,7 @@ static void __init mtk_timer_init(struct device_node *node)
>
> evt = kzalloc(sizeof(*evt), GFP_KERNEL);
> if (!evt) {
> - pr_warn("Can't allocate mtk clock event driver struct");
> + pr_err("Can't allocate mtk clock event driver struct\n");
> return;
> }
>
> @@ -200,24 +200,24 @@ static void __init mtk_timer_init(struct device_node *node)
>
> evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
> if (IS_ERR(evt->gpt_base)) {
> - pr_warn("Can't get resource\n");
> + pr_err("Can't get resource\n");
> return;
> }
>
> evt->dev.irq = irq_of_parse_and_map(node, 0);
> if (evt->dev.irq <= 0) {
> - pr_warn("Can't parse IRQ");
> + pr_err("Can't parse IRQ\n");
> goto err_mem;
> }
>
> clk = of_clk_get(node, 0);
> if (IS_ERR(clk)) {
> - pr_warn("Can't get timer clock");
> + pr_err("Can't get timer clock\n");
> goto err_irq;
> }
>
> if (clk_prepare_enable(clk)) {
> - pr_warn("Can't prepare clock");
> + pr_err("Can't prepare clock\n");
> goto err_clk_put;
> }
> rate = clk_get_rate(clk);
> @@ -226,7 +226,7 @@ static void __init mtk_timer_init(struct device_node *node)
>
> if (request_irq(evt->dev.irq, mtk_timer_interrupt,
> IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
> - pr_warn("failed to setup irq %d\n", evt->dev.irq);
> + pr_err("failed to setup irq %d\n", evt->dev.irq);
> goto err_clk_disable;
> }
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define
2015-09-04 3:21 [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define Alexey Klimov
2015-09-04 3:21 ` [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init Alexey Klimov
2015-09-04 3:21 ` [RFC PATCH 3/3] clocksource: mtk_timer: fix memleak in mtk_timer_init() Alexey Klimov
@ 2015-09-04 8:51 ` Matthias Brugger
2 siblings, 0 replies; 7+ messages in thread
From: Matthias Brugger @ 2015-09-04 8:51 UTC (permalink / raw)
To: Alexey Klimov, daniel.lezcano, linux-mediatek
Cc: yingjoe.chen, tglx, linux-kernel, klimov.linux
On 04/09/15 05:21, Alexey Klimov wrote:
> It's a bit uncler what subsystem/driver emits some messages
> to dmesg in function mtk_init_timer().
> Use pr_fmt to auto-prefix the messages appropriately.
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/clocksource/mtk_timer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index 50f0641..ca5ea9e 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -16,6 +16,8 @@
> * GNU General Public License for more details.
> */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/clk.h>
> #include <linux/clockchips.h>
> #include <linux/interrupt.h>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-09-04 8:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04 3:21 [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define Alexey Klimov
2015-09-04 3:21 ` [RFC PATCH 2/3] clocksource: mtk_timer: change pr_warn()s to pr_err()s in mtk_timer_init Alexey Klimov
2015-09-04 3:40 ` Joe Perches
2015-09-04 8:50 ` Matthias Brugger
2015-09-04 3:21 ` [RFC PATCH 3/3] clocksource: mtk_timer: fix memleak in mtk_timer_init() Alexey Klimov
2015-09-04 8:39 ` Matthias Brugger
2015-09-04 8:51 ` [RFC PATCH 1/3] clocksource: mtk_timer: add pr_fmt define Matthias Brugger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).