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: <53967120.8010806@huawei.com>
Date:	Tue, 10 Jun 2014 10:44:48 +0800
From:	Xie XiuQi <xiexiuqi@...wei.com>
To:	Kefeng Wang <wangkefeng.wang@...wei.com>
CC:	Mauro Carvalho Chehab <mchehab@...hat.com>,
	Johannes Thumshirn <johannes.thumshirn@....de>,
	Doug Thompson <dougthompson@...ssion.com>,
	<linux-edac@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cpc925_edac: Use module_platform_driver()

On 2014/6/9 22:40, Kefeng Wang wrote:
> Move edac_op_state assignment operations to probe, then convert to
> module_platform_drive() to eliminate boilerplate code, and use

module_platform_driver() ;-)

> cpc925_printk instead of printk.
> 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> ---
>  drivers/edac/cpc925_edac.c |   33 +++++++--------------------------
>  1 files changed, 7 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
> index df6575f..8e3192a 100644
> --- a/drivers/edac/cpc925_edac.c
> +++ b/drivers/edac/cpc925_edac.c
> @@ -944,6 +944,12 @@ static int cpc925_probe(struct platform_device *pdev)
>  
>  	edac_dbg(0, "%s platform device found!\n", pdev->name);
>  
> +	cpc925_printk(KERN_INFO, CPC925_EDAC_REVISION "\n");
> +	cpc925_printk(KERN_INFO, "\t(c) 2008 Wind River Systems, Inc\n");
> +
> +	/* Only support POLL mode so far */
> +	edac_op_state = EDAC_OPSTATE_POLL;
> +
>  	if (!devres_open_group(&pdev->dev, cpc925_probe, GFP_KERNEL)) {
>  		res = -ENOMEM;
>  		goto out;
> @@ -1065,32 +1071,7 @@ static struct platform_driver cpc925_edac_driver = {
>  	}
>  };
>  
> -static int __init cpc925_edac_init(void)
> -{
> -	int ret = 0;
> -
> -	printk(KERN_INFO "IBM CPC925 EDAC driver " CPC925_EDAC_REVISION "\n");
> -	printk(KERN_INFO "\t(c) 2008 Wind River Systems, Inc\n");
> -
> -	/* Only support POLL mode so far */
> -	edac_op_state = EDAC_OPSTATE_POLL;
> -
> -	ret = platform_driver_register(&cpc925_edac_driver);
> -	if (ret) {
> -		printk(KERN_WARNING "Failed to register %s\n",
> -			CPC925_EDAC_MOD_STR);
> -	}
> -
> -	return ret;
> -}
> -
> -static void __exit cpc925_edac_exit(void)
> -{
> -	platform_driver_unregister(&cpc925_edac_driver);
> -}
> -
> -module_init(cpc925_edac_init);
> -module_exit(cpc925_edac_exit);
> +module_platform_driver(cpc925_edac_driver);
>  
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Cao Qingtao <qingtao.cao@...driver.com>");
> 


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