*
****************************************************************************/
+static void build_completion_wait(struct iommu_cmd *cmd)
+{
+ memset(cmd, 0, sizeof(*cmd));
+ cmd->data[0] = CMD_COMPL_WAIT_INT_MASK;
+ CMD_SET_TYPE(cmd, CMD_COMPL_WAIT);
+}
+
/*
* Writes the command to the IOMMUs command buffer and informs the
* hardware about the new command. Must be called with iommu->lock held.
{
struct iommu_cmd cmd;
- memset(&cmd, 0, sizeof(cmd));
- cmd.data[0] = CMD_COMPL_WAIT_INT_MASK;
- CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT);
+ build_completion_wait(&cmd);
return __iommu_queue_command(iommu, &cmd);
}