Commit fc440658 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty/vt: consolemap: use con_allocate_new() in con_unshare_unimap()

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: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220607104946.18710-35-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63c4f92f
......@@ -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;
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment