On 21.07.2023 18:53, Shawn Anastasio wrote:
> On 7/19/23 9:05 AM, Jan Beulich wrote:
>> On 18.07.2023 22:20, Shawn Anastasio wrote:
>>> +void __init boot_of_init(unsigned long vec)
>>> +{
>>> +    int bof_chosen;
>>> +
>>> +    of_vec = vec;
>>> +
>>> +    /* Get a handle to the default console */
>>> +    bof_chosen = of_finddevice("/chosen");
>>> +    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
>>> +    of_out = be32_to_cpu(of_out);
>>
>> Can any of these fail, and hence lead to ...
> 
> These calls are allowed to fail, but their return value in those cases
> is well-defined (an invalid handle), so...
> 
>>
>>> +    early_printk_init(of_putchar);
>>
>> ... this better not getting invoked?
> 
> this being invoked is fine even in those cases. It will just result in
> the invalid handle being passed to of_write and the firmware will refuse
> to service the writes.

I assumed all this to be the case; the question was more towards "Wouldn't
it make sense to avoid installing the function pointer in such a case?"

Jan

Reply via email to