From: Jeff Garzik <jeff@garzik.org>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-scsi@vger.kernel.org, Matthew Wilcox <willy@linux.intel.com>
Subject: Re: [PATCH 3/17] sym53c8xx: Remove data_mapping and data_mapped
Date: Fri, 05 Oct 2007 16:52:17 -0400 [thread overview]
Message-ID: <4706A401.1060308@garzik.org> (raw)
In-Reply-To: <11916141144042-git-send-email-matthew@wil.cx>
Matthew Wilcox wrote:
> Before all commands used sg, data_mapping and data_mapped were used to
> distinguish whether the command had used map_single or map_sg. Now all
> commands are sg, so we can delete data_mapping, data_mapped and the
> wrapper functions __unmap_scsi_data, __map_scsi_sg_data, unmap_scsi_data
> and map_scsi_sg_data.
>
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> ---
> drivers/scsi/sym53c8xx_2/sym_glue.c | 33 +++------------------------------
> 1 files changed, 3 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
> index 11e0a28..924b5dd 100644
> --- a/drivers/scsi/sym53c8xx_2/sym_glue.c
> +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
> @@ -134,8 +134,6 @@ static struct scsi_transport_template *sym2_transport_template = NULL;
> * Driver private area in the SCSI command structure.
> */
> struct sym_ucmd { /* Override the SCSI pointer structure */
> - dma_addr_t data_mapping;
> - unsigned char data_mapped;
> unsigned char to_do; /* For error handling */
> void (*old_done)(struct scsi_cmnd *); /* For error handling */
> struct completion *eh_done; /* For error handling */
> @@ -144,37 +142,12 @@ struct sym_ucmd { /* Override the SCSI pointer structure */
> #define SYM_UCMD_PTR(cmd) ((struct sym_ucmd *)(&(cmd)->SCp))
> #define SYM_SOFTC_PTR(cmd) sym_get_hcb(cmd->device->host)
>
> -static void __unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
> -{
> - if (SYM_UCMD_PTR(cmd)->data_mapped)
> - scsi_dma_unmap(cmd);
> -
> - SYM_UCMD_PTR(cmd)->data_mapped = 0;
> -}
> -
> -static int __map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
> -{
> - int use_sg;
> -
> - use_sg = scsi_dma_map(cmd);
> - if (use_sg > 0) {
> - SYM_UCMD_PTR(cmd)->data_mapped = 2;
> - SYM_UCMD_PTR(cmd)->data_mapping = use_sg;
> - }
> -
> - return use_sg;
> -}
> -
> -#define unmap_scsi_data(np, cmd) \
> - __unmap_scsi_data(np->s.device, cmd)
> -#define map_scsi_sg_data(np, cmd) \
> - __map_scsi_sg_data(np->s.device, cmd)
> /*
> * Complete a pending CAM CCB.
> */
> void sym_xpt_done(struct sym_hcb *np, struct scsi_cmnd *cmd)
> {
> - unmap_scsi_data(np, cmd);
> + scsi_dma_unmap(cmd);
> cmd->scsi_done(cmd);
> }
>
> @@ -307,14 +280,14 @@ static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd
>
> cp->data_len = 0;
>
> - use_sg = map_scsi_sg_data(np, cmd);
> + use_sg = scsi_dma_map(cmd);
> if (use_sg > 0) {
> struct scatterlist *sg;
> struct sym_tcb *tp = &np->target[cp->target];
> struct sym_tblmove *data;
>
> if (use_sg > SYM_CONF_MAX_SG) {
> - unmap_scsi_data(np, cmd);
> + scsi_dma_unmap(cmd);
> return -1;
check scsi_dma_map() for negative return value (failure)
ACK once that is done
next prev parent reply other threads:[~2007-10-05 20:52 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-05 19:54 [PATCH 1/17] sym53c8xx: Work around 53c896 erratum Matthew Wilcox
2007-10-05 19:54 ` [PATCH 2/17] sym53c8xx: Use pci_dev irq number Matthew Wilcox
2007-10-05 20:51 ` Jeff Garzik
2007-10-05 19:55 ` [PATCH 3/17] sym53c8xx: Remove data_mapping and data_mapped Matthew Wilcox
2007-10-05 20:52 ` Jeff Garzik [this message]
2007-10-05 19:55 ` [PATCH 4/17] sym53c8xx: Remove unnecessary check in queuecommand Matthew Wilcox
2007-10-05 19:55 ` [PATCH 5/17] sym53c8xx: Don't disable interrupts in the interrupt handler Matthew Wilcox
2007-10-05 19:55 ` [PATCH 6/17] sym53c8xx: Stop overriding scsi_done Matthew Wilcox
2007-10-05 19:55 ` [PATCH 7/17] sym53c8xx: PCI Error Recovery support Matthew Wilcox
2007-10-05 20:54 ` Jeff Garzik
2007-10-05 19:55 ` [PATCH 8/17] sym53c8xx: Use pdev->revision Matthew Wilcox
2007-10-05 19:55 ` [PATCH 9/17] sym53c8xx: Remove ->device_id Matthew Wilcox
2007-10-05 19:55 ` [PATCH 10/17] sym53c8xx: Remove io_ws, mmio_ws and ram_ws elements Matthew Wilcox
2007-10-05 20:55 ` Jeff Garzik
2007-10-05 19:55 ` [PATCH 11/17] sym53c8xx: Remove tag_ctrl module parameter Matthew Wilcox
2007-10-05 20:56 ` Jeff Garzik
2007-10-09 15:35 ` Matthew Wilcox
2007-10-05 19:55 ` [PATCH 12/17] sym53c8xx: Simplify DAC DMA handling Matthew Wilcox
2007-10-05 19:55 ` [PATCH 13/17] sym53c8xx: Use scmd_printk where appropriate Matthew Wilcox
2007-10-05 20:59 ` Jeff Garzik
2007-10-05 19:55 ` [PATCH 14/17] sym53c8xx: Get rid of IRQ_FMT and IRQ_PRM Matthew Wilcox
2007-10-05 20:59 ` Jeff Garzik
2007-10-09 15:28 ` Matthew Wilcox
2007-10-09 15:35 ` Jeff Garzik
2007-10-09 15:44 ` Matthew Wilcox
2007-10-09 15:47 ` Jeff Garzik
2007-10-05 19:55 ` [PATCH 15/17] sym53c8xx: Make interrupt handler capable of returning IRQ_NONE Matthew Wilcox
2007-10-05 21:04 ` Jeff Garzik
2007-10-05 19:55 ` [PATCH 16/17] sym53c8xx: Remove pci_dev pointer from sym_shcb Matthew Wilcox
2007-10-05 21:07 ` Jeff Garzik
2007-10-09 15:27 ` Matthew Wilcox
2007-10-05 19:55 ` [PATCH 17/17] sym53c8xx: Remove sym_xpt_async_sent_bdr Matthew Wilcox
2007-10-05 21:07 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4706A401.1060308@garzik.org \
--to=jeff@garzik.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=willy@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.