{
#ifdef CONFIG_STACKTRACE
if (entry) {
- printk(KERN_WARNING "Mapped at:\n");
+ pr_warning("Mapped at:\n");
print_stack_trace(&entry->stacktrace, 0);
}
#endif
spin_lock_irqsave(&free_entries_lock, flags);
if (list_empty(&free_entries)) {
- printk(KERN_ERR "DMA-API: debugging out of memory "
- "- disabling\n");
+ pr_err("DMA-API: debugging out of memory - disabling\n");
global_disable = true;
goto out;
}
num_free_entries = num_entries;
min_free_entries = num_entries;
- printk(KERN_INFO "DMA-API: preallocated %d debug entries\n",
- num_entries);
+ pr_info("DMA-API: preallocated %d debug entries\n", num_entries);
return 0;
* disabled. Since copy_from_user can fault and may sleep we
* need to copy to temporary buffer first
*/
- len = min(count, NAME_MAX_LEN - 1);
+ len = min(count, (size_t)(NAME_MAX_LEN - 1));
if (copy_from_user(buf, userbuf, len))
return -EFAULT;
* switched off.
*/
if (current_driver_name[0])
- printk(KERN_INFO "DMA-API: switching off dma-debug "
- "driver filter\n");
+ pr_info("DMA-API: switching off dma-debug driver filter\n");
current_driver_name[0] = 0;
current_driver = NULL;
goto out_unlock;
current_driver_name[i] = 0;
current_driver = NULL;
- printk(KERN_INFO "DMA-API: enable driver filter for driver [%s]\n",
- current_driver_name);
+ pr_info("DMA-API: enable driver filter for driver [%s]\n",
+ current_driver_name);
out_unlock:
write_unlock_irqrestore(&driver_name_lock, flags);
{
dma_debug_dent = debugfs_create_dir("dma-api", NULL);
if (!dma_debug_dent) {
- printk(KERN_ERR "DMA-API: can not create debugfs directory\n");
+ pr_err("DMA-API: can not create debugfs directory\n");
return -ENOMEM;
}
nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL);
if (nb == NULL) {
- printk(KERN_ERR "dma_debug_add_bus: out of memory\n");
+ pr_err("dma_debug_add_bus: out of memory\n");
return;
}
}
if (dma_debug_fs_init() != 0) {
- printk(KERN_ERR "DMA-API: error creating debugfs entries "
- "- disabling\n");
+ pr_err("DMA-API: error creating debugfs entries - disabling\n");
global_disable = true;
return;
num_entries = req_entries;
if (prealloc_memory(num_entries) != 0) {
- printk(KERN_ERR "DMA-API: debugging out of memory error "
- "- disabled\n");
+ pr_err("DMA-API: debugging out of memory error - disabled\n");
global_disable = true;
return;
nr_total_entries = num_free_entries;
- printk(KERN_INFO "DMA-API: debugging enabled by kernel config\n");
+ pr_info("DMA-API: debugging enabled by kernel config\n");
}
static __init int dma_debug_cmdline(char *str)
return -EINVAL;
if (strncmp(str, "off", 3) == 0) {
- printk(KERN_INFO "DMA-API: debugging disabled on kernel "
- "command line\n");
+ pr_info("DMA-API: debugging disabled on kernel command line\n");
global_disable = true;
}
}
if (current_driver_name[0])
- printk(KERN_INFO "DMA-API: enable driver filter for "
- "driver [%s]\n", current_driver_name);
+ pr_info("DMA-API: enable driver filter for driver [%s]\n",
+ current_driver_name);
return 1;