From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: oushixiong <oushixiong@kylinos.cn>
Cc: "Jiri Slaby" <jirislaby@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
"Daniel Vetter" <daniel.vetter@ffwll.ch>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: vt: Remove some repetitive initialization
Date: Tue, 1 Aug 2023 07:56:39 +0200 [thread overview]
Message-ID: <2023080159-chatting-endanger-7115@gregkh> (raw)
In-Reply-To: <20230801054933.895780-1-oushixiong@kylinos.cn>
On Tue, Aug 01, 2023 at 01:49:33PM +0800, oushixiong wrote:
> Some members of struct vc_data have been initialized in the vc_visual(),
Which members specifically?
> so it no longer to initialized them in vc_init().
>
> Signed-off-by: oushixiong <oushixiong@kylinos.cn>
> ---
> drivers/tty/vt/vt.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 1e8e57b45688..cf77011a8f4e 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -140,8 +140,7 @@ EXPORT_SYMBOL(vc_cons);
> static const struct consw *con_driver_map[MAX_NR_CONSOLES];
>
> static int con_open(struct tty_struct *, struct file *);
> -static void vc_init(struct vc_data *vc, unsigned int rows,
> - unsigned int cols, int do_clear);
> +static void vc_init(struct vc_data *vc, int do_clear);
> static void gotoxy(struct vc_data *vc, int new_x, int new_y);
> static void save_cur(struct vc_data *vc);
> static void reset_terminal(struct vc_data *vc, int do_clear);
> @@ -1103,7 +1102,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
> if (global_cursor_default == -1)
> global_cursor_default = 1;
>
> - vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
> + vc_init(vc, 1);
> vcs_make_sysfs(currcons);
> atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, ¶m);
>
> @@ -3398,16 +3397,10 @@ module_param_named(color, default_color, int, S_IRUGO | S_IWUSR);
> module_param_named(italic, default_italic_color, int, S_IRUGO | S_IWUSR);
> module_param_named(underline, default_underline_color, int, S_IRUGO | S_IWUSR);
>
> -static void vc_init(struct vc_data *vc, unsigned int rows,
> - unsigned int cols, int do_clear)
> +static void vc_init(struct vc_data *vc, int do_clear)
> {
> int j, k ;
>
> - vc->vc_cols = cols;
> - vc->vc_rows = rows;
> - vc->vc_size_row = cols << 1;
> - vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row;
Where are these being set now?
thanks,
greg k-h
prev parent reply other threads:[~2023-08-01 5:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 5:49 oushixiong
2023-08-01 5:56 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023080159-chatting-endanger-7115@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=daniel.vetter@ffwll.ch \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oushixiong@kylinos.cn \
--cc=samuel.thibault@ens-lyon.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®