[PATCH] acpi: fan: fix cur_state comparison bugs
Keng-Yu Lin
kengyu at canonical.com
Mon May 20 07:41:01 UTC 2013
On Tue, May 7, 2013 at 5:14 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Coverity CID #997309: Same on both sides (CONSTANT_EXPRESSION_RESULT)
>
> Fix stupid typos where we are comparing info2->cur_state with itself
> rather than info1->cur_state.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/fan/fan.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/acpi/fan/fan.c b/src/acpi/fan/fan.c
> index 184da1a..3e61259 100644
> --- a/src/acpi/fan/fan.c
> +++ b/src/acpi/fan/fan.c
> @@ -216,13 +216,13 @@ static int fan_test2(fwts_framework *fw)
> info1->name, info1->cur_state, info2->cur_state);
> changed = true;
> }
> - if (info2->cur_state > info2->cur_state) {
> + if (info2->cur_state > info1->cur_state) {
> fwts_passed(fw, "Fan %s current state increased from %d to %d "
> "while CPUs were busy.",
> info1->name, info1->cur_state, info2->cur_state);
> changed = true;
> }
> - if (info2->cur_state == info2->cur_state)
> + if (info2->cur_state == info1->cur_state)
> fwts_log_info(fw, "Fan %s current state did not change from value %d "
> "while CPUs were busy.",
> info1->name, info1->cur_state);
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>
More information about the fwts-devel
mailing list