mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
some kmalloc/memset ->kzalloc (tree wide)
Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc). Here is a short excerpt of the semantic patch performing this transformation: @@ type T2; expression x; identifier f,fld; expression E; expression E1,E2; expression e1,e2,e3,y; statement S; @@ x = - kmalloc + kzalloc (E1,E2) ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\) - memset((T2)x,0,E1); @@ expression E1,E2,E3; @@ - kzalloc(E1 * E2,E3) + kcalloc(E1,E2,E3) [[email protected]: get kcalloc args the right way around] Signed-off-by: Yoann Padioleau <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Acked-by: Russell King <[email protected]> Cc: Bryan Wu <[email protected]> Acked-by: Jiri Slaby <[email protected]> Cc: Dave Airlie <[email protected]> Acked-by: Roland Dreier <[email protected]> Cc: Jiri Kosina <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Pierre Ossman <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: "David S. Miller" <[email protected]> Acked-by: Greg KH <[email protected]> Cc: James Bottomley <[email protected]> Cc: "Antonino A. Daplas" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3b5ad0797c
commit
dd00cc486a
136 changed files with 157 additions and 330 deletions
|
|
@ -716,7 +716,7 @@ static int pl011_probe(struct amba_device *dev, void *id)
|
|||
goto out;
|
||||
}
|
||||
|
||||
uap = kmalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
|
||||
uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
|
||||
if (uap == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
|
@ -728,7 +728,6 @@ static int pl011_probe(struct amba_device *dev, void *id)
|
|||
goto free;
|
||||
}
|
||||
|
||||
memset(uap, 0, sizeof(struct uart_amba_port));
|
||||
uap->clk = clk_get(&dev->dev, "UARTCLK");
|
||||
if (IS_ERR(uap->clk)) {
|
||||
ret = PTR_ERR(uap->clk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue