serial_core: fix sizeof(pointer)
PATCH 1/1 serial_core: fix sizeof(pointer)
sizeof when applied to a pointer typed expression gives the size of the pointer.
Generated by: scripts/coccinelle/misc/noderef.cocci
---
cocci-output-38612-39d907-serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/serial_core.c +1 -1
@@ -640,7 +640,7 @@ static void uart_get_info(struct tty_por {struct uart_port *uport = state->uart_port; -memset (retinfo,0 ,sizeof (retinfo)); +memset (retinfo,0 ,sizeof (*retinfo)); retinfo->type = uport->type; retinfo->line = uport->line;
Quoted 14 lines · Fengguang Wu
sizeof when applied to a pointer typed expression gives the size of the pointer.
Generated by:
scripts/coccinelle/misc/noderef.cocciSigned-off-by Fengguang Wu <[email protected]>---
cocci-output-38612-39d907-serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/serial_core.c static void uart_get_info(struct tty_por · line 643
Quoted 5 lines
drivers/tty/serial/serial_core.c +1
-1@@ -640,7 +640,7 @@ static void uart_get_info(struct tty_por {struct uart_port *uport = state->uart_port; -memset (retinfo,0 ,sizeof (retinfo)); +memset (retinfo,0 ,sizeof (*retinfo));
Hmm, what tree is this against? I have:
memset(&tmp, 0, sizeof(tmp));
thanks,
Signature · 2 lines
js suse labs
Quoted 18 lines · Jiri Slaby
Quoted 17 lines · Fengguang Wu
sizeof when applied to a pointer typed expression gives the size of the pointer.
Generated by:
scripts/coccinelle/misc/noderef.cocciSigned-off-by Fengguang Wu <[email protected]>---
cocci-output-38612-39d907-serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/serial/serial_core.c +0
-0@@ -640,7 +640,7 @@ static void uart_get_info(struct tty_por {struct uart_port *uport = state->uart_port;
Quoted 4 lines
drivers/tty/serial/serial_core.c static void uart_get_info(struct tty_por · line 643
Quoted 2 lines
drivers/tty/serial/serial_core.c +1
-1-memset (retinfo,0 ,sizeof (retinfo)); +memset (retinfo,0 ,sizeof (*retinfo));Hmm, what tree is this against? I have:
It's the tty:tty-next tree.
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
Quoted 1 line
memset(&tmp, 0, sizeof(tmp));
Oh I didn't know it's a new bug introduced by commit
commit 7ba2e769825fef035a943ed74d90379245508764
Author: Alan Cox <[email protected]>
AuthorDate: Tue Sep 4 16:34:45 2012 +0100
Commit: Greg Kroah-Hartman <[email protected]>
CommitDate: Wed Sep 5 13:11:03 2012 -0700
tty: Split the serial_core helpers for setserial into two
Thanks,
Fengguang
Quoted 6 lines · On Thu, 6 Sep 2012 10:27:51 +0800 Fengguang Wu <[email protected]> wrote:
sizeof when applied to a pointer typed expression gives the size of the pointer.
Generated by:
scripts/coccinelle/misc/noderef.cocciSigned-off-by Fengguang Wu <[email protected]>
Oops.. yes typo on my part