Skip to content

Commit

Permalink
scsi: dma-mapping: always provide dma_get_cache_alignment
Browse files Browse the repository at this point in the history
Provide the dummy version of dma_get_cache_alignment that always returns
1 even if CONFIG_HAS_DMA is not set, so that drivers and subsystems can
use it without ifdefs.

Cc: stable@vger.kernel.org
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Christoph Hellwig authored and Martin K. Petersen committed Nov 22, 2017
1 parent 7275359 commit 860dd44
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,15 +710,13 @@ static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
return ret;
}

#ifdef CONFIG_HAS_DMA
static inline int dma_get_cache_alignment(void)
{
#ifdef ARCH_DMA_MINALIGN
return ARCH_DMA_MINALIGN;
#endif
return 1;
}
#endif

/* flags for the coherent memory api */
#define DMA_MEMORY_EXCLUSIVE 0x01
Expand Down

0 comments on commit 860dd44

Please sign in to comment.