[PATCH] acpi: acpidump: use size_t instead of int

Colin Ian King colin.king at canonical.com
Wed Apr 11 07:56:57 UTC 2012


On 11/04/12 02:45, Alex Hung wrote:
> On 04/10/2012 10:25 PM, Colin King wrote:
>> From: Colin Ian King<colin.king at canonical.com>
>>
>> Signed-off-by: Colin Ian King<colin.king at canonical.com>
>> ---
>> src/acpi/acpidump/acpidump.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
>> index 6b20ca7..c673768 100644
>> --- a/src/acpi/acpidump/acpidump.c
>> +++ b/src/acpi/acpidump/acpidump.c
>> @@ -665,7 +665,7 @@ static void acpidump_xsdt(fwts_framework *fw,
>> uint8_t *data, int length)
>> static void acpidump_madt(fwts_framework *fw, uint8_t *data, int length)
>> {
>> int i = 0;
>> - int n;
>> + size_t n;
>> int offset = 0;
>>
>> fwts_acpidump_field fields[] = {
>
> The variable n seems only used once:
> n = strlen(local_sapic->uid_string) + 1;
> skip = (sizeof(fwts_acpi_madt_local_sapic) + n);
>
> Will it be better to remove the variable and change it to
> skip = (sizeof(fwts_acpi_madt_local_sapic) +
> strlen(local_sapic->uid_string) + 1);
> and then we don't need to worry about its type?
>
I'm happy with that suggestion - I will tidy that up and re-submit once 
I've done my next round of changes.




More information about the fwts-devel mailing list