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

Tabi Timur-B04825
2010-07-14T15:50:21Z

[-- Attachment #1.1: Type: text/plain, Size: 634 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2321 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]