Hi Chandru, On Tue, 8 Jul 2008 00:14:24 +0530 Chandru <[EMAIL PROTECTED]> wrote: > > @@ -917,7 +918,33 @@ static int __init early_init_dt_scan_drc > if ((base + size) > 0x80000000ul) > size = 0x80000000ul - base; > } > - lmb_add(base, size); > + strcpy(buf, "linux,usable-memory"); > + sprintf(t, "%d", (int)n); > + strcat(buf, t);
Why don't you use
snprintf(buf, sizeof(buf), "linux,usable-memory%ld", n);
instead?
> + usm = (cell_t *)of_get_flat_dt_prop(node,
> + (const char *)buf, &l);
^^^^^^^^^^ ^^^^^^^^^^^^^^
unnecessary casts.
> static void __init parse_drconf_memory(struct device_node *memory)
> {
> + strcpy(buf, "linux,usable-memory");
> + sprintf(t, "%d", (int)n);
> + strcat(buf, t);
See snprint comment above.
> + usm = of_get_property(memory, (const char *)buf, &len);
^^^^^^^^^^^^^^
unnecessary cast.
> + if (usm != NULL) {
> + ranges = (len >> 2) / (n_mem_addr_cells +
^^^^^^^^^^
len / sizeof(u32) ?
--
Cheers,
Stephen Rothwell [EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
pgpoa1Ydxh674.pgp
Description: PGP signature
_______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
