]> git.baikalelectronics.ru Git - kernel.git/commitdiff
tty/vt: consolemap: use con_allocate_new() in con_unshare_unimap()
authorJiri Slaby <jslaby@suse.cz>
Tue, 7 Jun 2022 10:49:45 +0000 (12:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jun 2022 11:37:03 +0000 (13:37 +0200)
The old->refcount is guaranteed to be > 1, so we can directly call
con_allocate_new() to make the code more obvious.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220607104946.18710-35-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/consolemap.c

index 14d3fbff015ce8067d6e5a5bb250a29a98f988c3..f97f7ee6268b21f851bccb44c8ea654726bae95d 100644 (file)
@@ -580,14 +580,10 @@ static struct uni_pagedict *con_unshare_unimap(struct vc_data *vc,
        int ret;
        u16 uni = 0;
 
-       ret = con_do_clear_unimap(vc);
+       ret = con_allocate_new(vc);
        if (ret)
                return ERR_PTR(ret);
 
-       /*
-        * Since refcount was > 1, con_clear_unimap() allocated a new
-        * uni_pagedict for this vc.  Re: old != new
-        */
        new = *vc->vc_uni_pagedir_loc;
 
        /*