Skip to content

Commit

Permalink
Revert "staging: fsl-mc: be consistent when checking strcmp() return"
Browse files Browse the repository at this point in the history
The previous fix removed the equal to zero comparisons by the strcmps and
now the function always returns true. Revert this change to restore the
original correctly functioning code.

Detected by CoverityScan, CID#1452267 ("Constant expression result")

This reverts commit b93ad9a.

Fixes: b93ad9a ("staging: fsl-mc: be consistent when checking strcmp() return")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Colin Ian King authored and Greg Kroah-Hartman committed Aug 16, 2017
1 parent ef95484 commit 47f0783
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

static bool __must_check fsl_mc_is_allocatable(const char *obj_type)
{
return strcmp(obj_type, "dpbp") ||
strcmp(obj_type, "dpmcp") ||
strcmp(obj_type, "dpcon");
return strcmp(obj_type, "dpbp") == 0 ||
strcmp(obj_type, "dpmcp") == 0 ||
strcmp(obj_type, "dpcon") == 0;
}

/**
Expand Down

0 comments on commit 47f0783

Please sign in to comment.