aboutsummaryrefslogtreecommitdiffstats
path: root/block/partitions
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-09-16 16:51:16 -0400
committerJens Axboe <axboe@fb.com>2014-09-27 18:48:55 -0400
commit582940508b5d589229d0232e0eeee8fef0d54809 (patch)
tree9327621c8d5f0411446335a338cdf03e803b570f /block/partitions
parent2341c2f8c33196d02cf5a721746eea4e3c06674a (diff)
block: Replace strnicmp with strncasecmp
The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users. To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g. Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/partitions')
-rw-r--r--block/partitions/mac.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/partitions/mac.c b/block/partitions/mac.c
index 76d8ba6379a9..c2c48ec64b27 100644
--- a/block/partitions/mac.c
+++ b/block/partitions/mac.c
@@ -81,7 +81,7 @@ int mac_partition(struct parsed_partitions *state)
81 be32_to_cpu(part->start_block) * (secsize/512), 81 be32_to_cpu(part->start_block) * (secsize/512),
82 be32_to_cpu(part->block_count) * (secsize/512)); 82 be32_to_cpu(part->block_count) * (secsize/512));
83 83
84 if (!strnicmp(part->type, "Linux_RAID", 10)) 84 if (!strncasecmp(part->type, "Linux_RAID", 10))
85 state->parts[slot].flags = ADDPART_FLAG_RAID; 85 state->parts[slot].flags = ADDPART_FLAG_RAID;
86#ifdef CONFIG_PPC_PMAC 86#ifdef CONFIG_PPC_PMAC
87 /* 87 /*
@@ -100,7 +100,7 @@ int mac_partition(struct parsed_partitions *state)
100 goodness++; 100 goodness++;
101 101
102 if (strcasecmp(part->type, "Apple_UNIX_SVR2") == 0 102 if (strcasecmp(part->type, "Apple_UNIX_SVR2") == 0
103 || (strnicmp(part->type, "Linux", 5) == 0 103 || (strncasecmp(part->type, "Linux", 5) == 0
104 && strcasecmp(part->type, "Linux_swap") != 0)) { 104 && strcasecmp(part->type, "Linux_swap") != 0)) {
105 int i, l; 105 int i, l;
106 106
@@ -109,13 +109,13 @@ int mac_partition(struct parsed_partitions *state)
109 if (strcmp(part->name, "/") == 0) 109 if (strcmp(part->name, "/") == 0)
110 goodness++; 110 goodness++;
111 for (i = 0; i <= l - 4; ++i) { 111 for (i = 0; i <= l - 4; ++i) {
112 if (strnicmp(part->name + i, "root", 112 if (strncasecmp(part->name + i, "root",
113 4) == 0) { 113 4) == 0) {
114 goodness += 2; 114 goodness += 2;
115 break; 115 break;
116 } 116 }
117 } 117 }
118 if (strnicmp(part->name, "swap", 4) == 0) 118 if (strncasecmp(part->name, "swap", 4) == 0)
119 goodness--; 119 goodness--;
120 } 120 }
121 121