mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	debugfs: make debugfs_create_u32_array() return void
The single user of debugfs_create_u32_array() does not care about the return value of it, so make it return void as there is no need to do anything with the return value. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
							parent
							
								
									36b7ee4dce
								
							
						
					
					
						commit
						c9c2c27d7c
					
				
					 3 changed files with 10 additions and 18 deletions
				
			
		| 
						 | 
					@ -169,7 +169,7 @@ byte offsets over a base for the register block.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you want to dump an u32 array in debugfs, you can create file with:
 | 
					If you want to dump an u32 array in debugfs, you can create file with:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
 | 
					    void debugfs_create_u32_array(const char *name, umode_t mode,
 | 
				
			||||||
			struct dentry *parent,
 | 
								struct dentry *parent,
 | 
				
			||||||
			u32 *array, u32 elements);
 | 
								u32 *array, u32 elements);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -997,25 +997,19 @@ static const struct file_operations u32_array_fops = {
 | 
				
			||||||
 * @array as data. If the @mode variable is so set it can be read from.
 | 
					 * @array as data. If the @mode variable is so set it can be read from.
 | 
				
			||||||
 * Writing is not supported. Seek within the file is also not supported.
 | 
					 * Writing is not supported. Seek within the file is also not supported.
 | 
				
			||||||
 * Once array is created its size can not be changed.
 | 
					 * Once array is created its size can not be changed.
 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * The function returns a pointer to dentry on success. If an error occurs,
 | 
					 | 
				
			||||||
 * %ERR_PTR(-ERROR) or NULL will be returned. If debugfs is not enabled in
 | 
					 | 
				
			||||||
 * the kernel, the value %ERR_PTR(-ENODEV) will be returned.
 | 
					 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
 | 
					void debugfs_create_u32_array(const char *name, umode_t mode,
 | 
				
			||||||
					    struct dentry *parent,
 | 
								      struct dentry *parent, u32 *array, u32 elements)
 | 
				
			||||||
					    u32 *array, u32 elements)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct array_data *data = kmalloc(sizeof(*data), GFP_KERNEL);
 | 
						struct array_data *data = kmalloc(sizeof(*data), GFP_KERNEL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (data == NULL)
 | 
						if (data == NULL)
 | 
				
			||||||
		return NULL;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	data->array = array;
 | 
						data->array = array;
 | 
				
			||||||
	data->elements = elements;
 | 
						data->elements = elements;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return debugfs_create_file_unsafe(name, mode, parent, data,
 | 
						debugfs_create_file_unsafe(name, mode, parent, data, &u32_array_fops);
 | 
				
			||||||
					&u32_array_fops);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL_GPL(debugfs_create_u32_array);
 | 
					EXPORT_SYMBOL_GPL(debugfs_create_u32_array);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,9 +133,8 @@ struct dentry *debugfs_create_regset32(const char *name, umode_t mode,
 | 
				
			||||||
void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
 | 
					void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
 | 
				
			||||||
			  int nregs, void __iomem *base, char *prefix);
 | 
								  int nregs, void __iomem *base, char *prefix);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
 | 
					void debugfs_create_u32_array(const char *name, umode_t mode,
 | 
				
			||||||
					struct dentry *parent,
 | 
								      struct dentry *parent, u32 *array, u32 elements);
 | 
				
			||||||
					u32 *array, u32 elements);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
 | 
					struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
 | 
				
			||||||
					   struct dentry *parent,
 | 
										   struct dentry *parent,
 | 
				
			||||||
| 
						 | 
					@ -353,11 +352,10 @@ static inline bool debugfs_initialized(void)
 | 
				
			||||||
	return false;
 | 
						return false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
 | 
					static inline void debugfs_create_u32_array(const char *name, umode_t mode,
 | 
				
			||||||
					struct dentry *parent,
 | 
										    struct dentry *parent, u32 *array,
 | 
				
			||||||
					u32 *array, u32 elements)
 | 
										    u32 elements)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return ERR_PTR(-ENODEV);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
 | 
					static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue