Skip to content

Commit d0b7788

Browse files
arndbKAGA-KOKO
authored andcommitted
x86/apic/uv: Avoid unused variable warning
When CONFIG_PROC_FS is disabled, the compiler warns about an unused variable: arch/x86/kernel/apic/x2apic_uv_x.c: In function 'uv_setup_proc_files': arch/x86/kernel/apic/x2apic_uv_x.c:1546:8: error: unused variable 'name' [-Werror=unused-variable] char *name = hubless ? "hubless" : "hubbed"; Simplify the code so this variable is no longer needed. Fixes: 8785968 ("x86/platform/uv: Add UV Hubbed/Hubless Proc FS Files") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b3a987b commit d0b7788

File tree

1 file changed

+6
-37
lines changed

1 file changed

+6
-37
lines changed

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,65 +1493,34 @@ static void check_efi_reboot(void)
14931493
}
14941494

14951495
/* Setup user proc fs files */
1496-
static int proc_hubbed_show(struct seq_file *file, void *data)
1496+
static int __maybe_unused proc_hubbed_show(struct seq_file *file, void *data)
14971497
{
14981498
seq_printf(file, "0x%x\n", uv_hubbed_system);
14991499
return 0;
15001500
}
15011501

1502-
static int proc_hubless_show(struct seq_file *file, void *data)
1502+
static int __maybe_unused proc_hubless_show(struct seq_file *file, void *data)
15031503
{
15041504
seq_printf(file, "0x%x\n", uv_hubless_system);
15051505
return 0;
15061506
}
15071507

1508-
static int proc_oemid_show(struct seq_file *file, void *data)
1508+
static int __maybe_unused proc_oemid_show(struct seq_file *file, void *data)
15091509
{
15101510
seq_printf(file, "%s/%s\n", oem_id, oem_table_id);
15111511
return 0;
15121512
}
15131513

1514-
static int proc_hubbed_open(struct inode *inode, struct file *file)
1515-
{
1516-
return single_open(file, proc_hubbed_show, (void *)NULL);
1517-
}
1518-
1519-
static int proc_hubless_open(struct inode *inode, struct file *file)
1520-
{
1521-
return single_open(file, proc_hubless_show, (void *)NULL);
1522-
}
1523-
1524-
static int proc_oemid_open(struct inode *inode, struct file *file)
1525-
{
1526-
return single_open(file, proc_oemid_show, (void *)NULL);
1527-
}
1528-
1529-
/* (struct is "non-const" as open function is set at runtime) */
1530-
static struct file_operations proc_version_fops = {
1531-
.read = seq_read,
1532-
.llseek = seq_lseek,
1533-
.release = single_release,
1534-
};
1535-
1536-
static const struct file_operations proc_oemid_fops = {
1537-
.open = proc_oemid_open,
1538-
.read = seq_read,
1539-
.llseek = seq_lseek,
1540-
.release = single_release,
1541-
};
1542-
15431514
static __init void uv_setup_proc_files(int hubless)
15441515
{
15451516
struct proc_dir_entry *pde;
1546-
char *name = hubless ? "hubless" : "hubbed";
15471517

15481518
pde = proc_mkdir(UV_PROC_NODE, NULL);
1549-
proc_create("oemid", 0, pde, &proc_oemid_fops);
1550-
proc_create(name, 0, pde, &proc_version_fops);
1519+
proc_create_single("oemid", 0, pde, proc_oemid_show);
15511520
if (hubless)
1552-
proc_version_fops.open = proc_hubless_open;
1521+
proc_create_single("hubless", 0, pde, proc_hubless_show);
15531522
else
1554-
proc_version_fops.open = proc_hubbed_open;
1523+
proc_create_single("hubbed", 0, pde, proc_hubbed_show);
15551524
}
15561525

15571526
/* Initialize UV hubless systems */

0 commit comments

Comments
 (0)