crc: ensure we properly match test name
authorJens Axboe <axboe@fb.com>
Sat, 8 Feb 2014 03:52:32 +0000 (20:52 -0700)
committerJens Axboe <axboe@fb.com>
Sat, 8 Feb 2014 03:52:32 +0000 (20:52 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
crc/test.c

index 2ea4f3d781e3403d43a7fbce6c30fe6b56f29940..5812b358a65e8f6d14ae93fd57d0a7c1d5bd2567 100644 (file)
@@ -17,8 +17,8 @@
 #include "../crc/sha256.h"
 #include "../crc/sha512.h"
 
-#define CHUNK          131072
-#define NR_CHUNKS        2048
+#define CHUNK          131072U
+#define NR_CHUNKS        2048U
 
 struct test_type {
        const char *name;
@@ -295,7 +295,7 @@ static unsigned int get_test_mask(const char *type)
        mask = 0;
        while ((name = strsep(&str, ",")) != NULL) {
                for (i = 0; t[i].name; i++) {
-                       if (!strncmp(t[i].name, name, strlen(t[i].name))) {
+                       if (!strcmp(t[i].name, name)) {
                                mask |= t[i].mask;
                                break;
                        }