Commit 62b80719 authored by Luis de Bethencourt's avatar Luis de Bethencourt

befs: fix style issues in linuxvfs.c

Fix the following type of checkpatch.pl issues:
WARNING: line over 80 characters
+static struct dentry *befs_lookup(struct inode *, struct dentry *, unsigned int);

ERROR: code indent should use tabs where possible
+        if (!bi)$

WARNING: please, no spaces at the start of a line
+        if (!bi)$

WARNING: labels should not be indented
+      unacquire_bh:

WARNING: space prohibited between function name and open parenthesis '('
+                                             sizeof (struct befs_inode_info),

WARNING: braces {} are not necessary for single statement blocks
+       if (!*out) {
+               return -ENOMEM;
+       }

WARNING: Block comments use a trailing */ on a separate line
+        * in special cases */

WARNING: Missing a blank line after declarations
+               int token;
+               if (!*p)

ERROR: do not use assignment in if condition
+       if (!(bh = sb_bread(sb, sb_block))) {

ERROR: space prohibited after that open parenthesis '('
+       if( befs_sb->num_blocks > ~((sector_t)0) ) {

ERROR: space prohibited before that close parenthesis ')'
+       if( befs_sb->num_blocks > ~((sector_t)0) ) {

ERROR: space required before the open parenthesis '('
+       if( befs_sb->num_blocks > ~((sector_t)0) ) {
Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
parent 1ca7087e
...@@ -37,7 +37,8 @@ static int befs_readdir(struct file *, struct dir_context *); ...@@ -37,7 +37,8 @@ static int befs_readdir(struct file *, struct dir_context *);
static int befs_get_block(struct inode *, sector_t, struct buffer_head *, int); static int befs_get_block(struct inode *, sector_t, struct buffer_head *, int);
static int befs_readpage(struct file *file, struct page *page); static int befs_readpage(struct file *file, struct page *page);
static sector_t befs_bmap(struct address_space *mapping, sector_t block); static sector_t befs_bmap(struct address_space *mapping, sector_t block);
static struct dentry *befs_lookup(struct inode *, struct dentry *, unsigned int); static struct dentry *befs_lookup(struct inode *, struct dentry *,
unsigned int);
static struct inode *befs_iget(struct super_block *, unsigned long); static struct inode *befs_iget(struct super_block *, unsigned long);
static struct inode *befs_alloc_inode(struct super_block *sb); static struct inode *befs_alloc_inode(struct super_block *sb);
static void befs_destroy_inode(struct inode *inode); static void befs_destroy_inode(struct inode *inode);
...@@ -269,15 +270,15 @@ befs_alloc_inode(struct super_block *sb) ...@@ -269,15 +270,15 @@ befs_alloc_inode(struct super_block *sb)
struct befs_inode_info *bi; struct befs_inode_info *bi;
bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL); bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL);
if (!bi) if (!bi)
return NULL; return NULL;
return &bi->vfs_inode; return &bi->vfs_inode;
} }
static void befs_i_callback(struct rcu_head *head) static void befs_i_callback(struct rcu_head *head)
{ {
struct inode *inode = container_of(head, struct inode, i_rcu); struct inode *inode = container_of(head, struct inode, i_rcu);
kmem_cache_free(befs_inode_cachep, BEFS_I(inode)); kmem_cache_free(befs_inode_cachep, BEFS_I(inode));
} }
static void befs_destroy_inode(struct inode *inode) static void befs_destroy_inode(struct inode *inode)
...@@ -287,7 +288,7 @@ static void befs_destroy_inode(struct inode *inode) ...@@ -287,7 +288,7 @@ static void befs_destroy_inode(struct inode *inode)
static void init_once(void *foo) static void init_once(void *foo)
{ {
struct befs_inode_info *bi = (struct befs_inode_info *) foo; struct befs_inode_info *bi = (struct befs_inode_info *) foo;
inode_init_once(&bi->vfs_inode); inode_init_once(&bi->vfs_inode);
} }
...@@ -414,10 +415,10 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) ...@@ -414,10 +415,10 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
unlock_new_inode(inode); unlock_new_inode(inode);
return inode; return inode;
unacquire_bh: unacquire_bh:
brelse(bh); brelse(bh);
unacquire_none: unacquire_none:
iget_failed(inode); iget_failed(inode);
befs_debug(sb, "<--- %s - Bad inode", __func__); befs_debug(sb, "<--- %s - Bad inode", __func__);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
...@@ -518,9 +519,8 @@ befs_utf2nls(struct super_block *sb, const char *in, ...@@ -518,9 +519,8 @@ befs_utf2nls(struct super_block *sb, const char *in,
} }
*out = result = kmalloc(maxlen, GFP_NOFS); *out = result = kmalloc(maxlen, GFP_NOFS);
if (!*out) { if (!*out)
return -ENOMEM; return -ENOMEM;
}
for (i = o = 0; i < in_len; i += utflen, o += unilen) { for (i = o = 0; i < in_len; i += utflen, o += unilen) {
...@@ -543,7 +543,7 @@ befs_utf2nls(struct super_block *sb, const char *in, ...@@ -543,7 +543,7 @@ befs_utf2nls(struct super_block *sb, const char *in,
return o; return o;
conv_err: conv_err:
befs_error(sb, "Name using character set %s contains a character that " befs_error(sb, "Name using character set %s contains a character that "
"cannot be converted to unicode.", nls->charset); "cannot be converted to unicode.", nls->charset);
befs_debug(sb, "<--- %s", __func__); befs_debug(sb, "<--- %s", __func__);
...@@ -585,7 +585,8 @@ befs_nls2utf(struct super_block *sb, const char *in, ...@@ -585,7 +585,8 @@ befs_nls2utf(struct super_block *sb, const char *in,
/* /*
* There are nls characters that will translate to 3-chars-wide UTF-8 * There are nls characters that will translate to 3-chars-wide UTF-8
* characters, an additional byte is needed to save the final \0 * characters, an additional byte is needed to save the final \0
* in special cases */ * in special cases
*/
int maxlen = (3 * in_len) + 1; int maxlen = (3 * in_len) + 1;
befs_debug(sb, "---> %s\n", __func__); befs_debug(sb, "---> %s\n", __func__);
...@@ -622,7 +623,7 @@ befs_nls2utf(struct super_block *sb, const char *in, ...@@ -622,7 +623,7 @@ befs_nls2utf(struct super_block *sb, const char *in,
return i; return i;
conv_err: conv_err:
befs_error(sb, "Name using character set %s contains a character that " befs_error(sb, "Name using character set %s contains a character that "
"cannot be converted to unicode.", nls->charset); "cannot be converted to unicode.", nls->charset);
befs_debug(sb, "<--- %s", __func__); befs_debug(sb, "<--- %s", __func__);
...@@ -664,6 +665,7 @@ parse_options(char *options, struct befs_mount_options *opts) ...@@ -664,6 +665,7 @@ parse_options(char *options, struct befs_mount_options *opts)
while ((p = strsep(&options, ",")) != NULL) { while ((p = strsep(&options, ",")) != NULL) {
int token; int token;
if (!*p) if (!*p)
continue; continue;
...@@ -789,7 +791,8 @@ befs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -789,7 +791,8 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
goto unacquire_priv_sbp; goto unacquire_priv_sbp;
} }
if (!(bh = sb_bread(sb, sb_block))) { bh = sb_bread(sb, sb_block);
if (!bh) {
if (!silent) if (!silent)
befs_error(sb, "unable to read superblock"); befs_error(sb, "unable to read superblock");
goto unacquire_priv_sbp; goto unacquire_priv_sbp;
...@@ -814,7 +817,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -814,7 +817,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
brelse(bh); brelse(bh);
if( befs_sb->num_blocks > ~((sector_t)0) ) { if (befs_sb->num_blocks > ~((sector_t)0)) {
if (!silent) if (!silent)
befs_error(sb, "blocks count: %llu is larger than the host can use", befs_error(sb, "blocks count: %llu is larger than the host can use",
befs_sb->num_blocks); befs_sb->num_blocks);
...@@ -859,16 +862,16 @@ befs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -859,16 +862,16 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
} }
return 0; return 0;
/*****************/
unacquire_bh: unacquire_bh:
brelse(bh); brelse(bh);
unacquire_priv_sbp: unacquire_priv_sbp:
kfree(befs_sb->mount_opts.iocharset); kfree(befs_sb->mount_opts.iocharset);
kfree(sb->s_fs_info); kfree(sb->s_fs_info);
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
unacquire_none: unacquire_none:
return ret; return ret;
} }
...@@ -954,9 +957,9 @@ exit_befs_fs(void) ...@@ -954,9 +957,9 @@ exit_befs_fs(void)
} }
/* /*
Macros that typecheck the init and exit functions, * Macros that typecheck the init and exit functions,
ensures that they are called at init and cleanup, * ensures that they are called at init and cleanup,
and eliminates warnings about unused functions. * and eliminates warnings about unused functions.
*/ */
module_init(init_befs_fs) module_init(init_befs_fs)
module_exit(exit_befs_fs) module_exit(exit_befs_fs)
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