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] [day] [month] [year] [list]
Message-ID: <30f541a7-ef9d-d687-ab76-22a4544258f8@metux.net>
Date:   Wed, 26 Jun 2019 19:27:02 +0200
From:   "Enrico Weigelt, metux IT consult" <lkml@...ux.net>
To:     Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>
Cc:     linux-kernel@...r.kernel.org, grygorii.strashko@...com,
        mcoquelin.stm32@...il.com, thloh@...era.com, festevam@...il.com,
        linus.walleij@...aro.org, khilman@...nel.org,
        patches@...nsource.cirrus.com, bgolaszewski@...libre.com,
        linux-omap@...r.kernel.org, linux-gpio@...r.kernel.org,
        linux-imx@....com, kernel@...gutronix.de, ssantosh@...nel.org,
        linux-tegra@...r.kernel.org, andriy.shevchenko@...ux.intel.com,
        shawnguo@...nel.org, s.hauer@...gutronix.de,
        alexandre.torgue@...com
Subject: Re: [PATCH 01/30] include: linux: platform_device: more helpers for
 declaring platform drivers

On 26.06.19 08:14, Uwe Kleine-König wrote:
Hi,

> Would it make sense to do something like:
>
> 	#define __module_platform_driver(__platform_driver, __initlvl) \
> 	static int __init __platform_driver##_init(void) \
> 	{ \
> 		return platform_driver_register(&(__platform_driver)); \
> 	} \
> 	__initlvl ## _initcall(__platform_driver##_init); \
> 	static void __exit __platform_driver##_exit(void) \
> 	{ \
> 		platform_driver_unregister(&(__platform_driver)); \
> 	} \
> 	module_exit(__platform_driver##_exit);
>
> 	#define postcore_platform_driver(__platform_driver)
__module_platform_driver(__platform_driver, postcore)
> 	#define subsys_platform_driver(__platform_driver)
__module_platform_driver(__platform_driver, subsys)
> 	...
>
> Which would be more compact and makes the difference between these
> macros a bit more obvious.
yeah, could do that, but not sure whether it's really good for
readability when we have so many nested macros :p

OTOH, I didn't want to touch the existing macros for now, just trim down
the actual init boilerplate, postponing further compactions for later.

--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@...ux.net -- +49-151-27565287

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ