From: Julia Lawall <Julia.Lawall@inria.fr> To: Mark Brown <broonie@kernel.org> Cc: kernel-janitors@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/14] spi/topcliff-pch: drop double zeroing Date: Sun, 20 Sep 2020 13:26:23 +0200 [thread overview] Message-ID: <1600601186-7420-12-git-send-email-Julia.Lawall@inria.fr> (raw) In-Reply-To: <1600601186-7420-1-git-send-email-Julia.Lawall@inria.fr> sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(*x),flags) ... sg_init_table(x,n) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> --- drivers/spi/spi-topcliff-pch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -u -p a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1002,7 +1002,7 @@ static void pch_spi_handle_dma(struct pc spin_unlock_irqrestore(&data->lock, flags); /* RX */ - dma->sg_rx_p = kcalloc(num, sizeof(*dma->sg_rx_p), GFP_ATOMIC); + dma->sg_rx_p = kmalloc_array(num, sizeof(*dma->sg_rx_p), GFP_ATOMIC); if (!dma->sg_rx_p) return; @@ -1065,7 +1065,7 @@ static void pch_spi_handle_dma(struct pc head = 0; } - dma->sg_tx_p = kcalloc(num, sizeof(*dma->sg_tx_p), GFP_ATOMIC); + dma->sg_tx_p = kmalloc_array(num, sizeof(*dma->sg_tx_p), GFP_ATOMIC); if (!dma->sg_tx_p) return;
WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <Julia.Lawall@inria.fr> To: Mark Brown <broonie@kernel.org> Cc: kernel-janitors@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/14] spi/topcliff-pch: drop double zeroing Date: Sun, 20 Sep 2020 11:26:23 +0000 [thread overview] Message-ID: <1600601186-7420-12-git-send-email-Julia.Lawall@inria.fr> (raw) In-Reply-To: <1600601186-7420-1-git-send-email-Julia.Lawall@inria.fr> sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(*x),flags) ... sg_init_table(x,n) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> --- drivers/spi/spi-topcliff-pch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -u -p a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1002,7 +1002,7 @@ static void pch_spi_handle_dma(struct pc spin_unlock_irqrestore(&data->lock, flags); /* RX */ - dma->sg_rx_p = kcalloc(num, sizeof(*dma->sg_rx_p), GFP_ATOMIC); + dma->sg_rx_p = kmalloc_array(num, sizeof(*dma->sg_rx_p), GFP_ATOMIC); if (!dma->sg_rx_p) return; @@ -1065,7 +1065,7 @@ static void pch_spi_handle_dma(struct pc head = 0; } - dma->sg_tx_p = kcalloc(num, sizeof(*dma->sg_tx_p), GFP_ATOMIC); + dma->sg_tx_p = kmalloc_array(num, sizeof(*dma->sg_tx_p), GFP_ATOMIC); if (!dma->sg_tx_p) return;
next prev parent reply other threads:[~2020-09-20 12:09 UTC|newest] Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-20 11:26 [PATCH 00/14] drop double zeroing Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-20 11:26 ` [PATCH 01/14] pch_uart: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-20 12:14 ` Greg Kroah-Hartman 2020-09-20 12:14 ` Greg Kroah-Hartman 2020-09-20 12:47 ` Julia Lawall 2020-09-20 12:47 ` Julia Lawall 2020-09-27 12:11 ` Greg Kroah-Hartman 2020-09-27 12:11 ` Greg Kroah-Hartman 2020-09-20 11:26 ` [PATCH 02/14] target/rd: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-10-08 2:31 ` Martin K. Petersen 2020-10-08 2:31 ` Martin K. Petersen 2020-09-20 11:26 ` [PATCH 03/14] dpaa2-eth: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-21 2:09 ` David Miller 2020-09-21 2:09 ` David Miller 2020-09-20 11:26 ` [PATCH 04/14] dmaengine: sh: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-10-05 4:48 ` Vinod Koul 2020-10-05 4:48 ` Vinod Koul 2020-09-20 11:26 ` [PATCH 05/14] RDMA/efa: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-21 7:13 ` Gal Pressman 2020-09-21 7:13 ` Gal Pressman 2020-09-22 23:27 ` Jason Gunthorpe 2020-09-22 23:27 ` Jason Gunthorpe 2020-09-20 11:26 ` [PATCH 06/14] block: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-23 15:18 ` Jens Axboe 2020-09-23 15:18 ` Jens Axboe 2020-09-20 11:26 ` [PATCH 07/14] RDS: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-21 2:09 ` David Miller 2020-09-21 2:09 ` David Miller 2020-09-20 11:26 ` [PATCH 08/14] xprtrdma: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-20 15:37 ` Chuck Lever 2020-09-20 15:37 ` Chuck Lever 2020-09-20 11:26 ` [PATCH 09/14] dmaengine: rcar-dmac: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-10-05 4:48 ` Vinod Koul 2020-10-05 4:48 ` Vinod Koul 2020-09-20 11:26 ` [PATCH 10/14] iwlwifi: dbg_ini: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-20 11:26 ` Julia Lawall [this message] 2020-09-20 11:26 ` [PATCH 11/14] spi/topcliff-pch: " Julia Lawall 2020-09-20 11:26 ` [PATCH 12/14] [media] saa7146: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-20 11:26 ` [PATCH 13/14] misc: mic: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-20 11:26 ` [PATCH 14/14] PCI/P2PDMA: " Julia Lawall 2020-09-20 11:26 ` Julia Lawall 2020-09-28 22:24 ` Bjorn Helgaas 2020-09-28 22:24 ` Bjorn Helgaas 2020-09-21 16:58 ` [PATCH 00/14] " Mark Brown 2020-09-21 16:58 ` Mark Brown 2020-09-23 15:10 ` Rolf Reintjes 2020-09-23 15:10 ` Rolf Reintjes 2020-09-23 15:16 ` Mark Brown 2020-09-23 15:16 ` Mark Brown 2020-10-13 22:42 ` Martin K. Petersen 2020-10-13 22:42 ` Martin K. Petersen
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1600601186-7420-12-git-send-email-Julia.Lawall@inria.fr \ --to=julia.lawall@inria.fr \ --cc=broonie@kernel.org \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-spi@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.