aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis de Bethencourt <luisbg@osg.samsung.com>2016-08-14 12:59:11 -0400
committerLuis de Bethencourt <luisbg@osg.samsung.com>2016-12-22 06:25:21 -0500
commit62b80719dfe126f73e417d7011dfb5ef53c6a203 (patch)
treec71a7c6a295a3b22d6b55815704eb450c71f98bb
parent1ca7087e59cba48a58bf5e6594a67e8ccbead7e2 (diff)
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: Luis de Bethencourt <luisbg@osg.samsung.com>
-rw-r--r--fs/befs/linuxvfs.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 42a566d37298..25283f2cbe1f 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -37,7 +37,8 @@ static int befs_readdir(struct file *, struct dir_context *);
37static int befs_get_block(struct inode *, sector_t, struct buffer_head *, int); 37static int befs_get_block(struct inode *, sector_t, struct buffer_head *, int);
38static int befs_readpage(struct file *file, struct page *page); 38static int befs_readpage(struct file *file, struct page *page);
39static sector_t befs_bmap(struct address_space *mapping, sector_t block); 39static sector_t befs_bmap(struct address_space *mapping, sector_t block);
40static struct dentry *befs_lookup(struct inode *, struct dentry *, unsigned int); 40static struct dentry *befs_lookup(struct inode *, struct dentry *,
41 unsigned int);
41static struct inode *befs_iget(struct super_block *, unsigned long); 42static struct inode *befs_iget(struct super_block *, unsigned long);
42static struct inode *befs_alloc_inode(struct super_block *sb); 43static struct inode *befs_alloc_inode(struct super_block *sb);
43static void befs_destroy_inode(struct inode *inode); 44static void befs_destroy_inode(struct inode *inode);
@@ -269,15 +270,15 @@ befs_alloc_inode(struct super_block *sb)
269 struct befs_inode_info *bi; 270 struct befs_inode_info *bi;
270 271
271 bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL); 272 bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL);
272 if (!bi) 273 if (!bi)
273 return NULL; 274 return NULL;
274 return &bi->vfs_inode; 275 return &bi->vfs_inode;
275} 276}
276 277
277static void befs_i_callback(struct rcu_head *head) 278static void befs_i_callback(struct rcu_head *head)
278{ 279{
279 struct inode *inode = container_of(head, struct inode, i_rcu); 280 struct inode *inode = container_of(head, struct inode, i_rcu);
280 kmem_cache_free(befs_inode_cachep, BEFS_I(inode)); 281 kmem_cache_free(befs_inode_cachep, BEFS_I(inode));
281} 282}
282 283
283static void befs_destroy_inode(struct inode *inode) 284static void befs_destroy_inode(struct inode *inode)
@@ -287,7 +288,7 @@ static void befs_destroy_inode(struct inode *inode)
287 288
288static void init_once(void *foo) 289static void init_once(void *foo)
289{ 290{
290 struct befs_inode_info *bi = (struct befs_inode_info *) foo; 291 struct befs_inode_info *bi = (struct befs_inode_info *) foo;
291 292
292 inode_init_once(&bi->vfs_inode); 293 inode_init_once(&bi->vfs_inode);
293} 294}
@@ -414,10 +415,10 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
414 unlock_new_inode(inode); 415 unlock_new_inode(inode);
415 return inode; 416 return inode;
416 417
417 unacquire_bh: 418unacquire_bh:
418 brelse(bh); 419 brelse(bh);
419 420
420 unacquire_none: 421unacquire_none:
421 iget_failed(inode); 422 iget_failed(inode);
422 befs_debug(sb, "<--- %s - Bad inode", __func__); 423 befs_debug(sb, "<--- %s - Bad inode", __func__);
423 return ERR_PTR(-EIO); 424 return ERR_PTR(-EIO);
@@ -518,9 +519,8 @@ befs_utf2nls(struct super_block *sb, const char *in,
518 } 519 }
519 520
520 *out = result = kmalloc(maxlen, GFP_NOFS); 521 *out = result = kmalloc(maxlen, GFP_NOFS);
521 if (!*out) { 522 if (!*out)
522 return -ENOMEM; 523 return -ENOMEM;
523 }
524 524
525 for (i = o = 0; i < in_len; i += utflen, o += unilen) { 525 for (i = o = 0; i < in_len; i += utflen, o += unilen) {
526 526
@@ -543,7 +543,7 @@ befs_utf2nls(struct super_block *sb, const char *in,
543 543
544 return o; 544 return o;
545 545
546 conv_err: 546conv_err:
547 befs_error(sb, "Name using character set %s contains a character that " 547 befs_error(sb, "Name using character set %s contains a character that "
548 "cannot be converted to unicode.", nls->charset); 548 "cannot be converted to unicode.", nls->charset);
549 befs_debug(sb, "<--- %s", __func__); 549 befs_debug(sb, "<--- %s", __func__);
@@ -585,7 +585,8 @@ befs_nls2utf(struct super_block *sb, const char *in,
585 /* 585 /*
586 * There are nls characters that will translate to 3-chars-wide UTF-8 586 * There are nls characters that will translate to 3-chars-wide UTF-8
587 * characters, an additional byte is needed to save the final \0 587 * characters, an additional byte is needed to save the final \0
588 * in special cases */ 588 * in special cases
589 */
589 int maxlen = (3 * in_len) + 1; 590 int maxlen = (3 * in_len) + 1;
590 591
591 befs_debug(sb, "---> %s\n", __func__); 592 befs_debug(sb, "---> %s\n", __func__);
@@ -622,7 +623,7 @@ befs_nls2utf(struct super_block *sb, const char *in,
622 623
623 return i; 624 return i;
624 625
625 conv_err: 626conv_err:
626 befs_error(sb, "Name using character set %s contains a character that " 627 befs_error(sb, "Name using character set %s contains a character that "
627 "cannot be converted to unicode.", nls->charset); 628 "cannot be converted to unicode.", nls->charset);
628 befs_debug(sb, "<--- %s", __func__); 629 befs_debug(sb, "<--- %s", __func__);
@@ -664,6 +665,7 @@ parse_options(char *options, struct befs_mount_options *opts)
664 665
665 while ((p = strsep(&options, ",")) != NULL) { 666 while ((p = strsep(&options, ",")) != NULL) {
666 int token; 667 int token;
668
667 if (!*p) 669 if (!*p)
668 continue; 670 continue;
669 671
@@ -789,7 +791,8 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
789 goto unacquire_priv_sbp; 791 goto unacquire_priv_sbp;
790 } 792 }
791 793
792 if (!(bh = sb_bread(sb, sb_block))) { 794 bh = sb_bread(sb, sb_block);
795 if (!bh) {
793 if (!silent) 796 if (!silent)
794 befs_error(sb, "unable to read superblock"); 797 befs_error(sb, "unable to read superblock");
795 goto unacquire_priv_sbp; 798 goto unacquire_priv_sbp;
@@ -814,7 +817,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
814 817
815 brelse(bh); 818 brelse(bh);
816 819
817 if( befs_sb->num_blocks > ~((sector_t)0) ) { 820 if (befs_sb->num_blocks > ~((sector_t)0)) {
818 if (!silent) 821 if (!silent)
819 befs_error(sb, "blocks count: %llu is larger than the host can use", 822 befs_error(sb, "blocks count: %llu is larger than the host can use",
820 befs_sb->num_blocks); 823 befs_sb->num_blocks);
@@ -859,16 +862,16 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
859 } 862 }
860 863
861 return 0; 864 return 0;
862/*****************/ 865
863 unacquire_bh: 866unacquire_bh:
864 brelse(bh); 867 brelse(bh);
865 868
866 unacquire_priv_sbp: 869unacquire_priv_sbp:
867 kfree(befs_sb->mount_opts.iocharset); 870 kfree(befs_sb->mount_opts.iocharset);
868 kfree(sb->s_fs_info); 871 kfree(sb->s_fs_info);
869 sb->s_fs_info = NULL; 872 sb->s_fs_info = NULL;
870 873
871 unacquire_none: 874unacquire_none:
872 return ret; 875 return ret;
873} 876}
874 877
@@ -954,9 +957,9 @@ exit_befs_fs(void)
954} 957}
955 958
956/* 959/*
957Macros that typecheck the init and exit functions, 960 * Macros that typecheck the init and exit functions,
958ensures that they are called at init and cleanup, 961 * ensures that they are called at init and cleanup,
959and eliminates warnings about unused functions. 962 * and eliminates warnings about unused functions.
960*/ 963 */
961module_init(init_befs_fs) 964module_init(init_befs_fs)
962module_exit(exit_befs_fs) 965module_exit(exit_befs_fs)