Skip to content

Commit 04541a2

Browse files
Fabian Fredericktorvalds
authored andcommitted
fs/devpts/inode.c: convert printk to pr_foo()
Also convert spaces to tabs (checkpatch warnings) if (!dentry) KERN_NOTICE converted to pr_err (like if (!inode) error process) [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe] Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Joe Perches <joe@perches.com> Cc: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0227d6a commit 04541a2

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

‎fs/devpts/inode.c‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*
1111
* ------------------------------------------------------------------------- */
1212

13+
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14+
1315
#include <linux/module.h>
1416
#include <linux/init.h>
1517
#include <linux/fs.h>
@@ -148,10 +150,10 @@ static inline struct super_block *pts_sb_from_inode(struct inode *inode)
148150

149151
/*
150152
* parse_mount_options():
151-
* Set @opts to mount options specified in @data. If an option is not
152-
* specified in @data, set it to its default value. The exception is
153-
* 'newinstance' option which can only be set/cleared on a mount (i.e.
154-
* cannot be changed during remount).
153+
* Set @opts to mount options specified in @data. If an option is not
154+
* specified in @data, set it to its default value. The exception is
155+
* 'newinstance' option which can only be set/cleared on a mount (i.e.
156+
* cannot be changed during remount).
155157
*
156158
* Note: @data may be NULL (in which case all options are set to default).
157159
*/
@@ -225,7 +227,7 @@ static int parse_mount_options(char *data, int op, struct pts_mount_opts *opts)
225227
break;
226228
#endif
227229
default:
228-
printk(KERN_ERR "devpts: called with bogus options\n");
230+
pr_err("called with bogus options\n");
229231
return -EINVAL;
230232
}
231233
}
@@ -261,7 +263,7 @@ static int mknod_ptmx(struct super_block *sb)
261263

262264
dentry = d_alloc_name(root, "ptmx");
263265
if (!dentry) {
264-
printk(KERN_NOTICE "Unable to alloc dentry for ptmx node\n");
266+
pr_err("Unable to alloc dentry for ptmx node\n");
265267
goto out;
266268
}
267269

@@ -270,7 +272,7 @@ static int mknod_ptmx(struct super_block *sb)
270272
*/
271273
inode = new_inode(sb);
272274
if (!inode) {
273-
printk(KERN_ERR "Unable to alloc inode for ptmx node\n");
275+
pr_err("Unable to alloc inode for ptmx node\n");
274276
dput(dentry);
275277
goto out;
276278
}
@@ -303,7 +305,7 @@ static void update_ptmx_mode(struct pts_fs_info *fsi)
303305
#else
304306
static inline void update_ptmx_mode(struct pts_fs_info *fsi)
305307
{
306-
return;
308+
return;
307309
}
308310
#endif
309311

@@ -333,9 +335,11 @@ static int devpts_show_options(struct seq_file *seq, struct dentry *root)
333335
struct pts_mount_opts *opts = &fsi->mount_opts;
334336

335337
if (opts->setuid)
336-
seq_printf(seq, ",uid=%u", from_kuid_munged(&init_user_ns, opts->uid));
338+
seq_printf(seq, ",uid=%u",
339+
from_kuid_munged(&init_user_ns, opts->uid));
337340
if (opts->setgid)
338-
seq_printf(seq, ",gid=%u", from_kgid_munged(&init_user_ns, opts->gid));
341+
seq_printf(seq, ",gid=%u",
342+
from_kgid_munged(&init_user_ns, opts->gid));
339343
seq_printf(seq, ",mode=%03o", opts->mode);
340344
#ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES
341345
seq_printf(seq, ",ptmxmode=%03o", opts->ptmxmode);
@@ -396,7 +400,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
396400
if (s->s_root)
397401
return 0;
398402

399-
printk(KERN_ERR "devpts: get root dentry failed\n");
403+
pr_err("get root dentry failed\n");
400404

401405
fail:
402406
return -ENOMEM;

0 commit comments

Comments
 (0)