Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs/fat: fix all other checkpatch issues in dir.c

1: Import linux/uaccess.h instead of asm.uaccess.h
2: Stop any lines going over 80 characters
3: Stopped setting any variables in if statements
4: Stopped splitting quoted strings
5: Removed unneeded parentheses

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Cruz Julian Bishop and committed by
Linus Torvalds
f08b4988 3f36f610

+14 -9
+14 -9
fs/fat/dir.c
··· 18 18 #include <linux/time.h> 19 19 #include <linux/buffer_head.h> 20 20 #include <linux/compat.h> 21 - #include <asm/uaccess.h> 21 + #include <linux/uaccess.h> 22 22 #include <linux/kernel.h> 23 23 #include "fat.h" 24 24 ··· 123 123 { 124 124 /* Fast stuff first */ 125 125 if (*bh && *de && 126 - (*de - (struct msdos_dir_entry *)(*bh)->b_data) < MSDOS_SB(dir->i_sb)->dir_per_block - 1) { 126 + (*de - (struct msdos_dir_entry *)(*bh)->b_data) < 127 + MSDOS_SB(dir->i_sb)->dir_per_block - 1) { 127 128 *pos += sizeof(struct msdos_dir_entry); 128 129 (*de)++; 129 130 return 0; ··· 156 155 157 156 while (*ip && ((len - NLS_MAX_CHARSET_SIZE) > 0)) { 158 157 ec = *ip++; 159 - if ((charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE)) > 0) { 158 + charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE); 159 + if (charlen > 0) { 160 160 op += charlen; 161 161 len -= charlen; 162 162 } else { ··· 174 172 } 175 173 176 174 if (unlikely(*ip)) { 177 - fat_msg(sb, KERN_WARNING, "filename was truncated while " 178 - "converting."); 175 + fat_msg(sb, KERN_WARNING, 176 + "filename was truncated while converting."); 179 177 } 180 178 181 179 *op = 0; 182 - return (op - ascii); 180 + return op - ascii; 183 181 } 184 182 185 183 static inline int fat_uni_to_x8(struct super_block *sb, const wchar_t *uni, ··· 207 205 } 208 206 209 207 static inline int 210 - fat_short2lower_uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *uni) 208 + fat_short2lower_uni(struct nls_table *t, unsigned char *c, 209 + int clen, wchar_t *uni) 211 210 { 212 211 int charlen; 213 212 wchar_t wc; ··· 223 220 if (!nc) 224 221 nc = *c; 225 222 226 - if ( (charlen = t->char2uni(&nc, 1, uni)) < 0) { 223 + charlen = t->char2uni(&nc, 1, uni); 224 + if (charlen < 0) { 227 225 *uni = 0x003f; /* a question mark */ 228 226 charlen = 1; 229 227 } ··· 577 573 /* Fake . and .. for the root directory. */ 578 574 if (inode->i_ino == MSDOS_ROOT_INO) { 579 575 while (cpos < 2) { 580 - if (filldir(dirent, "..", cpos+1, cpos, MSDOS_ROOT_INO, DT_DIR) < 0) 576 + if (filldir(dirent, "..", cpos+1, cpos, 577 + MSDOS_ROOT_INO, DT_DIR) < 0) 581 578 goto out; 582 579 cpos++; 583 580 filp->f_pos++;