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

Configure Feed

Select the types of activity you want to include in your feed.

panic: sys_info: deduplicate local variable 'table; assignments

The both handlers use the local 'table' variable and assign the same data
to it, deduplicate that.

Link: https://lkml.kernel.org/r/20251030132007.3742368-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Feng Tang <feng.tang@linux.alibaba.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Andy Shevchenko and committed by
Andrew Morton
f791dcc8 eb72c466

+4 -6
+4 -6
lib/sys_info.c
··· 63 63 if (!names) 64 64 return -ENOMEM; 65 65 66 + table = *ro_table; 67 + table.data = names; 68 + table.maxlen = maxlen; 69 + 66 70 if (write) { 67 71 int ret; 68 72 69 - table = *ro_table; 70 - table.data = names; 71 - table.maxlen = maxlen; 72 73 ret = proc_dostring(&table, write, buffer, lenp, ppos); 73 74 if (ret) 74 75 return ret; ··· 94 93 } 95 94 } 96 95 97 - table = *ro_table; 98 - table.data = names; 99 - table.maxlen = maxlen; 100 96 return proc_dostring(&table, write, buffer, lenp, ppos); 101 97 } 102 98 }