Commit f08b4988f229fb41a4995829dc0db34c5e35dfbb

Authored by Cruz Julian Bishop
Committed by Linus Torvalds
1 parent 3f36f6100a

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>

Showing 1 changed file with 14 additions and 9 deletions Side-by-side Diff

... ... @@ -18,7 +18,7 @@
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,7 +123,8 @@
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;
... ... @@ -155,7 +156,8 @@
155 156  
156 157 while (*ip && ((len - NLS_MAX_CHARSET_SIZE) > 0)) {
157 158 ec = *ip++;
158   - if ((charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE)) > 0) {
  159 + charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE);
  160 + if (charlen > 0) {
159 161 op += charlen;
160 162 len -= charlen;
161 163 } else {
162 164  
... ... @@ -172,12 +174,12 @@
172 174 }
173 175  
174 176 if (unlikely(*ip)) {
175   - fat_msg(sb, KERN_WARNING, "filename was truncated while "
176   - "converting.");
  177 + fat_msg(sb, KERN_WARNING,
  178 + "filename was truncated while converting.");
177 179 }
178 180  
179 181 *op = 0;
180   - return (op - ascii);
  182 + return op - ascii;
181 183 }
182 184  
183 185 static inline int fat_uni_to_x8(struct super_block *sb, const wchar_t *uni,
... ... @@ -205,7 +207,8 @@
205 207 }
206 208  
207 209 static inline int
208   -fat_short2lower_uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *uni)
  210 +fat_short2lower_uni(struct nls_table *t, unsigned char *c,
  211 + int clen, wchar_t *uni)
209 212 {
210 213 int charlen;
211 214 wchar_t wc;
... ... @@ -220,7 +223,8 @@
220 223 if (!nc)
221 224 nc = *c;
222 225  
223   - if ( (charlen = t->char2uni(&nc, 1, uni)) < 0) {
  226 + charlen = t->char2uni(&nc, 1, uni);
  227 + if (charlen < 0) {
224 228 *uni = 0x003f; /* a question mark */
225 229 charlen = 1;
226 230 }
... ... @@ -573,7 +577,8 @@
573 577 /* Fake . and .. for the root directory. */
574 578 if (inode->i_ino == MSDOS_ROOT_INO) {
575 579 while (cpos < 2) {
576   - if (filldir(dirent, "..", cpos+1, cpos, MSDOS_ROOT_INO, DT_DIR) < 0)
  580 + if (filldir(dirent, "..", cpos+1, cpos,
  581 + MSDOS_ROOT_INO, DT_DIR) < 0)
577 582 goto out;
578 583 cpos++;
579 584 filp->f_pos++;