All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vt: initialize con_driver->node in con_init
@ 2013-12-30  3:11 Wang YanQing
  2014-01-09  4:33 ` Greg KH
  2014-02-07 16:45 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Wang YanQing @ 2013-12-30  3:11 UTC (permalink / raw)
  To: gregkh; +Cc: jslaby, airlied, akpm, kilobyte, linux-kernel

Commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
("[PATCH] VT binding: Add sysfs control to the VT layer")
add node item into struct con_driver.

This patch initialize con_driver->node in con_init.

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/tty/vt/vt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index edcd6b8..9adb4e0 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2879,6 +2879,7 @@ static int __init con_init(void)
 		if (con_driver->con == NULL) {
 			con_driver->con = conswitchp;
 			con_driver->desc = display_desc;
+			con_driver->node = i;
 			con_driver->flag = CON_DRIVER_FLAG_INIT;
 			con_driver->first = 0;
 			con_driver->last = MAX_NR_CONSOLES - 1;
-- 
1.8.3.4.8.g69490f3.dirty

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

* Re: [PATCH] vt: initialize con_driver->node in con_init
  2013-12-30  3:11 [PATCH] vt: initialize con_driver->node in con_init Wang YanQing
@ 2014-01-09  4:33 ` Greg KH
  2014-02-07 16:45 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2014-01-09  4:33 UTC (permalink / raw)
  To: Wang YanQing, jslaby, airlied, akpm, kilobyte, linux-kernel

On Mon, Dec 30, 2013 at 11:11:02AM +0800, Wang YanQing wrote:
> Commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
> ("[PATCH] VT binding: Add sysfs control to the VT layer")
> add node item into struct con_driver.

That patch was from 2006.  Why is this change needed now, what problems
happen without your fix below?

thanks,

greg k-h

> 
> This patch initialize con_driver->node in con_init.
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
>  drivers/tty/vt/vt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index edcd6b8..9adb4e0 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -2879,6 +2879,7 @@ static int __init con_init(void)
>  		if (con_driver->con == NULL) {
>  			con_driver->con = conswitchp;
>  			con_driver->desc = display_desc;
> +			con_driver->node = i;
>  			con_driver->flag = CON_DRIVER_FLAG_INIT;
>  			con_driver->first = 0;
>  			con_driver->last = MAX_NR_CONSOLES - 1;
> -- 
> 1.8.3.4.8.g69490f3.dirty

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

* Re: [PATCH] vt: initialize con_driver->node in con_init
  2013-12-30  3:11 [PATCH] vt: initialize con_driver->node in con_init Wang YanQing
  2014-01-09  4:33 ` Greg KH
@ 2014-02-07 16:45 ` Greg KH
  2014-02-11  0:49   ` Wang YanQing
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2014-02-07 16:45 UTC (permalink / raw)
  To: Wang YanQing, jslaby, airlied, akpm, kilobyte, linux-kernel

On Mon, Dec 30, 2013 at 11:11:02AM +0800, Wang YanQing wrote:
> Commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
> ("[PATCH] VT binding: Add sysfs control to the VT layer")
> add node item into struct con_driver.

That commit was almost a decade ago, is this patch really needed?

> This patch initialize con_driver->node in con_init.

You are saying what it does, not _why_ it is needed or why this change
is happening.

Please rewrite this with more information because as-is, I have no idea
why I should accept this patch.

thanks,

greg k-h

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

* Re: [PATCH] vt: initialize con_driver->node in con_init
  2014-02-07 16:45 ` Greg KH
@ 2014-02-11  0:49   ` Wang YanQing
  0 siblings, 0 replies; 4+ messages in thread
From: Wang YanQing @ 2014-02-11  0:49 UTC (permalink / raw)
  To: Greg KH; +Cc: jslaby, airlied, akpm, kilobyte, linux-kernel

On Fri, Feb 07, 2014 at 08:45:00AM -0800, Greg KH wrote:
> On Mon, Dec 30, 2013 at 11:11:02AM +0800, Wang YanQing wrote:
> > Commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
> > ("[PATCH] VT binding: Add sysfs control to the VT layer")
> > add node item into struct con_driver.
> 
> That commit was almost a decade ago, is this patch really needed?
> 
> > This patch initialize con_driver->node in con_init.
> 
> You are saying what it does, not _why_ it is needed or why this change
> is happening.
> 
> Please rewrite this with more information because as-is, I have no idea
> why I should accept this patch.

This patch meet the same situation with another patch I sended
("[PATCH v2]vt: fix potential dual con_driver register for conswitchp"),
if conswitchp in con_init is always the first con_driver we register, 
then no problem will happen due to node will be initialized to zero.

But if it isn't the first, we get trouble due to use uninitialized value 
of con_driver->node.

At least the code in con_init is not perfect, if we make sure con_driver
is always the first con_driver, then we don't need for(;;), just use
registered_con_driver[0] is enough.

Ok, if this two patches really don't fix any problem, it will protect you
from seeing *the same uselss patches* in your inbox again at least I think:).

Thanks.

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

end of thread, other threads:[~2014-02-11  0:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-30  3:11 [PATCH] vt: initialize con_driver->node in con_init Wang YanQing
2014-01-09  4:33 ` Greg KH
2014-02-07 16:45 ` Greg KH
2014-02-11  0:49   ` Wang YanQing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.