Skip to content

Commit 835aa44

Browse files
Alan Coxtorvalds
authored andcommitted
devpts: Coding style clean up
Just nail the oddments now while this code is being touched Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 784c4d8 commit 835aa44

1 file changed

Lines changed: 26 additions & 27 deletions

File tree

‎fs/devpts/inode.c‎

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
311311
if (s->s_root)
312312
return 0;
313313

314-
printk("devpts: get root dentry failed\n");
314+
printk(KERN_ERR "devpts: get root dentry failed\n");
315315
iput(inode);
316316

317317
free_fsi:
@@ -444,25 +444,25 @@ static int is_new_instance_mount(void *data)
444444
static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
445445
void *data, struct vfsmount *mnt)
446446
{
447-
struct super_block *s;
448-
int error;
449-
450-
s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
451-
if (IS_ERR(s))
452-
return PTR_ERR(s);
453-
454-
if (!s->s_root) {
455-
s->s_flags = flags;
456-
error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
457-
if (error) {
458-
up_write(&s->s_umount);
459-
deactivate_super(s);
460-
return error;
461-
}
462-
s->s_flags |= MS_ACTIVE;
463-
}
464-
do_remount_sb(s, flags, data, 0);
465-
return simple_set_mnt(mnt, s);
447+
struct super_block *s;
448+
int error;
449+
450+
s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
451+
if (IS_ERR(s))
452+
return PTR_ERR(s);
453+
454+
if (!s->s_root) {
455+
s->s_flags = flags;
456+
error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
457+
if (error) {
458+
up_write(&s->s_umount);
459+
deactivate_super(s);
460+
return error;
461+
}
462+
s->s_flags |= MS_ACTIVE;
463+
}
464+
do_remount_sb(s, flags, data, 0);
465+
return simple_set_mnt(mnt, s);
466466
}
467467

468468
/*
@@ -477,7 +477,7 @@ static int init_pts_mount(struct file_system_type *fs_type, int flags,
477477

478478
err = get_init_pts_sb(fs_type, flags, data, mnt);
479479
if (err)
480-
return err;
480+
return err;
481481

482482
err = mknod_ptmx(mnt->mnt_sb);
483483
if (err) {
@@ -542,9 +542,8 @@ int devpts_new_index(struct inode *ptmx_inode)
542542
int ida_ret;
543543

544544
retry:
545-
if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL)) {
545+
if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL))
546546
return -ENOMEM;
547-
}
548547

549548
mutex_lock(&allocated_ptys_lock);
550549
ida_ret = ida_get_new(&fsi->allocated_ptys, &index);
@@ -576,7 +575,8 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx)
576575

577576
int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
578577
{
579-
int number = tty->index; /* tty layer puts index from devpts_new_index() in here */
578+
/* tty layer puts index from devpts_new_index() in here */
579+
int number = tty->index;
580580
struct tty_driver *driver = tty->driver;
581581
dev_t device = MKDEV(driver->major, driver->minor_start+number);
582582
struct dentry *dentry;
@@ -644,11 +644,10 @@ void devpts_pty_kill(struct tty_struct *tty)
644644
if (dentry) {
645645
inode->i_nlink--;
646646
d_delete(dentry);
647-
dput(dentry); // d_alloc_name() in devpts_pty_new()
647+
dput(dentry); /* d_alloc_name() in devpts_pty_new() */
648648
}
649649

650-
dput(dentry); // d_find_alias above
651-
650+
dput(dentry); /* d_find_alias above */
652651
out:
653652
mutex_unlock(&root->d_inode->i_mutex);
654653
}

0 commit comments

Comments
 (0)