Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277403

Re: [PATCH 6/7] ARM: davinci: fix a problematic usage of WARN()

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH 6/7] ARM: davinci: fix a problematic usage of WARN()
Date 2015-11-25 14:50 +0100
Message-ID <qyICm-6XN-23@gated-at.bofh.it> (permalink)
References <qyI9j-6MK-3@gated-at.bofh.it> <qyI9j-6MK-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 6/7] ARM: davinci: fix a problematic usage of WARN() Geliang Tang <geliangtang@163.com> - 2015-11-25 14:20 +0100
  Re: [PATCH 6/7] ARM: davinci: fix a problematic usage of WARN() Arnd Bergmann <arnd@arndb.de> - 2015-11-25 14:50 +0100
    [PATCH v2] ARM: davinci: fix a problematic usage of WARN() Geliang Tang <geliangtang@163.com> - 2015-11-25 15:20 +0100
      Re: [PATCH v2] ARM: davinci: fix a problematic usage of WARN() kbuild test robot <lkp@intel.com> - 2015-11-25 21:30 +0100

csiph-web