linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: remove unecessary checking if dmac is NULL
@ 2019-10-30  7:45 Piotr Sroka
  2019-10-30  8:23 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Piotr Sroka @ 2019-10-30  7:45 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Piotr Sroka, linux-mtd, Miquel Raynal

Remove unecessary checking if dmac is NULL.

If Cadence nand controller driver uses DMA engine then cdns_ctrl->dmac
cannot be NULL. It is verified during driver initialization. 
If Cadence nand controller driver does not use DMA engine then 
CPU IO read/write are executed instead of slave DMA transfer. 
In that case cdns_ctrl->dmac is not used at all.

Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 
Signed-off-by: Piotr Sroka <piotrs@cadence.com>
---
 drivers/mtd/nand/raw/cadence-nand-controller.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/cadence-nand-controller.c b/drivers/mtd/nand/raw/cadence-nand-controller.c
index 91dabff4b09d..d32e2713f89e 100644
--- a/drivers/mtd/nand/raw/cadence-nand-controller.c
+++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
@@ -1886,7 +1886,7 @@ static int cadence_nand_read_buf(struct cdns_nand_ctrl *cdns_ctrl,
 		return 0;
 	}
 
-	if (cdns_ctrl->dmac && cadence_nand_dma_buf_ok(cdns_ctrl, buf, len)) {
+	if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, len)) {
 		status = cadence_nand_slave_dma_transfer(cdns_ctrl, buf,
 							 cdns_ctrl->io.dma,
 							 len, DMA_FROM_DEVICE);
@@ -1940,7 +1940,7 @@ static int cadence_nand_write_buf(struct cdns_nand_ctrl *cdns_ctrl,
 		return 0;
 	}
 
-	if (cdns_ctrl->dmac && cadence_nand_dma_buf_ok(cdns_ctrl, buf, len)) {
+	if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, len)) {
 		status = cadence_nand_slave_dma_transfer(cdns_ctrl, (void *)buf,
 							 cdns_ctrl->io.dma,
 							 len, DMA_TO_DEVICE);
-- 
2.15.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: remove unecessary checking if dmac is NULL
  2019-10-30  7:45 [PATCH] mtd: rawnand: remove unecessary checking if dmac is NULL Piotr Sroka
@ 2019-10-30  8:23 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2019-10-30  8:23 UTC (permalink / raw)
  To: Piotr Sroka, Dan Carpenter; +Cc: linux-mtd, Miquel Raynal

On Wed, 2019-10-30 at 07:45:09 UTC, Piotr Sroka wrote:
> Remove unecessary checking if dmac is NULL.
> 
> If Cadence nand controller driver uses DMA engine then cdns_ctrl->dmac
> cannot be NULL. It is verified during driver initialization. 
> If Cadence nand controller driver does not use DMA engine then 
> CPU IO read/write are executed instead of slave DMA transfer. 
> In that case cdns_ctrl->dmac is not used at all.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 
> Signed-off-by: Piotr Sroka <piotrs@cadence.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2019-10-30  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30  7:45 [PATCH] mtd: rawnand: remove unecessary checking if dmac is NULL Piotr Sroka
2019-10-30  8:23 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).