Commit efac162a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen
Browse files

scsi: efct: Don't pass GFP_DMA to dma_alloc_coherent()

dma_alloc_coherent() ignores the zone specifiers so this is pointless and
confusing.

Link: https://lore.kernel.org/r/20211214163605.416288-1-hch@lst.de


Reviewed-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 99c66a88
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ efct_firmware_write(struct efct *efct, const u8 *buf, size_t buf_len,

	dma.size = FW_WRITE_BUFSIZE;
	dma.virt = dma_alloc_coherent(&efct->pci->dev,
				      dma.size, &dma.phys, GFP_DMA);
				      dma.size, &dma.phys, GFP_KERNEL);
	if (!dma.virt)
		return -ENOMEM;

+5 −5
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ efct_hw_setup_io(struct efct_hw *hw)
		dma = &hw->xfer_rdy;
		dma->size = sizeof(struct fcp_txrdy) * hw->config.n_io;
		dma->virt = dma_alloc_coherent(&efct->pci->dev,
					       dma->size, &dma->phys, GFP_DMA);
					       dma->size, &dma->phys, GFP_KERNEL);
		if (!dma->virt)
			return -ENOMEM;
	}
@@ -562,7 +562,7 @@ efct_hw_setup_io(struct efct_hw *hw)
					sizeof(struct sli4_sge);
			dma->virt = dma_alloc_coherent(&efct->pci->dev,
						       dma->size, &dma->phys,
						       GFP_DMA);
						       GFP_KERNEL);
			if (!dma->virt) {
				efc_log_err(hw->os, "dma_alloc fail %d\n", i);
				memset(&io->def_sgl, 0,
@@ -618,7 +618,7 @@ efct_hw_init_prereg_io(struct efct_hw *hw)
	memset(&req, 0, sizeof(struct efc_dma));
	req.size = 32 + sgls_per_request * 16;
	req.virt = dma_alloc_coherent(&efct->pci->dev, req.size, &req.phys,
				      GFP_DMA);
				      GFP_KERNEL);
	if (!req.virt) {
		kfree(sgls);
		return -ENOMEM;
@@ -1063,7 +1063,7 @@ efct_hw_init(struct efct_hw *hw)
	dma = &hw->loop_map;
	dma->size = SLI4_MIN_LOOP_MAP_BYTES;
	dma->virt = dma_alloc_coherent(&hw->os->pci->dev, dma->size, &dma->phys,
				       GFP_DMA);
				       GFP_KERNEL);
	if (!dma->virt)
		return -EIO;

@@ -1192,7 +1192,7 @@ efct_hw_rx_buffer_alloc(struct efct_hw *hw, u32 rqindex, u32 count,
		prq->dma.virt = dma_alloc_coherent(&efct->pci->dev,
						   prq->dma.size,
						   &prq->dma.phys,
						   GFP_DMA);
						   GFP_KERNEL);
		if (!prq->dma.virt) {
			efc_log_err(hw->os, "DMA allocation failed\n");
			kfree(rq_buf);
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ efct_io_pool_create(struct efct *efct, u32 num_sgl)
		io->rspbuf.size = SCSI_RSP_BUF_LENGTH;
		io->rspbuf.virt = dma_alloc_coherent(&efct->pci->dev,
						     io->rspbuf.size,
						     &io->rspbuf.phys, GFP_DMA);
						     &io->rspbuf.phys, GFP_KERNEL);
		if (!io->rspbuf.virt) {
			efc_log_err(efct, "dma_alloc rspbuf failed\n");
			efct_io_pool_free(io_pool);
+2 −2
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ efc_nport_alloc_read_sparm64(struct efc *efc, struct efc_nport *nport)
	nport->dma.size = EFC_SPARAM_DMA_SZ;
	nport->dma.virt = dma_alloc_coherent(&efc->pci->dev,
					     nport->dma.size, &nport->dma.phys,
					     GFP_DMA);
					     GFP_KERNEL);
	if (!nport->dma.virt) {
		efc_log_err(efc, "Failed to allocate DMA memory\n");
		efc_nport_free_resources(nport, EFC_EVT_NPORT_ALLOC_FAIL, data);
@@ -466,7 +466,7 @@ efc_cmd_domain_alloc(struct efc *efc, struct efc_domain *domain, u32 fcf)
	domain->dma.size = EFC_SPARAM_DMA_SZ;
	domain->dma.virt = dma_alloc_coherent(&efc->pci->dev,
					      domain->dma.size,
					      &domain->dma.phys, GFP_DMA);
					      &domain->dma.phys, GFP_KERNEL);
	if (!domain->dma.virt) {
		efc_log_err(efc, "Failed to allocate DMA memory\n");
		return -EIO;
+2 −2
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)
	/* now allocate DMA for request and response */
	els->io.req.size = reqlen;
	els->io.req.virt = dma_alloc_coherent(&efc->pci->dev, els->io.req.size,
					      &els->io.req.phys, GFP_DMA);
					      &els->io.req.phys, GFP_KERNEL);
	if (!els->io.req.virt) {
		mempool_free(els, efc->els_io_pool);
		spin_unlock_irqrestore(&node->els_ios_lock, flags);
@@ -80,7 +80,7 @@ efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)

	els->io.rsp.size = rsplen;
	els->io.rsp.virt = dma_alloc_coherent(&efc->pci->dev, els->io.rsp.size,
					      &els->io.rsp.phys, GFP_DMA);
					      &els->io.rsp.phys, GFP_KERNEL);
	if (!els->io.rsp.virt) {
		dma_free_coherent(&efc->pci->dev, els->io.req.size,
				  els->io.req.virt, els->io.req.phys);
Loading