dma-buf: update debugfs output
Russell King observed 'wierd' looking output from debugfs, and also suggested better ways of getting device names (use KBUILD_MODNAME, dev_name()) This patch addresses these issues to make the debugfs output correct and better looking. While at it, replace seq_printf with seq_puts to remove the checkpatch.pl warnings. Reported-by: Russell King - ARM Linux <linux@arm.linux.org.uk> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
This commit is contained in:
		
					parent
					
						
							
								45f7fdc2ff
							
						
					
				
			
			
				commit
				
					
						c0b00a525c
					
				
			
		
					 2 changed files with 13 additions and 14 deletions
				
			
		| 
						 | 
					@ -616,36 +616,35 @@ static int dma_buf_describe(struct seq_file *s)
 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	seq_printf(s, "\nDma-buf Objects:\n");
 | 
						seq_puts(s, "\nDma-buf Objects:\n");
 | 
				
			||||||
	seq_printf(s, "\texp_name\tsize\tflags\tmode\tcount\n");
 | 
						seq_puts(s, "size\tflags\tmode\tcount\texp_name\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry(buf_obj, &db_list.head, list_node) {
 | 
						list_for_each_entry(buf_obj, &db_list.head, list_node) {
 | 
				
			||||||
		ret = mutex_lock_interruptible(&buf_obj->lock);
 | 
							ret = mutex_lock_interruptible(&buf_obj->lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (ret) {
 | 
							if (ret) {
 | 
				
			||||||
			seq_printf(s,
 | 
								seq_puts(s,
 | 
				
			||||||
				  "\tERROR locking buffer object: skipping\n");
 | 
									 "\tERROR locking buffer object: skipping\n");
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		seq_printf(s, "\t");
 | 
							seq_printf(s, "%08zu\t%08x\t%08x\t%08ld\t%s\n",
 | 
				
			||||||
 | 
									buf_obj->size,
 | 
				
			||||||
		seq_printf(s, "\t%s\t%08zu\t%08x\t%08x\t%08ld\n",
 | 
					 | 
				
			||||||
				buf_obj->exp_name, buf_obj->size,
 | 
					 | 
				
			||||||
				buf_obj->file->f_flags, buf_obj->file->f_mode,
 | 
									buf_obj->file->f_flags, buf_obj->file->f_mode,
 | 
				
			||||||
				(long)(buf_obj->file->f_count.counter));
 | 
									(long)(buf_obj->file->f_count.counter),
 | 
				
			||||||
 | 
									buf_obj->exp_name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		seq_printf(s, "\t\tAttached Devices:\n");
 | 
							seq_puts(s, "\tAttached Devices:\n");
 | 
				
			||||||
		attach_count = 0;
 | 
							attach_count = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		list_for_each_entry(attach_obj, &buf_obj->attachments, node) {
 | 
							list_for_each_entry(attach_obj, &buf_obj->attachments, node) {
 | 
				
			||||||
			seq_printf(s, "\t\t");
 | 
								seq_puts(s, "\t");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			seq_printf(s, "%s\n", attach_obj->dev->init_name);
 | 
								seq_printf(s, "%s\n", dev_name(attach_obj->dev));
 | 
				
			||||||
			attach_count++;
 | 
								attach_count++;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		seq_printf(s, "\n\t\tTotal %d devices attached\n",
 | 
							seq_printf(s, "Total %d devices attached\n\n",
 | 
				
			||||||
				attach_count);
 | 
									attach_count);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		count++;
 | 
							count++;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -171,7 +171,7 @@ struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops,
 | 
				
			||||||
			       size_t size, int flags, const char *);
 | 
								       size_t size, int flags, const char *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define dma_buf_export(priv, ops, size, flags)	\
 | 
					#define dma_buf_export(priv, ops, size, flags)	\
 | 
				
			||||||
	dma_buf_export_named(priv, ops, size, flags, __FILE__)
 | 
						dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int dma_buf_fd(struct dma_buf *dmabuf, int flags);
 | 
					int dma_buf_fd(struct dma_buf *dmabuf, int flags);
 | 
				
			||||||
struct dma_buf *dma_buf_get(int fd);
 | 
					struct dma_buf *dma_buf_get(int fd);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue