[Skiboot] [PATCH 1/3] hdata: Don't use printf

Oliver O'Halloran oohall at gmail.com
Tue May 16 15:36:08 AEST 2017


On Tue, May 16, 2017 at 2:50 PM, Vasant Hegde
<hegdevasant at linux.vnet.ibm.com> wrote:
> On 05/15/2017 01:50 PM, Oliver O'Halloran wrote:
>>
>> Using printf() here results in the output going into the stdout stream
>> when running the hdata_to_dt test. This results in an invalid dtb output
>> so lets not do that.
>>
>> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
>> ---
>>  hdata/iohub.c | 3 ++-
>>  hdata/paca.c  | 4 ++--
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/hdata/iohub.c b/hdata/iohub.c
>> index 0e7ef65f9101..c0b9bf802efb 100644
>> --- a/hdata/iohub.c
>> +++ b/hdata/iohub.c
>> @@ -380,7 +380,8 @@ static struct dt_node *io_add_p9(const struct
>> cechub_io_hub *hub,
>>                 return NULL;
>>         }
>>
>> -       printf("IOHUB: PHB4 active bridge mask %x\n", (u32)
>> hub->fab_br0_pdt);
>> +       prlog(PR_DEBUG, "IOHUB: PHB4 active bridge mask %x\n",
>> +               (u32) hub->fab_br0_pdt);
>>
>>         /* Create PBCQs */
>>         io_add_phb4(hub, sp_iohubs, xscom, 0, 1, 0);
>> diff --git a/hdata/paca.c b/hdata/paca.c
>> index 1938d4affbeb..eaad0d4de432 100644
>> --- a/hdata/paca.c
>> +++ b/hdata/paca.c
>> @@ -49,7 +49,7 @@ static struct dt_node *add_cpu_node(struct dt_node
>> *cpus,
>>         no = be32_to_cpu(id->process_interrupt_line);
>>
>>         ve_flags = be32_to_cpu(id->verify_exists_flags);
>> -       printf("CPU[%i]: PIR=%i RES=%i %s %s(%u threads)\n",
>> +       prlog(PR_INFO, "CPU[%i]: PIR=%i RES=%i %s %s(%u threads)\n",
>>                paca_index(paca), be32_to_cpu(id->pir), no,
>>                ve_flags & CPU_ID_PACA_RESERVED
>>                ? "**RESERVED**" : cpu_state(ve_flags),
>> @@ -251,7 +251,7 @@ static bool __paca_parse(void)
>>                         okay = false;
>>                 }
>>
>> -               printf("CPU[%i]: PIR=%i RES=%i %s\n",
>> +               prlog(PR_INFO, "CPU[%i]: PIR=%i RES=%i %s\n",
>
>
> May be we should make it as PR_DEBUG. But PACA is deprecated anyway.  So
> doesn't make much difference.  Otherwise patch looks good to me.

Using the named constants would be better, but it would required
pulling skiboot.h into stubs.c and I'm not keen to spend more time
fighting with header files. Patches welcome! ;)

>
>  Reviewed-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
>
> -Vasant
>


More information about the Skiboot mailing list