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

Joe Perches joe at perches.com
Sun Oct 18 17:23:24 PDT 2015


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...





More information about the Linux-mediatek mailing list