Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [PATCH 6/7] ARM: davinci: fix a problematic usage of WARN() | Date | Wed, 25 Nov 2015 14:39:44 +0100 |
| |
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
| |