Fix a few other static code checker spotted "issues"
authorJens Axboe <axboe@kernel.dk>
Thu, 9 Feb 2012 20:17:06 +0000 (21:17 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 9 Feb 2012 20:17:06 +0000 (21:17 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
crc/crc32c-intel.c
fifo.c
parse.c

index 969a037..5040efe 100644 (file)
@@ -28,8 +28,8 @@
 #define SCALE_F 4
 #endif
 
-uint32_t crc32c_intel_le_hw_byte(uint32_t crc, unsigned char const *data,
-                                unsigned long length)
+static uint32_t crc32c_intel_le_hw_byte(uint32_t crc, unsigned char const *data,
+                                       unsigned long length)
 {
        while (length--) {
                __asm__ __volatile__(
diff --git a/fifo.c b/fifo.c
index de03184..81d13b5 100644 (file)
--- a/fifo.c
+++ b/fifo.c
@@ -31,7 +31,7 @@ struct fifo *fifo_alloc(unsigned int size)
 
        fifo = malloc(sizeof(struct fifo));
        if (!fifo)
-               return 0;
+               return NULL;
 
        fifo->buffer = malloc(size);
        fifo->size = size;
diff --git a/parse.c b/parse.c
index 6ea7c10..f1d5f8f 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -220,7 +220,7 @@ static unsigned long long get_mult_bytes(const char *str, int len, void *data,
 /*
  * Convert string into a floating number. Return 1 for success and 0 otherwise.
  */
-int str_to_float(const char *str, double *val)
+static int str_to_float(const char *str, double *val)
 {
        return (1 == sscanf(str, "%lf", val));
 }