Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -18
+1 -1
Documentation/filesystems/debugfs.txt
··· 169 169 170 170 If you want to dump an u32 array in debugfs, you can create file with: 171 171 172 - struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, 172 + void debugfs_create_u32_array(const char *name, umode_t mode, 173 173 struct dentry *parent, 174 174 u32 *array, u32 elements); 175 175
+4 -10
fs/debugfs/file.c
··· 997 997 * @array as data. If the @mode variable is so set it can be read from. 998 998 * Writing is not supported. Seek within the file is also not supported. 999 999 * Once array is created its size can not be changed. 1000 - * 1001 - * The function returns a pointer to dentry on success. If an error occurs, 1002 - * %ERR_PTR(-ERROR) or NULL will be returned. If debugfs is not enabled in 1003 - * the kernel, the value %ERR_PTR(-ENODEV) will be returned. 1004 1000 */ 1005 - struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, 1006 - struct dentry *parent, 1007 - u32 *array, u32 elements) 1001 + void debugfs_create_u32_array(const char *name, umode_t mode, 1002 + struct dentry *parent, u32 *array, u32 elements) 1008 1003 { 1009 1004 struct array_data *data = kmalloc(sizeof(*data), GFP_KERNEL); 1010 1005 1011 1006 if (data == NULL) 1012 - return NULL; 1007 + return; 1013 1008 1014 1009 data->array = array; 1015 1010 data->elements = elements; 1016 1011 1017 - return debugfs_create_file_unsafe(name, mode, parent, data, 1018 - &u32_array_fops); 1012 + debugfs_create_file_unsafe(name, mode, parent, data, &u32_array_fops); 1019 1013 } 1020 1014 EXPORT_SYMBOL_GPL(debugfs_create_u32_array); 1021 1015
+5 -7
include/linux/debugfs.h
··· 133 133 void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, 134 134 int nregs, void __iomem *base, char *prefix); 135 135 136 - struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, 137 - struct dentry *parent, 138 - u32 *array, u32 elements); 136 + void debugfs_create_u32_array(const char *name, umode_t mode, 137 + struct dentry *parent, u32 *array, u32 elements); 139 138 140 139 struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, 141 140 struct dentry *parent, ··· 352 353 return false; 353 354 } 354 355 355 - static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, 356 - struct dentry *parent, 357 - u32 *array, u32 elements) 356 + static inline void debugfs_create_u32_array(const char *name, umode_t mode, 357 + struct dentry *parent, u32 *array, 358 + u32 elements) 358 359 { 359 - return ERR_PTR(-ENODEV); 360 360 } 361 361 362 362 static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,