mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[PATCH] uml: Add static initializations and declarations
Some structure fields were being dynamically initialized when they could be initialized at compile-time instead. This also makes some declarations static (in the C sense). Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
d571cd18f2
commit
9010772cdf
4 changed files with 9 additions and 10 deletions
|
@ -668,19 +668,18 @@ struct tty_driver *line_register_devfs(struct lines *set,
|
||||||
return driver;
|
return driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
static spinlock_t winch_handler_lock;
|
static DEFINE_SPINLOCK(winch_handler_lock);
|
||||||
LIST_HEAD(winch_handlers);
|
static LIST_HEAD(winch_handlers);
|
||||||
|
|
||||||
void lines_init(struct line *lines, int nlines)
|
void lines_init(struct line *lines, int nlines)
|
||||||
{
|
{
|
||||||
struct line *line;
|
struct line *line;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
spin_lock_init(&winch_handler_lock);
|
|
||||||
for(i = 0; i < nlines; i++){
|
for(i = 0; i < nlines; i++){
|
||||||
line = &lines[i];
|
line = &lines[i];
|
||||||
INIT_LIST_HEAD(&line->chan_list);
|
INIT_LIST_HEAD(&line->chan_list);
|
||||||
spin_lock_init(&line->lock);
|
|
||||||
if(line->init_str == NULL)
|
if(line->init_str == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ static struct notifier_block reboot_notifier = {
|
||||||
* itself and it can only happen on CPU 0.
|
* itself and it can only happen on CPU 0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LIST_HEAD(mc_requests);
|
static LIST_HEAD(mc_requests);
|
||||||
|
|
||||||
static void mc_work_proc(void *unused)
|
static void mc_work_proc(void *unused)
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ static void mc_work_proc(void *unused)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
|
static DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
|
||||||
|
|
||||||
static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
|
static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
|
||||||
struct pt_regs *regs)
|
struct pt_regs *regs)
|
||||||
|
@ -535,7 +535,7 @@ void mconsole_stack(struct mc_request *req)
|
||||||
*/
|
*/
|
||||||
static char *notify_socket = NULL;
|
static char *notify_socket = NULL;
|
||||||
|
|
||||||
int mconsole_init(void)
|
static int mconsole_init(void)
|
||||||
{
|
{
|
||||||
/* long to avoid size mismatch warnings from gcc */
|
/* long to avoid size mismatch warnings from gcc */
|
||||||
long sock;
|
long sock;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define DRIVER_NAME "uml-netdev"
|
#define DRIVER_NAME "uml-netdev"
|
||||||
|
|
||||||
static DEFINE_SPINLOCK(opened_lock);
|
static DEFINE_SPINLOCK(opened_lock);
|
||||||
LIST_HEAD(opened);
|
static LIST_HEAD(opened);
|
||||||
|
|
||||||
static int uml_net_rx(struct net_device *dev)
|
static int uml_net_rx(struct net_device *dev)
|
||||||
{
|
{
|
||||||
|
@ -266,7 +266,7 @@ void uml_net_user_timer_expire(unsigned long _conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEFINE_SPINLOCK(devices_lock);
|
static DEFINE_SPINLOCK(devices_lock);
|
||||||
static struct list_head devices = LIST_HEAD_INIT(devices);
|
static LIST_HEAD(devices);
|
||||||
|
|
||||||
static struct platform_driver uml_net_driver = {
|
static struct platform_driver uml_net_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
|
|
|
@ -58,8 +58,8 @@ struct line {
|
||||||
#define LINE_INIT(str, d) \
|
#define LINE_INIT(str, d) \
|
||||||
{ init_str : str, \
|
{ init_str : str, \
|
||||||
init_pri : INIT_STATIC, \
|
init_pri : INIT_STATIC, \
|
||||||
chan_list : { }, \
|
|
||||||
valid : 1, \
|
valid : 1, \
|
||||||
|
lock : SPIN_LOCK_UNLOCKED, \
|
||||||
buffer : NULL, \
|
buffer : NULL, \
|
||||||
head : NULL, \
|
head : NULL, \
|
||||||
tail : NULL, \
|
tail : NULL, \
|
||||||
|
|
Loading…
Add table
Reference in a new issue