lkml.org 
[lkml]   [2015]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 6/7] ARM: davinci: fix a problematic usage of WARN()
Date
On Wednesday 25 November 2015 21:12:19 Geliang Tang wrote:
> +++ b/arch/arm/mach-davinci/board-dm355-evm.c
> @@ -385,7 +385,7 @@ static __init void dm355_evm_init(void)
>
> aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
> if (IS_ERR(aemif))
> - WARN("%s: unable to get AEMIF clock\n", __func__);
> + WARN(1, "%s: unable to get AEMIF clock\n", __func__);
> else
> clk_prepare_enable(aemif);
>
>

How about writing this as

if (!WARN(IS_ERR(aemif)), "unable to get AEMIF clock\n"))
clk_prepare_enable(aemif);

Note that WARN() already contains file and line, so you don't really
need the __func__ here either.

Arnd


\
 
 \ /
  Last update: 2015-11-25 15:01    [W:0.081 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site