Thread (6 messages) flat view 6 messages, 3 authors, 2007-05-09

Re: [PATCH] [POWERPC] 8xx: PQ SoC IRDA support

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-05-09 23:54:01
Also in: lkml

On Wed, 09 May 2007 02:42:07 +0400
Vitaly Bordug [off-list ref] wrote:
+		model = (char *)get_property(np, "model", NULL);
+		if (model == NULL)
+			return -ENODEV;
+
+		id = (u32 *) get_property(np, "device-id", NULL);
get_property() got renamed to of_get_property().

You have two coding-styles in the typecasting here.  The former (no space)
is more common and makes more sense, IMO.

However of_get_property() returns const void* so really you shouldn't be
doing any casting at all.  `model' should have type `const char *' and then
you can do

	model = get_property(np, "model", NULL);

which has nice type-safety and const-correctness.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help