Commit f08b4988 authored by Cruz Julian Bishop's avatar Cruz Julian Bishop Committed by Linus Torvalds

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: default avatarCruz Julian Bishop <cruzjbishop@gmail.com>
Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3f36f610
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/time.h> #include <linux/time.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include "fat.h" #include "fat.h"
...@@ -123,7 +123,8 @@ static inline int fat_get_entry(struct inode *dir, loff_t *pos, ...@@ -123,7 +123,8 @@ static inline int fat_get_entry(struct inode *dir, loff_t *pos,
{ {
/* Fast stuff first */ /* Fast stuff first */
if (*bh && *de && if (*bh && *de &&
(*de - (struct msdos_dir_entry *)(*bh)->b_data) < MSDOS_SB(dir->i_sb)->dir_per_block - 1) { (*de - (struct msdos_dir_entry *)(*bh)->b_data) <
MSDOS_SB(dir->i_sb)->dir_per_block - 1) {
*pos += sizeof(struct msdos_dir_entry); *pos += sizeof(struct msdos_dir_entry);
(*de)++; (*de)++;
return 0; return 0;
...@@ -155,7 +156,8 @@ static int uni16_to_x8(struct super_block *sb, unsigned char *ascii, ...@@ -155,7 +156,8 @@ static int uni16_to_x8(struct super_block *sb, unsigned char *ascii,
while (*ip && ((len - NLS_MAX_CHARSET_SIZE) > 0)) { while (*ip && ((len - NLS_MAX_CHARSET_SIZE) > 0)) {
ec = *ip++; ec = *ip++;
if ((charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE)) > 0) { charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE);
if (charlen > 0) {
op += charlen; op += charlen;
len -= charlen; len -= charlen;
} else { } else {
...@@ -172,12 +174,12 @@ static int uni16_to_x8(struct super_block *sb, unsigned char *ascii, ...@@ -172,12 +174,12 @@ static int uni16_to_x8(struct super_block *sb, unsigned char *ascii,
} }
if (unlikely(*ip)) { if (unlikely(*ip)) {
fat_msg(sb, KERN_WARNING, "filename was truncated while " fat_msg(sb, KERN_WARNING,
"converting."); "filename was truncated while converting.");
} }
*op = 0; *op = 0;
return (op - ascii); return op - ascii;
} }
static inline int fat_uni_to_x8(struct super_block *sb, const wchar_t *uni, static inline int fat_uni_to_x8(struct super_block *sb, const wchar_t *uni,
...@@ -205,7 +207,8 @@ fat_short2uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *uni) ...@@ -205,7 +207,8 @@ fat_short2uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *uni)
} }
static inline int static inline int
fat_short2lower_uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *uni) fat_short2lower_uni(struct nls_table *t, unsigned char *c,
int clen, wchar_t *uni)
{ {
int charlen; int charlen;
wchar_t wc; wchar_t wc;
...@@ -220,7 +223,8 @@ fat_short2lower_uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *un ...@@ -220,7 +223,8 @@ fat_short2lower_uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *un
if (!nc) if (!nc)
nc = *c; nc = *c;
if ( (charlen = t->char2uni(&nc, 1, uni)) < 0) { charlen = t->char2uni(&nc, 1, uni);
if (charlen < 0) {
*uni = 0x003f; /* a question mark */ *uni = 0x003f; /* a question mark */
charlen = 1; charlen = 1;
} }
...@@ -573,7 +577,8 @@ static int __fat_readdir(struct inode *inode, struct file *filp, void *dirent, ...@@ -573,7 +577,8 @@ static int __fat_readdir(struct inode *inode, struct file *filp, void *dirent,
/* Fake . and .. for the root directory. */ /* Fake . and .. for the root directory. */
if (inode->i_ino == MSDOS_ROOT_INO) { if (inode->i_ino == MSDOS_ROOT_INO) {
while (cpos < 2) { while (cpos < 2) {
if (filldir(dirent, "..", cpos+1, cpos, MSDOS_ROOT_INO, DT_DIR) < 0) if (filldir(dirent, "..", cpos+1, cpos,
MSDOS_ROOT_INO, DT_DIR) < 0)
goto out; goto out;
cpos++; cpos++;
filp->f_pos++; filp->f_pos++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment