summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorGu Zheng <guz.fnst@cn.fujitsu.com>2013-08-22 18:11:25 +0800
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-08-27 21:50:12 +0900
commit749ebfd174bd6fca3083da5f1e7933cbd60316c9 (patch)
tree4a644edddeade064deb652523995c3603b5bb5ef /fs/f2fs
parent8cb82688097b300dd3f107c3e19c92662fba5359 (diff)
f2fs: use strncasecmp() simplify the string comparison
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/namei.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 7e43f6829af..2a5359c990f 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -83,21 +83,11 @@ static int is_multimedia_file(const unsigned char *s, const char *sub)
{
size_t slen = strlen(s);
size_t sublen = strlen(sub);
- int ret;
if (sublen > slen)
return 0;
- ret = memcmp(s + slen - sublen, sub, sublen);
- if (ret) { /* compare upper case */
- int i;
- char upper_sub[8];
- for (i = 0; i < sublen && i < sizeof(upper_sub); i++)
- upper_sub[i] = toupper(sub[i]);
- return !memcmp(s + slen - sublen, upper_sub, sublen);
- }
-
- return !ret;
+ return !strncasecmp(s + slen - sublen, sub, sublen);
}
/*