block: mtip32xx: Remove call to memset after dma_alloc_coherent
authorFuqian Huang <huangfq.daxian@gmail.com>
Thu, 27 Jun 2019 17:35:04 +0000 (01:35 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 29 Jun 2019 15:42:50 +0000 (09:42 -0600)
In commit af7ddd8a627c
("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/mtip32xx/mtip32xx.c

index a14b09ab3a418d460ac840a4415a6d373c044f13..964f78cfffa0a189b4282927596a48189db02ff9 100644 (file)
@@ -1577,7 +1577,6 @@ static int exec_drive_command(struct mtip_port *port, u8 *command,
                                ATA_SECT_SIZE * xfer_sz);
                        return -ENOMEM;
                }
-               memset(buf, 0, ATA_SECT_SIZE * xfer_sz);
        }
 
        /* Build the FIS. */
@@ -2776,7 +2775,6 @@ static int mtip_dma_alloc(struct driver_data *dd)
                                        &port->block1_dma, GFP_KERNEL);
        if (!port->block1)
                return -ENOMEM;
-       memset(port->block1, 0, BLOCK_DMA_ALLOC_SZ);
 
        /* Allocate dma memory for command list */
        port->command_list =
@@ -2789,7 +2787,6 @@ static int mtip_dma_alloc(struct driver_data *dd)
                port->block1_dma = 0;
                return -ENOMEM;
        }
-       memset(port->command_list, 0, AHCI_CMD_TBL_SZ);
 
        /* Setup all pointers into first DMA region */
        port->rxfis         = port->block1 + AHCI_RX_FIS_OFFSET;
@@ -3529,8 +3526,6 @@ static int mtip_init_cmd(struct blk_mq_tag_set *set, struct request *rq,
        if (!cmd->command)
                return -ENOMEM;
 
-       memset(cmd->command, 0, CMD_DMA_ALLOC_SZ);
-
        sg_init_table(cmd->sg, MTIP_MAX_SG);
        return 0;
 }