diff options
author | Joe Perches <joe@perches.com> | 2014-09-29 19:08:26 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-11-05 14:13:38 -0500 |
commit | 9761536e1d9e9e1f325fb04d4ad46b15a39eb94a (patch) | |
tree | a640a6fb114ddecc4e1b87c1731ac9d2bb683797 | |
parent | a3816ab0e8fe542a89a53b82506a8ddac063fbe3 (diff) |
debugfs: Have debugfs_print_regs32() return void
The seq_printf() will soon just return void, and seq_has_overflowed()
should be used instead to see if the seq can no longer accept input.
As the return value of debugfs_print_regs32() has no users and
the seq_file descriptor should be checked with seq_has_overflowed()
instead of return values of functions, it is better to just have
debugfs_print_regs32() also return void.
Link: http://lkml.kernel.org/p/2634b19eb1c04a9d31148c1fe6f1f3819be95349.1412031505.git.joe@perches.com
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Joe Perches <joe@perches.com>
[ original change only updated seq_printf() return, added return of
void to debugfs_print_regs32() as well ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | Documentation/filesystems/debugfs.txt | 2 | ||||
-rw-r--r-- | fs/debugfs/file.c | 15 | ||||
-rw-r--r-- | include/linux/debugfs.h | 7 |
3 files changed, 12 insertions, 12 deletions
diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt index 3a863f692728..88ab81c79109 100644 --- a/Documentation/filesystems/debugfs.txt +++ b/Documentation/filesystems/debugfs.txt | |||
@@ -140,7 +140,7 @@ file. | |||
140 | struct dentry *parent, | 140 | struct dentry *parent, |
141 | struct debugfs_regset32 *regset); | 141 | struct debugfs_regset32 *regset); |
142 | 142 | ||
143 | int debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs, | 143 | void debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs, |
144 | int nregs, void __iomem *base, char *prefix); | 144 | int nregs, void __iomem *base, char *prefix); |
145 | 145 | ||
146 | The "base" argument may be 0, but you may want to build the reg32 array | 146 | The "base" argument may be 0, but you may want to build the reg32 array |
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 76c08c2beb2f..8e0f2f410189 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
@@ -692,18 +692,19 @@ EXPORT_SYMBOL_GPL(debugfs_create_u32_array); | |||
692 | * because some peripherals have several blocks of identical registers, | 692 | * because some peripherals have several blocks of identical registers, |
693 | * for example configuration of dma channels | 693 | * for example configuration of dma channels |
694 | */ | 694 | */ |
695 | int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | 695 | void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, |
696 | int nregs, void __iomem *base, char *prefix) | 696 | int nregs, void __iomem *base, char *prefix) |
697 | { | 697 | { |
698 | int i, ret = 0; | 698 | int i; |
699 | 699 | ||
700 | for (i = 0; i < nregs; i++, regs++) { | 700 | for (i = 0; i < nregs; i++, regs++) { |
701 | if (prefix) | 701 | if (prefix) |
702 | ret += seq_printf(s, "%s", prefix); | 702 | seq_printf(s, "%s", prefix); |
703 | ret += seq_printf(s, "%s = 0x%08x\n", regs->name, | 703 | seq_printf(s, "%s = 0x%08x\n", regs->name, |
704 | readl(base + regs->offset)); | 704 | readl(base + regs->offset)); |
705 | if (seq_has_overflowed(s)) | ||
706 | break; | ||
705 | } | 707 | } |
706 | return ret; | ||
707 | } | 708 | } |
708 | EXPORT_SYMBOL_GPL(debugfs_print_regs32); | 709 | EXPORT_SYMBOL_GPL(debugfs_print_regs32); |
709 | 710 | ||
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 4d0b4d1aa132..d84f8c254a87 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -92,8 +92,8 @@ struct dentry *debugfs_create_regset32(const char *name, umode_t mode, | |||
92 | struct dentry *parent, | 92 | struct dentry *parent, |
93 | struct debugfs_regset32 *regset); | 93 | struct debugfs_regset32 *regset); |
94 | 94 | ||
95 | int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | 95 | void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, |
96 | int nregs, void __iomem *base, char *prefix); | 96 | int nregs, void __iomem *base, char *prefix); |
97 | 97 | ||
98 | struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, | 98 | struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, |
99 | struct dentry *parent, | 99 | struct dentry *parent, |
@@ -233,10 +233,9 @@ static inline struct dentry *debugfs_create_regset32(const char *name, | |||
233 | return ERR_PTR(-ENODEV); | 233 | return ERR_PTR(-ENODEV); |
234 | } | 234 | } |
235 | 235 | ||
236 | static inline int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | 236 | static inline void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, |
237 | int nregs, void __iomem *base, char *prefix) | 237 | int nregs, void __iomem *base, char *prefix) |
238 | { | 238 | { |
239 | return 0; | ||
240 | } | 239 | } |
241 | 240 | ||
242 | static inline bool debugfs_initialized(void) | 241 | static inline bool debugfs_initialized(void) |