diff --git a/[refs] b/[refs] index 5971b9f4cc34..6b8252464302 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ba4b87ad5497cba555954885db99c99627f93748 +refs/heads/master: ded467374a34eb80020c2213456b1d9ca946b88c diff --git a/trunk/arch/x86/kernel/amd_iommu.c b/trunk/arch/x86/kernel/amd_iommu.c index 57ca77787220..eebd504519c6 100644 --- a/trunk/arch/x86/kernel/amd_iommu.c +++ b/trunk/arch/x86/kernel/amd_iommu.c @@ -383,6 +383,13 @@ irqreturn_t amd_iommu_int_handler(int irq, void *data) * ****************************************************************************/ +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. @@ -458,9 +465,7 @@ static int __iommu_completion_wait(struct amd_iommu *iommu) { 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); } diff --git a/trunk/lib/dma-debug.c b/trunk/lib/dma-debug.c index db07bfd9298e..4bfb0471f106 100644 --- a/trunk/lib/dma-debug.c +++ b/trunk/lib/dma-debug.c @@ -649,7 +649,7 @@ static int dma_debug_fs_init(void) return -ENOMEM; } -static int device_dma_allocations(struct device *dev, struct dma_debug_entry **out_entry) +static int device_dma_allocations(struct device *dev) { struct dma_debug_entry *entry; unsigned long flags; @@ -660,10 +660,8 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **o for (i = 0; i < HASH_SIZE; ++i) { spin_lock(&dma_entry_hash[i].lock); list_for_each_entry(entry, &dma_entry_hash[i].list, list) { - if (entry->dev == dev) { + if (entry->dev == dev) count += 1; - *out_entry = entry; - } } spin_unlock(&dma_entry_hash[i].lock); } @@ -676,7 +674,6 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **o static int dma_debug_device_change(struct notifier_block *nb, unsigned long action, void *data) { struct device *dev = data; - struct dma_debug_entry *uninitialized_var(entry); int count; if (global_disable) @@ -684,17 +681,12 @@ static int dma_debug_device_change(struct notifier_block *nb, unsigned long acti switch (action) { case BUS_NOTIFY_UNBOUND_DRIVER: - count = device_dma_allocations(dev, &entry); + count = device_dma_allocations(dev); if (count == 0) break; - err_printk(dev, entry, "DMA-API: device driver has pending " + err_printk(dev, NULL, "DMA-API: device driver has pending " "DMA allocations while released from device " - "[count=%d]\n" - "One of leaked entries details: " - "[device address=0x%016llx] [size=%llu bytes] " - "[mapped with %s] [mapped as %s]\n", - count, entry->dev_addr, entry->size, - dir2name[entry->direction], type2name[entry->type]); + "[count=%d]\n", count); break; default: break;