aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-11-04 03:55:33 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-12-07 17:04:03 -0500
commit58272c1c0330f5f899f130d45ce845ca085de044 (patch)
treef8fdfe4d26169ae0d0394c0e6024ef0901386611 /drivers/ieee1394/sbp2.c
parent2a533b179dcfe941ccbe30344d14f39f6d7098ae (diff)
ieee1394: sbp2: wrap two functions into one
Move the body of a function into its only caller. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r--drivers/ieee1394/sbp2.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 187e26f0485d..5d3b96e0a951 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -591,18 +591,14 @@ static struct sbp2_command_info *sbp2util_allocate_command_orb(
591 return cmd; 591 return cmd;
592} 592}
593 593
594static void sbp2util_free_command_dma(struct sbp2_command_info *cmd) 594/*
595 * Unmaps the DMAs of a command and moves the command to the completed ORB list.
596 * Must be called with lu->cmd_orb_lock held.
597 */
598static void sbp2util_mark_command_completed(struct sbp2_lu *lu,
599 struct sbp2_command_info *cmd)
595{ 600{
596 struct sbp2_lu *lu = (struct sbp2_lu *) 601 struct hpsb_host *host = lu->ud->ne->host;
597 cmd->Current_SCpnt->device->host->hostdata[0];
598 struct hpsb_host *host;
599
600 if (!lu) {
601 SBP2_ERR("%s: lu == NULL", __FUNCTION__);
602 return;
603 }
604
605 host = lu->ud->ne->host;
606 602
607 if (cmd->cmd_dma) { 603 if (cmd->cmd_dma) {
608 if (cmd->dma_type == CMD_DMA_SINGLE) 604 if (cmd->dma_type == CMD_DMA_SINGLE)
@@ -615,23 +611,11 @@ static void sbp2util_free_command_dma(struct sbp2_command_info *cmd)
615 cmd->dma_type = CMD_DMA_NONE; 611 cmd->dma_type = CMD_DMA_NONE;
616 cmd->cmd_dma = 0; 612 cmd->cmd_dma = 0;
617 } 613 }
618
619 if (cmd->sge_buffer) { 614 if (cmd->sge_buffer) {
620 pci_unmap_sg(host->pdev, cmd->sge_buffer, 615 pci_unmap_sg(host->pdev, cmd->sge_buffer,
621 cmd->dma_size, cmd->dma_dir); 616 cmd->dma_size, cmd->dma_dir);
622 cmd->sge_buffer = NULL; 617 cmd->sge_buffer = NULL;
623 } 618 }
624}
625
626/*
627 * This function moves a command to the completed orb list.
628 * Must be called with lu->cmd_orb_lock held.
629 */
630static void sbp2util_mark_command_completed(
631 struct sbp2_lu *lu,
632 struct sbp2_command_info *cmd)
633{
634 sbp2util_free_command_dma(cmd);
635 list_move_tail(&cmd->list, &lu->cmd_orb_completed); 619 list_move_tail(&cmd->list, &lu->cmd_orb_completed);
636} 620}
637 621