Skip to content

Commit c0abbdf

Browse files
bbkzzJaegeuk Kim
authored andcommitted
f2fs: convert is_extension_exist() to return bool type
is_extension_exist() only return two values, 0 or 1. So there is no need to use int type. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 1aa161e commit c0abbdf

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

fs/f2fs/namei.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,38 @@
2222
#include "acl.h"
2323
#include <trace/events/f2fs.h>
2424

25-
static inline int is_extension_exist(const unsigned char *s, const char *sub,
25+
static inline bool is_extension_exist(const unsigned char *s, const char *sub,
2626
bool tmp_ext)
2727
{
2828
size_t slen = strlen(s);
2929
size_t sublen = strlen(sub);
3030
int i;
3131

3232
if (sublen == 1 && *sub == '*')
33-
return 1;
33+
return true;
3434

3535
/*
3636
* filename format of multimedia file should be defined as:
3737
* "filename + '.' + extension + (optional: '.' + temp extension)".
3838
*/
3939
if (slen < sublen + 2)
40-
return 0;
40+
return false;
4141

4242
if (!tmp_ext) {
4343
/* file has no temp extension */
4444
if (s[slen - sublen - 1] != '.')
45-
return 0;
45+
return false;
4646
return !strncasecmp(s + slen - sublen, sub, sublen);
4747
}
4848

4949
for (i = 1; i < slen - sublen; i++) {
5050
if (s[i] != '.')
5151
continue;
5252
if (!strncasecmp(s + i + 1, sub, sublen))
53-
return 1;
53+
return true;
5454
}
5555

56-
return 0;
56+
return false;
5757
}
5858

5959
int f2fs_update_extension_list(struct f2fs_sb_info *sbi, const char *name,

0 commit comments

Comments
 (0)