serial: sccnxp: replace memcpy with struct assignment
A message that is not in the archive (sent off-list or not yet received): 5244e22f.VLBQtuO7RvNh9dWF%[email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 serial: sccnxp: replace memcpy with struct assignment
Generated by: coccinelle/misc/memcpy-assign.cocci
---
drivers/tty/serial/sccnxp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sccnxp.c +1 -1
@@ -907,7 +907,7 @@ static int sccnxp_probe(struct platform_ }if (pdata) -memcpy (&s->pdata, pdata,sizeof (struct sccnxp_pdata )); + s->pdata = *pdata;if (s->pdata.poll_time_us) { dev_info(&pdev->dev, "Using poll mode, resolution %u usecs\n",
Greg Kroah-Hartman
maintainerQuoted 12 lines · Fengguang Wu
Generated by:
coccinelle/misc/memcpy-assign.cocciCC Alexander Shiyan <[email protected]>Signed-off-by Fengguang Wu <[email protected]>---
drivers/tty/serial/sccnxp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sccnxp.c static int sccnxp_probe(struct platform_ · line 910
Quoted 5 lines
drivers/tty/serial/sccnxp.c +1
-1@@ -907,7 +907,7 @@ static int sccnxp_probe(struct platform_ }if (pdata) -memcpy (&s->pdata, pdata,sizeof (struct sccnxp_pdata )); + s->pdata = *pdata;
I don't think you compiled this, as it breaks the build :(
Quoted 15 lines · Greg KH
Quoted 14 lines · Fengguang Wu
Generated by:
coccinelle/misc/memcpy-assign.cocciCC Alexander Shiyan <[email protected]>Signed-off-by Fengguang Wu <[email protected]>---
drivers/tty/serial/sccnxp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/serial/sccnxp.c +0
-0@@ -907,7 +907,7 @@ static int sccnxp_probe(struct platform_ }
Quoted 5 lines
drivers/tty/serial/sccnxp.c static int sccnxp_probe(struct platform_ · line 910
Quoted 3 lines
drivers/tty/serial/sccnxp.c +1
-1if (pdata) -memcpy (&s->pdata, pdata,sizeof (struct sccnxp_pdata )); + s->pdata = *pdata;I don't think you compiled this, as it breaks the build :(
Yeah, sorry! I'll take care next time..
drivers/tty/serial/sccnxp.c: In function 'sccnxp_probe':
Quoted 1 line
Quoted 1 line
drivers/tty/serial/sccnxp.c:910:3: error: assignment of read-only member 'pdata'
s->pdata = *pdata;
^ Thanks,
Fengguang