[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-ppc] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure |
Date: |
Tue, 6 Sep 2016 16:51:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hello Sam,
>> + }
>> +#define MAX_COMPATIBLE_PROP 1024
>> + cp = p = g_malloc0(MAX_COMPATIBLE_PROP);
>> + i = 0;
>> + while ((p - cp) < MAX_COMPATIBLE_PROP) {
>> + int l;
>> + if (xc->dt_compatible[i] == NULL) {
>> + break;
>> + }
>> + l = strlen(xc->dt_compatible[i]);
>> + if (l >= (MAX_COMPATIBLE_PROP - i)) {
>
> The use of 'i' above doesn't look right. Should the check be more like this?
> if ((l + 1) >= (MAX_COMPATIBLE_PROP - (p - cp))) {
David just proposed to move the compatible property setting in the
devnode op of the device, and so all this code should disappear at
the same time.
Thanks,
C.
>> + break;
>> + }
>> + strcpy(p, xc->dt_compatible[i++]);
>> + p += l + 1;
>> + }
>> + _FDT((fdt_setprop(fdt, child_offset, "compatible", cp, p - cp)));
>> + }
>> +
>> + return 0;
>> +}
>> +
- Re: [Qemu-ppc] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure, (continued)
Re: [Qemu-ppc] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure, Sam Bobroff, 2016/09/05
- Re: [Qemu-ppc] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure,
Cédric Le Goater <=