lkml.org 
[lkml]   [2015]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] of/fdt: fix error checking for earlycon address
On Fri, Oct 23, 2015 at 8:15 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
> Hi Masahiro,
>
> On 10/23/2015 07:47 AM, Masahiro Yamada wrote:
>> fdt_translate_address() returns OF_BAD_ADDR on error. It is defined as
>> a u64 value, so the variable "addr" should be defined as u64 as well.
>
> Good catch.
>
> I would prefer if fdt_translate_address() returned resource_size_t (which
> is the proper type for handling addresses as integers) and that type
> was propagated through early_init_dt_scan_chosen_serial => of_setup_earlycon.

That can be problematic in the DT code. The size of resource_size_t
can vary on 32-bit as it is based on phys_addr_t which in turn is
based on CONFIG_LPAE setting. However, the address sizes in DT are
fixed and may be 64-bit. So we stick with u64 in the DT code.

Rob


\
 
 \ /
  Last update: 2015-10-27 22:01    [W:0.102 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site