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

RAS: Fix return value from show_trace()

Documentation/filesystems/seq_file.rst describes the possible return
values from a "show()" function used by single_open().

show_trace() returns the value of "trace_count". This could be
interpreted as "SEQ_SKIP", or just confuse the calling function.

Change to just return "0" to avoid confusing anyone reading this code
and possibly using as a template. Reading "daemon_active" was never
an intended use case.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20221018165900.109029-1-tony.luck@intel.com

authored by

Tony Luck and committed by
Borislav Petkov
50865c14 a51cbd0d

+1 -1
+1 -1
drivers/ras/debugfs.c
··· 15 15 16 16 static int trace_show(struct seq_file *m, void *v) 17 17 { 18 - return atomic_read(&trace_count); 18 + return 0; 19 19 } 20 20 21 21 static int trace_open(struct inode *inode, struct file *file)