lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080813143159.GD26351@cs181140183.pp.htv.fi>
Date:	Wed, 13 Aug 2008 17:31:59 +0300
From:	Adrian Bunk <bunk@...nel.org>
To:	Anton Vorontsov <avorontsov@...mvista.com>
Cc:	Dave Jones <davej@...hat.com>, Wim Van Sebroeck <wim@...ana.be>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCH] [WATCHDOG] mpc8xxx_wdt: fix modular build

On Wed, Aug 13, 2008 at 04:23:41PM +0400, Anton Vorontsov wrote:
>...
> --- a/drivers/watchdog/mpc8xxx_wdt.c
> +++ b/drivers/watchdog/mpc8xxx_wdt.c
> @@ -48,6 +48,7 @@ struct mpc8xxx_wdt_type {
>  };
>  
>  static struct mpc8xxx_wdt __iomem *wd_base;
> +static int mpc8xxx_wdt_init_late(void);
>  
>  static u16 timeout = 0xffff;
>  module_param(timeout, ushort, 0);
> @@ -213,6 +214,12 @@ static int __devinit mpc8xxx_wdt_probe(struct of_device *ofdev,
>  	else
>  		timeout_sec = timeout / freq;
>  
> +#ifdef CONFIG_8xxx_WDT_MODULE
> +	ret = mpc8xxx_wdt_init_late();
> +	if (ret)
> +		goto err_unmap;
> +#endif

In mpc8xxx_wdt_probe()?

Isn't mpc8xxx_wdt_init() the correct place?

>  	pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d "
>  		"(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
>  		timeout_sec);
> @@ -280,7 +287,7 @@ static struct of_platform_driver mpc8xxx_wdt_driver = {
>   * very early to start pinging the watchdog (misc devices are not yet
>   * available), and later module_init() just registers the misc device.
>   */
> -static int __init mpc8xxx_wdt_init_late(void)
> +static int mpc8xxx_wdt_init_late(void)
>  {
>  	int ret;
>  
> @@ -295,7 +302,9 @@ static int __init mpc8xxx_wdt_init_late(void)
>  	}
>  	return 0;
>  }
> +#ifndef CONFIG_8xxx_WDT_MODULE

Your #ifdef is correct, but "#ifdef MODULE" would express this better.

>  module_init(mpc8xxx_wdt_init_late);
> +#endif
>  
>  static int __init mpc8xxx_wdt_init(void)
>  {

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ