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  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]
Date:	Tue, 22 Jun 2010 07:23:14 +0200
From:	Uwe Kleine-König 
To:	Greg KH <>
Cc:	Randy Dunlap <>,
	Dmitry Torokhov <>,
	Anisse Astier <>,
	Greg Kroah-Hartman <>,
	Magnus Damm <>,
	"Rafael J. Wysocki" <>,
	Paul Mundt <>,
	Eric Miao <>,,,
Subject: Re: [PATCH 2/2 v2] Driver core: reduce duplicated code

Hi Greg,

> > I changed the semantic slightly to only call
> > platform_device_add_resources if data != NULL instead of size != 0.  The
> > idea is to support wrappers like:
> > 
> > 	#define add_blablub(id, pdata) \
> > 		platform_device_register_resndata(NULL, "blablub", id, \
> > 			NULL, 0, pdata, sizeof(struct blablub_platform_data))
> > 
> > that don't fail if pdata=NULL.  Ditto for res.
> That's fine, but why would you want to have a #define for something like
> this?  Is it really needed?
Well, what is really needed?  I intend to use it on arm/imx.  I have
several different machines using similar SoCs and so I want to have a
function à la:

	struct platform_device *__init imx_add_imx_i2c(int id,
		resource_size_t iobase, resource_size_t iosize, int irq,
		const struct imxi2c_platform_data *pdata)

that builds a struct resource[] and then calls
platform_device_register_resndata().  And then I have a set of macros

	#define imx21_add_i2c_imx(pdata)	\
		imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata)
	#define imx25_add_imx_i2c0(pdata)	\
		imx_add_imx_i2c(0, MX25_I2C1_BASE_ADDR, SZ_16K, MX25_INT_I2C1, pdata)
	##define imx25_add_imx_i2c1(pdata)	\
		imx_add_imx_i2c(1, MX25_I2C2_BASE_ADDR, SZ_16K, MX25_INT_I2C2, pdata)

etc.  The final goal is to get rid of files like

> Anyway, this version looks fine to me, I'll go apply it.

Best regards and thanks

Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 |  |
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists