| From | Sasha Levin <> | Subject | [PATCH] cpupowerutils: don't compare pointers with 0 | Date | Thu, 20 Dec 2012 14:11:17 -0500 |
| |
Signed-off-by: Sasha Levin <sasha.levin@oracle.com> --- tools/power/cpupower/utils/helpers/bitmask.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/power/cpupower/utils/helpers/bitmask.c b/tools/power/cpupower/utils/helpers/bitmask.c index 5c074c6..3b6e03d 100644 --- a/tools/power/cpupower/utils/helpers/bitmask.c +++ b/tools/power/cpupower/utils/helpers/bitmask.c @@ -25,11 +25,11 @@ struct bitmask *bitmask_alloc(unsigned int n) struct bitmask *bmp; bmp = malloc(sizeof(*bmp)); - if (bmp == 0) + if (bmp == NULL) return 0; bmp->size = n; bmp->maskp = calloc(longsperbits(n), sizeof(unsigned long)); - if (bmp->maskp == 0) { + if (bmp->maskp == NULL) { free(bmp); return 0; } @@ -39,7 +39,7 @@ struct bitmask *bitmask_alloc(unsigned int n) /* Free `struct bitmask` */ void bitmask_free(struct bitmask *bmp) { - if (bmp == 0) + if (bmp == NULL) return; free(bmp->maskp); bmp->maskp = (unsigned long *)0xdeadcdef; /* double free tripwire */ -- 1.8.0
|