[POWERPC] Make struct property's value a void *

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Stephen Rothwell 2007-04-03 10:58:52 +10:00 коммит произвёл Paul Mackerras
Родитель 9213feea6e
Коммит 1a38147ed0
9 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -294,19 +294,19 @@ static unsigned long htab_base, kernel_end;
static struct property htab_base_prop = { static struct property htab_base_prop = {
.name = "linux,htab-base", .name = "linux,htab-base",
.length = sizeof(unsigned long), .length = sizeof(unsigned long),
.value = (unsigned char *)&htab_base, .value = &htab_base,
}; };
static struct property htab_size_prop = { static struct property htab_size_prop = {
.name = "linux,htab-size", .name = "linux,htab-size",
.length = sizeof(unsigned long), .length = sizeof(unsigned long),
.value = (unsigned char *)&htab_size_bytes, .value = &htab_size_bytes,
}; };
static struct property kernel_end_prop = { static struct property kernel_end_prop = {
.name = "linux,kernel-end", .name = "linux,kernel-end",
.length = sizeof(unsigned long), .length = sizeof(unsigned long),
.value = (unsigned char *)&kernel_end, .value = &kernel_end,
}; };
static void __init export_htab_values(void) static void __init export_htab_values(void)
@ -335,7 +335,7 @@ static void __init export_htab_values(void)
static struct property crashk_base_prop = { static struct property crashk_base_prop = {
.name = "linux,crashkernel-base", .name = "linux,crashkernel-base",
.length = sizeof(unsigned long), .length = sizeof(unsigned long),
.value = (unsigned char *)&crashk_res.start, .value = &crashk_res.start,
}; };
static unsigned long crashk_size; static unsigned long crashk_size;
@ -343,7 +343,7 @@ static unsigned long crashk_size;
static struct property crashk_size_prop = { static struct property crashk_size_prop = {
.name = "linux,crashkernel-size", .name = "linux,crashkernel-size",
.length = sizeof(unsigned long), .length = sizeof(unsigned long),
.value = (unsigned char *)&crashk_size, .value = &crashk_size,
}; };
static void __init export_crashk_values(void) static void __init export_crashk_values(void)

Просмотреть файл

@ -1012,7 +1012,7 @@ pci_create_OF_bus_map(void)
memset(of_prop, -1, sizeof(struct property) + 256); memset(of_prop, -1, sizeof(struct property) + 256);
of_prop->name = "pci-OF-bus-map"; of_prop->name = "pci-OF-bus-map";
of_prop->length = 256; of_prop->length = 256;
of_prop->value = (unsigned char *)&of_prop[1]; of_prop->value = &of_prop[1];
prom_add_property(find_path_device("/"), of_prop); prom_add_property(find_path_device("/"), of_prop);
} }
} }

Просмотреть файл

@ -390,12 +390,13 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
if (allnextpp) { if (allnextpp) {
pp->name = "name"; pp->name = "name";
pp->length = sz; pp->length = sz;
pp->value = (unsigned char *)(pp + 1); pp->value = pp + 1;
*prev_pp = pp; *prev_pp = pp;
prev_pp = &pp->next; prev_pp = &pp->next;
memcpy(pp->value, ps, sz - 1); memcpy(pp->value, ps, sz - 1);
((char *)pp->value)[sz - 1] = 0; ((char *)pp->value)[sz - 1] = 0;
DBG("fixed up name for %s -> %s\n", pathp, pp->value); DBG("fixed up name for %s -> %s\n", pathp,
(char *)pp->value);
} }
} }
if (allnextpp) { if (allnextpp) {

Просмотреть файл

@ -77,7 +77,7 @@ static void __init fixup_bus_range(struct device_node *bridge)
bridge->full_name); bridge->full_name);
return; return;
} }
bus_range = (int *)prop->value; bus_range = prop->value;
bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]); bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
} }

Просмотреть файл

@ -100,7 +100,7 @@ static void __init fixup_bus_range(struct device_node *bridge)
if (prop == NULL || prop->length < 2 * sizeof(int)) if (prop == NULL || prop->length < 2 * sizeof(int))
return; return;
bus_range = (int *)prop->value; bus_range = prop->value;
bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]); bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
} }

Просмотреть файл

@ -692,8 +692,7 @@ static int pmf_add_functions(struct pmf_device *dev, void *driverdata)
name = pp->name + plen; name = pp->name + plen;
if (strlen(name) && pp->length >= 12) if (strlen(name) && pp->length >= 12)
count += pmf_add_function_prop(dev, driverdata, name, count += pmf_add_function_prop(dev, driverdata, name,
(u32 *)pp->value, pp->value, pp->length);
pp->length);
} }
return count; return count;
} }

Просмотреть файл

@ -952,7 +952,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id)
prop->name = ((char *)prop) + tlen - 18; prop->name = ((char *)prop) + tlen - 18;
sprintf(prop->name, "sdb-partition-%02x", id); sprintf(prop->name, "sdb-partition-%02x", id);
prop->length = len; prop->length = len;
prop->value = (unsigned char *)hdr; prop->value = hdr;
prop->next = NULL; prop->next = NULL;
/* Read the datablock */ /* Read the datablock */

Просмотреть файл

@ -38,7 +38,7 @@ static int property_read_proc(char *page, char **start, off_t off,
n = count; n = count;
else else
*eof = 1; *eof = 1;
memcpy(page, pp->value + off, n); memcpy(page, (char *)pp->value + off, n);
*start = page; *start = page;
return n; return n;
} }

Просмотреть файл

@ -71,7 +71,7 @@ typedef u32 ihandle;
struct property { struct property {
char *name; char *name;
int length; int length;
unsigned char *value; void *value;
struct property *next; struct property *next;
}; };