Commit 835aa440f1c3fe16a622015bc1b52dffedf6d90e

Authored by Alan Cox
Committed by Linus Torvalds
1 parent 784c4d8b1b

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>

Showing 1 changed file with 26 additions and 27 deletions Side-by-side Diff

... ... @@ -311,7 +311,7 @@
311 311 if (s->s_root)
312 312 return 0;
313 313  
314   - printk("devpts: get root dentry failed\n");
  314 + printk(KERN_ERR "devpts: get root dentry failed\n");
315 315 iput(inode);
316 316  
317 317 free_fsi:
318 318  
319 319  
... ... @@ -444,25 +444,25 @@
444 444 static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
445 445 void *data, struct vfsmount *mnt)
446 446 {
447   - struct super_block *s;
448   - int error;
  447 + struct super_block *s;
  448 + int error;
449 449  
450   - s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
451   - if (IS_ERR(s))
452   - return PTR_ERR(s);
  450 + s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
  451 + if (IS_ERR(s))
  452 + return PTR_ERR(s);
453 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);
  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);
466 466 }
467 467  
468 468 /*
... ... @@ -477,7 +477,7 @@
477 477  
478 478 err = get_init_pts_sb(fs_type, flags, data, mnt);
479 479 if (err)
480   - return err;
  480 + return err;
481 481  
482 482 err = mknod_ptmx(mnt->mnt_sb);
483 483 if (err) {
484 484  
... ... @@ -542,9 +542,8 @@
542 542 int ida_ret;
543 543  
544 544 retry:
545   - if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL)) {
  545 + if (!ida_pre_get(&fsi->allocated_ptys, GFP_KERNEL))
546 546 return -ENOMEM;
547   - }
548 547  
549 548 mutex_lock(&allocated_ptys_lock);
550 549 ida_ret = ida_get_new(&fsi->allocated_ptys, &index);
... ... @@ -576,7 +575,8 @@
576 575  
577 576 int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
578 577 {
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;
580 580 struct tty_driver *driver = tty->driver;
581 581 dev_t device = MKDEV(driver->major, driver->minor_start+number);
582 582 struct dentry *dentry;
583 583  
... ... @@ -644,11 +644,10 @@
644 644 if (dentry) {
645 645 inode->i_nlink--;
646 646 d_delete(dentry);
647   - dput(dentry); // d_alloc_name() in devpts_pty_new()
  647 + dput(dentry); /* d_alloc_name() in devpts_pty_new() */
648 648 }
649 649  
650   - dput(dentry); // d_find_alias above
651   -
  650 + dput(dentry); /* d_find_alias above */
652 651 out:
653 652 mutex_unlock(&root->d_inode->i_mutex);
654 653 }