[linuxppc-release] [PATCH] Fix case where phys_addr_t != unsigned long when reading proc entries

Tabi Timur-B04825 B04825 at freescale.com
Wed Jul 14 11:49:30 EDT 2010


Matthew McClintock wrote:
> +unsigned long long initrd_base, initrd_size;
> +unsigned long long devicetree_base, devicetree_size;

These should be declared uint64_t, to match the code that assigns them.

> +				if (n == 4) {
> +					kernel_end = ((uint32_t *)buf)[0];
> +				} else if (n == 8) {

How about
	
	n == sizeof(uint32_t)

and

	n == sizeof(uint64_t)

?

+			memset(fname, 0, sizeof(fname));
+			strcpy(fname, device_tree);
+			strcat(fname, dentry->d_name);
+			strcat(fname, "/linux,initrd-start");

Why not use sprintf() instead of three strcxx calls?

-- 
Timur Tabi
Linux kernel developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20100714/d14ac007/attachment.html>


More information about the kexec mailing list