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

hvc_console: use "*_console" nomenclature to avoid modpost warning.

The use of "hvc_con_driver" as the name for a file-static "struct
console" with a ".setup" field pointing to an __init function causes
a modpost warning, since a non-initdata structure points to init code.
Using "hvc_console" as the name triggers the hacky "*_console"
workaround in modpost to silence the warning, and is the same thing
that most of the other console drivers already do.

I made the same change in hvsi.c since I happened to notice it was
likely to suffer from the same problem.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Chris Metcalf and committed by
Benjamin Herrenschmidt
4455b119 32d8ad4e

+8 -8
+6 -6
drivers/char/hvc_console.c
··· 194 194 return 0; 195 195 } 196 196 197 - static struct console hvc_con_driver = { 197 + static struct console hvc_console = { 198 198 .name = "hvc", 199 199 .write = hvc_console_print, 200 200 .device = hvc_console_device, ··· 220 220 */ 221 221 static int __init hvc_console_init(void) 222 222 { 223 - register_console(&hvc_con_driver); 223 + register_console(&hvc_console); 224 224 return 0; 225 225 } 226 226 console_initcall(hvc_console_init); ··· 276 276 * now (setup won't fail at this point). It's ok to just 277 277 * call register again if previously .setup failed. 278 278 */ 279 - if (index == hvc_con_driver.index) 280 - register_console(&hvc_con_driver); 279 + if (index == hvc_console.index) 280 + register_console(&hvc_console); 281 281 282 282 return 0; 283 283 } ··· 641 641 } 642 642 for (i = 0; i < n; ++i) { 643 643 #ifdef CONFIG_MAGIC_SYSRQ 644 - if (hp->index == hvc_con_driver.index) { 644 + if (hp->index == hvc_console.index) { 645 645 /* Handle the SysRq Hack */ 646 646 /* XXX should support a sequence */ 647 647 if (buf[i] == '\x0f') { /* ^O */ ··· 909 909 tty_unregister_driver(hvc_driver); 910 910 /* return tty_struct instances allocated in hvc_init(). */ 911 911 put_tty_driver(hvc_driver); 912 - unregister_console(&hvc_con_driver); 912 + unregister_console(&hvc_console); 913 913 } 914 914 } 915 915 module_exit(hvc_exit);
+2 -2
drivers/char/hvsi.c
··· 1255 1255 return 0; 1256 1256 } 1257 1257 1258 - static struct console hvsi_con_driver = { 1258 + static struct console hvsi_console = { 1259 1259 .name = "hvsi", 1260 1260 .write = hvsi_console_print, 1261 1261 .device = hvsi_console_device, ··· 1308 1308 } 1309 1309 1310 1310 if (hvsi_count) 1311 - register_console(&hvsi_con_driver); 1311 + register_console(&hvsi_console); 1312 1312 return 0; 1313 1313 } 1314 1314 console_initcall(hvsi_console_init);