lkml.org 
[lkml]   [2007]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [POWERPC] 8xx: PQ SoC IRDA support
On Wed, 09 May 2007 02:42:07 +0400
Vitaly Bordug <vitb@kernel.crashing.org> 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.

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

\
 
 \ /
  Last update: 2007-05-10 01:57    [W:0.030 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site