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 969a037f942d24e9509b11217fd3123e01658aea..5040efeae9030005af296bfa72c07414535144a4 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 de0318414ad45aea2ba11326ccf2405756c9c5b1..81d13b57ea5aa16ccb41d7930c7fb703dbc269b1 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 6ea7c103c0973a259ec6227355161e5139a63025..f1d5f8f8a72922a85d511528b58f9796c77c337b 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));
 }