forked from Minki/linux
a1108c7b2e
Clang warns when one enumerated type is implicitly converted to another. drivers/spi/spi-ep93xx.c:342:62: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] nents = dma_map_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./include/linux/dma-mapping.h:428:58: note: expanded from macro 'dma_map_sg' #define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0) ~~~~~~~~~~~~~~~~ ^ drivers/spi/spi-ep93xx.c:348:57: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./include/linux/dma-mapping.h:429:62: note: expanded from macro 'dma_unmap_sg' #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0) ~~~~~~~~~~~~~~~~~~ ^ drivers/spi/spi-ep93xx.c:377:56: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./include/linux/dma-mapping.h:429:62: note: expanded from macro 'dma_unmap_sg' #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0) ~~~~~~~~~~~~~~~~~~ ^ 3 warnings generated. dma_{,un}map_sg expect an enum of type dma_data_direction but this driver uses dma_transfer_direction for everything. Convert the driver to use dma_data_direction for these two functions. There are two places that strictly require an enum of type dma_transfer_direction: the direction member in struct dma_slave_config and the direction parameter in dmaengine_prep_slave_sg. To avoid using an explicit cast, add a simple function, ep93xx_dma_data_to_trans_dir, to safely map between the two types because they are not 1 to 1 in meaning. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> |
||
---|---|---|
.. | ||
internals.h | ||
Kconfig | ||
Makefile | ||
spi-altera.c | ||
spi-armada-3700.c | ||
spi-ath79.c | ||
spi-atmel.c | ||
spi-au1550.c | ||
spi-axi-spi-engine.c | ||
spi-bcm63xx-hsspi.c | ||
spi-bcm63xx.c | ||
spi-bcm2835.c | ||
spi-bcm2835aux.c | ||
spi-bcm-qspi.c | ||
spi-bcm-qspi.h | ||
spi-bitbang-txrx.h | ||
spi-bitbang.c | ||
spi-brcmstb-qspi.c | ||
spi-butterfly.c | ||
spi-cadence.c | ||
spi-cavium-octeon.c | ||
spi-cavium-thunderx.c | ||
spi-cavium.c | ||
spi-cavium.h | ||
spi-clps711x.c | ||
spi-coldfire-qspi.c | ||
spi-davinci.c | ||
spi-dln2.c | ||
spi-dw-mid.c | ||
spi-dw-mmio.c | ||
spi-dw-pci.c | ||
spi-dw.c | ||
spi-dw.h | ||
spi-efm32.c | ||
spi-ep93xx.c | ||
spi-falcon.c | ||
spi-fsl-cpm.c | ||
spi-fsl-cpm.h | ||
spi-fsl-dspi.c | ||
spi-fsl-espi.c | ||
spi-fsl-lib.c | ||
spi-fsl-lib.h | ||
spi-fsl-lpspi.c | ||
spi-fsl-spi.c | ||
spi-fsl-spi.h | ||
spi-gpio.c | ||
spi-img-spfi.c | ||
spi-imx.c | ||
spi-iproc-qspi.c | ||
spi-jcore.c | ||
spi-lantiq-ssc.c | ||
spi-lm70llp.c | ||
spi-loopback-test.c | ||
spi-lp8841-rtc.c | ||
spi-mem.c | ||
spi-meson-spicc.c | ||
spi-meson-spifc.c | ||
spi-mpc52xx-psc.c | ||
spi-mpc52xx.c | ||
spi-mpc512x-psc.c | ||
spi-mt65xx.c | ||
spi-mxs.c | ||
spi-nuc900.c | ||
spi-oc-tiny.c | ||
spi-omap2-mcspi.c | ||
spi-omap-100k.c | ||
spi-omap-uwire.c | ||
spi-orion.c | ||
spi-pic32-sqi.c | ||
spi-pic32.c | ||
spi-pl022.c | ||
spi-ppc4xx.c | ||
spi-pxa2xx-dma.c | ||
spi-pxa2xx-pci.c | ||
spi-pxa2xx.c | ||
spi-pxa2xx.h | ||
spi-qup.c | ||
spi-rb4xx.c | ||
spi-rockchip.c | ||
spi-rspi.c | ||
spi-s3c24xx-fiq.h | ||
spi-s3c24xx-fiq.S | ||
spi-s3c24xx.c | ||
spi-s3c64xx.c | ||
spi-sc18is602.c | ||
spi-sh-hspi.c | ||
spi-sh-msiof.c | ||
spi-sh-sci.c | ||
spi-sh.c | ||
spi-sirf.c | ||
spi-slave-mt27xx.c | ||
spi-slave-system-control.c | ||
spi-slave-time.c | ||
spi-sprd-adi.c | ||
spi-sprd.c | ||
spi-st-ssc4.c | ||
spi-stm32.c | ||
spi-sun4i.c | ||
spi-sun6i.c | ||
spi-tegra20-sflash.c | ||
spi-tegra20-slink.c | ||
spi-tegra114.c | ||
spi-test.h | ||
spi-ti-qspi.c | ||
spi-tle62x0.c | ||
spi-topcliff-pch.c | ||
spi-txx9.c | ||
spi-uniphier.c | ||
spi-xcomm.c | ||
spi-xilinx.c | ||
spi-xlp.c | ||
spi-xtensa-xtfpga.c | ||
spi-zynqmp-gqspi.c | ||
spi.c | ||
spidev.c |