Skip to content

Commit 62b8071

Browse files
committed
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 <[email protected]>
1 parent 1ca7087 commit 62b8071

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

fs/befs/linuxvfs.c

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ static int befs_readdir(struct file *, struct dir_context *);
3737
static int befs_get_block(struct inode *, sector_t, struct buffer_head *, int);
3838
static int befs_readpage(struct file *file, struct page *page);
3939
static sector_t befs_bmap(struct address_space *mapping, sector_t block);
40-
static struct dentry *befs_lookup(struct inode *, struct dentry *, unsigned int);
40+
static struct dentry *befs_lookup(struct inode *, struct dentry *,
41+
unsigned int);
4142
static struct inode *befs_iget(struct super_block *, unsigned long);
4243
static struct inode *befs_alloc_inode(struct super_block *sb);
4344
static void befs_destroy_inode(struct inode *inode);
@@ -269,15 +270,15 @@ befs_alloc_inode(struct super_block *sb)
269270
struct befs_inode_info *bi;
270271

271272
bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL);
272-
if (!bi)
273-
return NULL;
274-
return &bi->vfs_inode;
273+
if (!bi)
274+
return NULL;
275+
return &bi->vfs_inode;
275276
}
276277

277278
static void befs_i_callback(struct rcu_head *head)
278279
{
279280
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));
281282
}
282283

283284
static void befs_destroy_inode(struct inode *inode)
@@ -287,7 +288,7 @@ static void befs_destroy_inode(struct inode *inode)
287288

288289
static void init_once(void *foo)
289290
{
290-
struct befs_inode_info *bi = (struct befs_inode_info *) foo;
291+
struct befs_inode_info *bi = (struct befs_inode_info *) foo;
291292

292293
inode_init_once(&bi->vfs_inode);
293294
}
@@ -414,10 +415,10 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
414415
unlock_new_inode(inode);
415416
return inode;
416417

417-
unacquire_bh:
418+
unacquire_bh:
418419
brelse(bh);
419420

420-
unacquire_none:
421+
unacquire_none:
421422
iget_failed(inode);
422423
befs_debug(sb, "<--- %s - Bad inode", __func__);
423424
return ERR_PTR(-EIO);
@@ -518,9 +519,8 @@ befs_utf2nls(struct super_block *sb, const char *in,
518519
}
519520

520521
*out = result = kmalloc(maxlen, GFP_NOFS);
521-
if (!*out) {
522+
if (!*out)
522523
return -ENOMEM;
523-
}
524524

525525
for (i = o = 0; i < in_len; i += utflen, o += unilen) {
526526

@@ -543,7 +543,7 @@ befs_utf2nls(struct super_block *sb, const char *in,
543543

544544
return o;
545545

546-
conv_err:
546+
conv_err:
547547
befs_error(sb, "Name using character set %s contains a character that "
548548
"cannot be converted to unicode.", nls->charset);
549549
befs_debug(sb, "<--- %s", __func__);
@@ -585,7 +585,8 @@ befs_nls2utf(struct super_block *sb, const char *in,
585585
/*
586586
* There are nls characters that will translate to 3-chars-wide UTF-8
587587
* characters, an additional byte is needed to save the final \0
588-
* in special cases */
588+
* in special cases
589+
*/
589590
int maxlen = (3 * in_len) + 1;
590591

591592
befs_debug(sb, "---> %s\n", __func__);
@@ -622,7 +623,7 @@ befs_nls2utf(struct super_block *sb, const char *in,
622623

623624
return i;
624625

625-
conv_err:
626+
conv_err:
626627
befs_error(sb, "Name using character set %s contains a character that "
627628
"cannot be converted to unicode.", nls->charset);
628629
befs_debug(sb, "<--- %s", __func__);
@@ -664,6 +665,7 @@ parse_options(char *options, struct befs_mount_options *opts)
664665

665666
while ((p = strsep(&options, ",")) != NULL) {
666667
int token;
668+
667669
if (!*p)
668670
continue;
669671

@@ -789,7 +791,8 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
789791
goto unacquire_priv_sbp;
790792
}
791793

792-
if (!(bh = sb_bread(sb, sb_block))) {
794+
bh = sb_bread(sb, sb_block);
795+
if (!bh) {
793796
if (!silent)
794797
befs_error(sb, "unable to read superblock");
795798
goto unacquire_priv_sbp;
@@ -814,7 +817,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
814817

815818
brelse(bh);
816819

817-
if( befs_sb->num_blocks > ~((sector_t)0) ) {
820+
if (befs_sb->num_blocks > ~((sector_t)0)) {
818821
if (!silent)
819822
befs_error(sb, "blocks count: %llu is larger than the host can use",
820823
befs_sb->num_blocks);
@@ -859,16 +862,16 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
859862
}
860863

861864
return 0;
862-
/*****************/
863-
unacquire_bh:
865+
866+
unacquire_bh:
864867
brelse(bh);
865868

866-
unacquire_priv_sbp:
869+
unacquire_priv_sbp:
867870
kfree(befs_sb->mount_opts.iocharset);
868871
kfree(sb->s_fs_info);
869872
sb->s_fs_info = NULL;
870873

871-
unacquire_none:
874+
unacquire_none:
872875
return ret;
873876
}
874877

@@ -954,9 +957,9 @@ exit_befs_fs(void)
954957
}
955958

956959
/*
957-
Macros that typecheck the init and exit functions,
958-
ensures that they are called at init and cleanup,
959-
and eliminates warnings about unused functions.
960-
*/
960+
* Macros that typecheck the init and exit functions,
961+
* ensures that they are called at init and cleanup,
962+
* and eliminates warnings about unused functions.
963+
*/
961964
module_init(init_befs_fs)
962965
module_exit(exit_befs_fs)

0 commit comments

Comments
 (0)