On Wed, 2006-11-22 at 17:59 -0200, Henrique de Moraes Holschuh wrote:
> From: Henrique de Moraes Holschuh <hm...@hm...>
>
> - if (!acpi_evalf(gfan_handle, &s, NULL, "d"))
> + if (unlikely(!acpi_evalf(gfan_handle, &status, NULL, "d")))
> - if (!acpi_ec_read(fan_status_offset, &status))
> - len += sprintf(p + len, "status:\t\tunreadable\n");
> + if (unlikely(!acpi_ec_read(fan_status_offset, &status)))
> + return -EIO;
> - if (!acpi_ec_read(fan_rpm_offset, &lo) ||
> - !acpi_ec_read(fan_rpm_offset + 1, &hi))
> - len += sprintf(p + len, "speed:\t\tunreadable\n");
> + if (unlikely(!acpi_ec_read(fan_rpm_offset, &lo) ||
> + !acpi_ec_read(fan_rpm_offset + 1, &hi)))
> + return -EIO;
Hmm, just one little thing, which is probably not worth modifying.
AFAIK likely/unlikely is only used at often processed optimized code.
It might make sense here in general, but is normally not used for better
reading and as it's just not worth it.
I might be wrong and someone wants to correct me, it's just that other
kernel parts don't show these often.
Thomas
|