public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tty: vt: Fix spelling typo in comment
@ 2023-07-26  9:10 oushixiong
  2023-07-26  9:10 ` [PATCH 2/2] tty: vt: Remove some repetitive initialization oushixiong
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: oushixiong @ 2023-07-26  9:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Ilpo Järvinen, Samuel Thibault, Daniel Vetter,
	linux-kernel, oushixiong

Signed-off-by: oushixiong <oushixiong@kylinos.cn>
---
 drivers/tty/vt/vt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 1e8e57b45688..bcdd249e47a0 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3473,7 +3473,7 @@ static int __init con_init(void)
 		INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
 		tty_port_init(&vc->port);
 		visual_init(vc, currcons, 1);
-		/* Assuming vc->vc_{cols,rows,screenbuf_size} are sane here. */
+		/* Assuming vc->vc_{cols,rows,screenbuf_size} are same here. */
 		vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
 		vc_init(vc, vc->vc_rows, vc->vc_cols,
 			currcons || !vc->vc_sw->con_save_screen);
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] tty: vt: Remove some repetitive initialization
  2023-07-26  9:10 [PATCH 1/2] tty: vt: Fix spelling typo in comment oushixiong
@ 2023-07-26  9:10 ` oushixiong
  2023-07-26  9:40 ` [PATCH 1/2] tty: vt: Fix spelling typo in comment Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: oushixiong @ 2023-07-26  9:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Ilpo Järvinen, Samuel Thibault, Daniel Vetter,
	linux-kernel, oushixiong

Some members of struct vc_data have been initialized in the vc_visual(),
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 bcdd249e47a0..11ca701b0428 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, &param);
 
@@ -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;
-
 	set_origin(vc);
 	vc->vc_pos = vc->vc_origin;
 	reset_vc(vc);
@@ -3475,8 +3468,7 @@ static int __init con_init(void)
 		visual_init(vc, currcons, 1);
 		/* Assuming vc->vc_{cols,rows,screenbuf_size} are same here. */
 		vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
-		vc_init(vc, vc->vc_rows, vc->vc_cols,
-			currcons || !vc->vc_sw->con_save_screen);
+		vc_init(vc, currcons || !vc->vc_sw->con_save_screen);
 	}
 	currcons = fg_console = 0;
 	master_display_fg = vc = vc_cons[currcons].d;
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] tty: vt: Fix spelling typo in comment
  2023-07-26  9:10 [PATCH 1/2] tty: vt: Fix spelling typo in comment oushixiong
  2023-07-26  9:10 ` [PATCH 2/2] tty: vt: Remove some repetitive initialization oushixiong
@ 2023-07-26  9:40 ` Greg Kroah-Hartman
  2023-07-26  9:58 ` Jiri Slaby
  2023-07-27 20:45 ` Samuel Thibault
  3 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2023-07-26  9:40 UTC (permalink / raw)
  To: oushixiong
  Cc: Jiri Slaby, Ilpo Järvinen, Samuel Thibault, Daniel Vetter,
	linux-kernel

On Wed, Jul 26, 2023 at 05:10:43PM +0800, oushixiong wrote:
> Signed-off-by: oushixiong <oushixiong@kylinos.cn>
> ---
>  drivers/tty/vt/vt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

For obvious reasons, I can't take patches without any changelog comments
:(


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] tty: vt: Fix spelling typo in comment
  2023-07-26  9:10 [PATCH 1/2] tty: vt: Fix spelling typo in comment oushixiong
  2023-07-26  9:10 ` [PATCH 2/2] tty: vt: Remove some repetitive initialization oushixiong
  2023-07-26  9:40 ` [PATCH 1/2] tty: vt: Fix spelling typo in comment Greg Kroah-Hartman
@ 2023-07-26  9:58 ` Jiri Slaby
  2023-07-27 20:45 ` Samuel Thibault
  3 siblings, 0 replies; 5+ messages in thread
From: Jiri Slaby @ 2023-07-26  9:58 UTC (permalink / raw)
  To: oushixiong, Greg Kroah-Hartman
  Cc: Ilpo Järvinen, Samuel Thibault, Daniel Vetter, linux-kernel

On 26. 07. 23, 11:10, oushixiong wrote:
> Signed-off-by: oushixiong <oushixiong@kylinos.cn>
> ---
>   drivers/tty/vt/vt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 1e8e57b45688..bcdd249e47a0 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -3473,7 +3473,7 @@ static int __init con_init(void)
>   		INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
>   		tty_port_init(&vc->port);
>   		visual_init(vc, currcons, 1);
> -		/* Assuming vc->vc_{cols,rows,screenbuf_size} are sane here. */
> +		/* Assuming vc->vc_{cols,rows,screenbuf_size} are same here. */

NACK for many reasons, incl. this is _wrong_.

Please read SubmittingPatches first.

-- 
js


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] tty: vt: Fix spelling typo in comment
  2023-07-26  9:10 [PATCH 1/2] tty: vt: Fix spelling typo in comment oushixiong
                   ` (2 preceding siblings ...)
  2023-07-26  9:58 ` Jiri Slaby
@ 2023-07-27 20:45 ` Samuel Thibault
  3 siblings, 0 replies; 5+ messages in thread
From: Samuel Thibault @ 2023-07-27 20:45 UTC (permalink / raw)
  To: oushixiong
  Cc: Greg Kroah-Hartman, Jiri Slaby, Ilpo Järvinen, Daniel Vetter,
	linux-kernel

oushixiong, le mer. 26 juil. 2023 17:10:43 +0800, a ecrit:
> Signed-off-by: oushixiong <oushixiong@kylinos.cn>
> ---
>  drivers/tty/vt/vt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 1e8e57b45688..bcdd249e47a0 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -3473,7 +3473,7 @@ static int __init con_init(void)
>  		INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
>  		tty_port_init(&vc->port);
>  		visual_init(vc, currcons, 1);
> -		/* Assuming vc->vc_{cols,rows,screenbuf_size} are sane here. */
> +		/* Assuming vc->vc_{cols,rows,screenbuf_size} are same here. */

? No, this is really meant to be "sane" here, i.e. they are not getting
checked, and just used as they are.

>  		vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
>  		vc_init(vc, vc->vc_rows, vc->vc_cols,
>  			currcons || !vc->vc_sw->con_save_screen);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-27 20:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-26  9:10 [PATCH 1/2] tty: vt: Fix spelling typo in comment oushixiong
2023-07-26  9:10 ` [PATCH 2/2] tty: vt: Remove some repetitive initialization oushixiong
2023-07-26  9:40 ` [PATCH 1/2] tty: vt: Fix spelling typo in comment Greg Kroah-Hartman
2023-07-26  9:58 ` Jiri Slaby
2023-07-27 20:45 ` Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox