Skip to content

Commit bff739b

Browse files
geertuChristoph Hellwig
authored andcommitted
scsi: Add NO_DMA dummies for SCSI DMA mapping API
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 <[email protected]> Reviewed-by: Mark Brown <[email protected]> Acked-by: Robin Murphy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent c1ce6c2 commit bff739b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/scsi/scsi_cmnd.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,13 @@ extern void scsi_kunmap_atomic_sg(void *virt);
174174

175175
extern int scsi_init_io(struct scsi_cmnd *cmd);
176176

177+
#ifdef CONFIG_SCSI_DMA
177178
extern int scsi_dma_map(struct scsi_cmnd *cmd);
178179
extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
180+
#else /* !CONFIG_SCSI_DMA */
181+
static inline int scsi_dma_map(struct scsi_cmnd *cmd) { return -ENOSYS; }
182+
static inline void scsi_dma_unmap(struct scsi_cmnd *cmd) { }
183+
#endif /* !CONFIG_SCSI_DMA */
179184

180185
static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd)
181186
{

0 commit comments

Comments
 (0)