The patch titled Subject: fs/proc/thread_self.c: code cleanup for proc_setup_thread_self() has been added to the -mm tree. Its filename is proc-code-cleanup-for-proc_setup_thread_self.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/proc-code-cleanup-for-proc_setup_thread_self.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/proc-code-cleanup-for-proc_setup_thread_self.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Chengguang Xu <cgxu519@xxxxxxx> Subject: fs/proc/thread_self.c: code cleanup for proc_setup_thread_self() Remove unnecessary ERR_PTR()/PTR_ERR() cast in proc_setup_thread_self(). Link: http://lkml.kernel.org/r/20190124030150.8472-2-cgxu519@xxxxxxx Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/proc/thread_self.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/fs/proc/thread_self.c~proc-code-cleanup-for-proc_setup_thread_self +++ a/fs/proc/thread_self.c @@ -38,6 +38,7 @@ int proc_setup_thread_self(struct super_ struct inode *root_inode = d_inode(s->s_root); struct pid_namespace *ns = proc_pid_ns(root_inode); struct dentry *thread_self; + int ret = -ENOMEM; inode_lock(root_inode); thread_self = d_alloc_name(s->s_root, "thread-self"); @@ -51,20 +52,19 @@ int proc_setup_thread_self(struct super_ inode->i_gid = GLOBAL_ROOT_GID; inode->i_op = &proc_thread_self_inode_operations; d_add(thread_self, inode); + ret = 0; } else { dput(thread_self); - thread_self = ERR_PTR(-ENOMEM); } - } else { - thread_self = ERR_PTR(-ENOMEM); } inode_unlock(root_inode); - if (IS_ERR(thread_self)) { + + if (ret) pr_err("proc_fill_super: can't allocate /proc/thread_self\n"); - return PTR_ERR(thread_self); - } - ns->proc_thread_self = thread_self; - return 0; + else + ns->proc_thread_self = thread_self; + + return ret; } void __init proc_thread_self_init(void) _ Patches currently in -mm which might be from cgxu519@xxxxxxx are proc-code-cleanup-for-proc_setup_self.patch proc-code-cleanup-for-proc_setup_thread_self.patch