From: Karel Zak Date: Thu, 8 Nov 2012 16:25:09 +0000 (+0100) Subject: lib/consoles: remove global variable initcp X-Git-Tag: v2.23-rc1~551 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53e0a68806bc4b1d605ca92edbdd1a234c0960a8;p=thirdparty%2Futil-linux.git lib/consoles: remove global variable initcp Signed-off-by: Karel Zak --- diff --git a/lib/consoles.c b/lib/consoles.c index 2e9793f0ed..bc7c039bdd 100644 --- a/lib/consoles.c +++ b/lib/consoles.c @@ -170,13 +170,6 @@ char* scandev(DIR *dir, dev_t comparedev) /* * Default control characters for an unknown terminal line. */ -static -struct chardata initcp = { - CERASE, - CKILL, - CTRL('r'), - 0 -}; /* * Allocate an aligned `struct console' memory area, @@ -192,8 +185,15 @@ __attribute__((__nonnull__,__hot__)) #endif void consalloc(char * name) { + static const struct chardata initcp = { + .erase = CERASE, + .kill = CKILL, + .eol = CTRL('r'), + .parity = 0 + }; struct console *restrict tail; + if (posix_memalign((void*)&tail, sizeof(void*), alignof(typeof(struct console))) != 0) perror("memory allocation");