Re: [PATCH v2 2/3] clocksource: mtk_timer: fix pr_warn() messages in mtk_timer_init

From: Joe Perches
Date: Sun Oct 18 2015 - 20:23:32 EST


On Mon, 2015-10-19 at 03:09 +0300, Alexey Klimov wrote:
> 1) Change pr_warn()s to pr_err()s. These messages are actually
> errors and not warnings.
> 2) Add missing \n.
> 3) Error message for kzalloc() failure is removed per suggestion
> by Joe Perches. There is generic stack_dump() for allocation issues.

Some of the braces around single statements
could also be removed.

> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index ca5ea9e..ac92ca2 100644

> @@ -184,7 +184,6 @@ 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");
> return;
> }

could be written:

evt = kzalloc(sizeof(*evt), GFP_KERNEL);
if (!evt)
return;

etc...


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/