* [PATCH/RFC,5/6] scsi: Add NO_DMA dummies for SCSI DMA mapping API
@ 2018-02-06 10:14 Geert Uytterhoeven
0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2018-02-06 10:14 UTC (permalink / raw)
To: Christoph Hellwig, Marek Szyprowski, Robin Murphy, Arnd Bergmann,
Mark Brown, Richard Weinberger
Cc: Felipe Balbi, Greg Kroah-Hartman, James E . J . Bottomley,
Martin K . Petersen, iommu, linux-usb, linux-scsi, linux-kernel,
linux-arch, Geert Uytterhoeven
Add dummies for scsi_dma_{,un}map(), to allow compile-testing if
NO_DMA=y.
This prevents the following from showing up later:
ERROR: "scsi_dma_unmap" [drivers/firewire/firewire-sbp2.ko] undefined!
ERROR: "scsi_dma_map" [drivers/firewire/firewire-sbp2.ko] undefined!
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/scsi/scsi_cmnd.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index d8d4a902a88dedbc..6a123d1dd2f80624 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -171,8 +171,13 @@ extern void scsi_kunmap_atomic_sg(void *virt);
extern int scsi_init_io(struct scsi_cmnd *cmd);
+#ifdef CONFIG_SCSI_DMA
extern int scsi_dma_map(struct scsi_cmnd *cmd);
extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
+#else /* !CONFIG_SCSI_DMA */
+static inline int scsi_dma_map(struct scsi_cmnd *cmd) { return -ENOSYS; }
+static inline void scsi_dma_unmap(struct scsi_cmnd *cmd) { }
+#endif /* !CONFIG_SCSI_DMA */
static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd)
{
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-02-06 10:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-06 10:14 [PATCH/RFC,5/6] scsi: Add NO_DMA dummies for SCSI DMA mapping API Geert Uytterhoeven
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).