[PATCH] cpupowerutils: don't compare pointers with 0

From: Sasha Levin
Date: Thu Dec 20 2012 - 14:16:02 EST


Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/