lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070531171107.3d665158@gondolin.boeblingen.de.ibm.com>
Date:	Thu, 31 May 2007 17:11:07 +0200
From:	Cornelia Huck <cornelia.huck@...ibm.com>
To:	Jeff Garzik <jeff@...zik.org>
Cc:	Matthew Wilcox <matthew@....cx>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org,
	SCSI development list <linux-scsi@...r.kernel.org>,
	James Bottomley <James.Bottomley@...elEye.com>,
	Dan Williams <dan.j.williams@...el.com>
Subject: Re: 2.6.22-rc3-mm1

On Thu, 31 May 2007 08:35:13 -0400,
Jeff Garzik <jeff@...zik.org> wrote:

> Cornelia Huck wrote:
> > On Thu, 31 May 2007 06:15:57 -0600,
> > Matthew Wilcox <matthew@....cx> wrote:
> > 
> >> On Thu, May 31, 2007 at 02:09:22PM +0200, Cornelia Huck wrote:
> >>> I split those functions out into a new file. Builds on s390 and i386.
> >> Why not just put #ifdef CONFIG_HAS_DMA / #endif around the pair of
> >> functions?  I don't see the need to add a new Kconfig symbol and a new
> >> file for this.
> > 
> > I prefer a new file over #ifdefs in c files. (New dma-dependent stuff
> > would also have a place where it could go to.)
> > 
> > But I'll do whatever ends up as consensus :)
> 
> 50 lines isn't much need for a new file.

OK, so here's an alternative patch:


scsi: Don't build scsi_dma_{map,unmap} for !HAS_DMA

Use #ifdef CONFIG_HAS_DMA for the two dma-dependent functions.

Signed-off-by: Cornelia Huck <cornelia.huck@...ibm.com>

---
 drivers/scsi/scsi_lib.c  |    2 ++
 include/scsi/scsi_cmnd.h |    2 ++
 2 files changed, 4 insertions(+)

--- linux-2.6.orig/drivers/scsi/scsi_lib.c
+++ linux-2.6/drivers/scsi/scsi_lib.c
@@ -2291,6 +2291,7 @@ void scsi_kunmap_atomic_sg(void *virt)
 }
 EXPORT_SYMBOL(scsi_kunmap_atomic_sg);
 
+#ifdef CONFIG_HAS_DMA
 /**
  * scsi_dma_map - perform DMA mapping against command's sg lists
  * @cmd:	scsi command
@@ -2328,3 +2329,4 @@ void scsi_dma_unmap(struct scsi_cmnd *cm
 	}
 }
 EXPORT_SYMBOL(scsi_dma_unmap);
+#endif
--- linux-2.6.orig/include/scsi/scsi_cmnd.h
+++ linux-2.6/include/scsi/scsi_cmnd.h
@@ -135,8 +135,10 @@ extern void scsi_kunmap_atomic_sg(void *
 extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t);
 extern void scsi_free_sgtable(struct scatterlist *, int);
 
+#ifdef CONFIG_HAS_DMA
 extern int scsi_dma_map(struct scsi_cmnd *cmd);
 extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
+#endif
 
 #define scsi_sg_count(cmd) ((cmd)->use_sg)
 #define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ