summaryrefslogtreecommitdiff
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-11-04 09:55:33 +0100
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-12-07 23:04:03 +0100
commit58272c1c0330f5f899f130d45ce845ca085de044 (patch)
treef8fdfe4d26169ae0d0394c0e6024ef0901386611 /drivers/ieee1394
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')
-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(
return cmd;
}
-static void sbp2util_free_command_dma(struct sbp2_command_info *cmd)
+/*
+ * Unmaps the DMAs of a command and moves the command to the completed ORB list.
+ * Must be called with lu->cmd_orb_lock held.
+ */
+static void sbp2util_mark_command_completed(struct sbp2_lu *lu,
+ struct sbp2_command_info *cmd)
{
- struct sbp2_lu *lu = (struct sbp2_lu *)
- cmd->Current_SCpnt->device->host->hostdata[0];
- struct hpsb_host *host;
-
- if (!lu) {
- SBP2_ERR("%s: lu == NULL", __FUNCTION__);
- return;
- }
-
- host = lu->ud->ne->host;
+ struct hpsb_host *host = lu->ud->ne->host;
if (cmd->cmd_dma) {
if (cmd->dma_type == CMD_DMA_SINGLE)
@@ -615,23 +611,11 @@ static void sbp2util_free_command_dma(struct sbp2_command_info *cmd)
cmd->dma_type = CMD_DMA_NONE;
cmd->cmd_dma = 0;
}
-
if (cmd->sge_buffer) {
pci_unmap_sg(host->pdev, cmd->sge_buffer,
cmd->dma_size, cmd->dma_dir);
cmd->sge_buffer = NULL;
}
-}
-
-/*
- * This function moves a command to the completed orb list.
- * Must be called with lu->cmd_orb_lock held.
- */
-static void sbp2util_mark_command_completed(
- struct sbp2_lu *lu,
- struct sbp2_command_info *cmd)
-{
- sbp2util_free_command_dma(cmd);
list_move_tail(&cmd->list, &lu->cmd_orb_completed);
}