UserModeLinux: Message logging neatening
Subsystems (2)
cover UserModeLinux: Message logging neatening
Joe Perches (4):
UserModeLinux: Convert UM_KERN_<LEVEL> to KERN_<LEVEL>
UserModeLinux: Remove unused #defines of UM_KERN_<LEVEL>
UserModeLinux: Use a more current logging style
UserModeLinux: Convert printks to pr_<level>
arch/um/drivers/chan_kern.c | 27 +++---- arch/um/drivers/chan_user.c | 47 ++++++------ arch/um/drivers/daemon_kern.c | 8 +- arch/um/drivers/daemon_user.c | 28 +++---- arch/um/drivers/fd.c | 9 +-- arch/um/drivers/harddog_kern.c | 4 +- arch/um/drivers/harddog_user.c | 14 ++-- arch/um/drivers/hostaudio_kern.c | 13 ++-- arch/um/drivers/line.c | 24 +++--- arch/um/drivers/mconsole_kern.c | 29 +++---- arch/um/drivers/mconsole_user.c | 7 +- arch/um/drivers/mmapper_kern.c | 7 +- arch/um/drivers/net_kern.c | 53 +++++-------- arch/um/drivers/net_user.c | 20 ++--- arch/um/drivers/pcap_kern.c | 9 +-- arch/um/drivers/pcap_user.c | 19 +++-- arch/um/drivers/port_kern.c | 23 +++--- arch/um/drivers/port_user.c | 6 +- arch/um/drivers/pty.c | 4 +- arch/um/drivers/random.c | 3 +- arch/um/drivers/slip_kern.c | 2 +- arch/um/drivers/slip_user.c | 29 +++---- arch/um/drivers/slirp_kern.c | 9 +-- arch/um/drivers/slirp_user.c | 9 +-- arch/um/drivers/ssl.c | 10 +-- arch/um/drivers/stdio_console.c | 9 +-- arch/um/drivers/tty.c | 3 +- arch/um/drivers/ubd_kern.c | 117 +++++++++++++---------------- arch/um/drivers/ubd_user.c | 6 +- arch/um/drivers/umcast_kern.c | 38 +++++----- arch/um/drivers/umcast_user.c | 35 ++++----- arch/um/drivers/vde_kern.c | 23 +++--- arch/um/drivers/vde_user.c | 17 ++--- arch/um/drivers/xterm.c | 26 +++---- arch/um/drivers/xterm_kern.c | 6 +- arch/um/include/asm/pgtable-2level.h | 12 +-- arch/um/include/asm/pgtable-3level.h | 18 ++--- arch/um/include/shared/user.h | 12 +-- arch/um/kernel/exec.c | 4 +- arch/um/kernel/exitcode.c | 3 +- arch/um/kernel/initrd.c | 10 +-- arch/um/kernel/irq.c | 14 ++-- arch/um/kernel/physmem.c | 16 ++-- arch/um/kernel/process.c | 2 +- arch/um/kernel/sigio.c | 4 +- arch/um/kernel/skas/mmu.c | 9 +-- arch/um/kernel/smp.c | 18 ++--- arch/um/kernel/sysrq.c | 21 +++--- arch/um/kernel/time.c | 6 +- arch/um/kernel/tlb.c | 8 +- arch/um/kernel/trap.c | 9 +-- arch/um/os-Linux/aio.c | 45 +++++------ arch/um/os-Linux/drivers/ethertap_kern.c | 8 +- arch/um/os-Linux/drivers/ethertap_user.c | 32 ++++---- arch/um/os-Linux/drivers/tuntap_kern.c | 6 +- arch/um/os-Linux/drivers/tuntap_user.c | 24 +++--- arch/um/os-Linux/file.c | 37 ++++----- arch/um/os-Linux/helper.c | 33 ++++---- arch/um/os-Linux/irq.c | 8 +- arch/um/os-Linux/process.c | 31 ++++---- arch/um/os-Linux/sigio.c | 83 +++++++++----------- arch/um/os-Linux/skas/mem.c | 23 +++--- arch/um/os-Linux/skas/process.c | 125 ++++++++++++++----------------- arch/um/os-Linux/time.c | 3 +- arch/um/os-Linux/tty.c | 10 +-- arch/um/os-Linux/umid.c | 48 ++++++------ arch/x86/um/bugs_32.c | 14 ++-- arch/x86/um/os-Linux/registers.c | 2 +- 68 files changed, 605 insertions(+), 786 deletions(-)
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
PATCH 1/4 UserModeLinux: Convert UM_KERN_<LEVEL> to KERN_<LEVEL>
The defines are the same since commit 9429ec96c2718 ("um: Preinclude include/linux/kern_levels.h") so just convert them to the normal KERN_<LEVEL> uses.
--- arch/um/drivers/chan_user.c | 28 ++++++------- arch/um/drivers/daemon_user.c | 16 ++++---- arch/um/drivers/fd.c | 6 +-- arch/um/drivers/mconsole_user.c | 4 +- arch/um/drivers/net_user.c | 12 +++--- arch/um/drivers/pcap_user.c | 12 +++--- arch/um/drivers/port_user.c | 4 +- arch/um/drivers/pty.c | 4 +- arch/um/drivers/slip_user.c | 20 ++++----- arch/um/drivers/slirp_user.c | 6 +-- arch/um/drivers/tty.c | 2 +- arch/um/drivers/umcast_user.c | 20 ++++----- arch/um/drivers/vde_user.c | 12 +++--- arch/um/drivers/xterm.c | 16 ++++---- arch/um/os-Linux/aio.c | 26 ++++++------ arch/um/os-Linux/drivers/ethertap_user.c | 20 ++++----- arch/um/os-Linux/drivers/tuntap_user.c | 14 +++---- arch/um/os-Linux/file.c | 22 +++++----- arch/um/os-Linux/helper.c | 18 ++++---- arch/um/os-Linux/irq.c | 4 +- arch/um/os-Linux/process.c | 22 +++++----- arch/um/os-Linux/sigio.c | 52 ++++++++++++------------ arch/um/os-Linux/skas/mem.c | 14 +++---- arch/um/os-Linux/skas/process.c | 70 ++++++++++++++++---------------- arch/um/os-Linux/time.c | 2 +- arch/um/os-Linux/tty.c | 6 +-- arch/um/os-Linux/umid.c | 28 ++++++------- arch/x86/um/bugs_32.c | 14 +++---- arch/x86/um/os-Linux/registers.c | 2 +- 29 files changed, 238 insertions(+), 238 deletions(-)
arch/um/drivers/chan_user.c +14 -14
@@ -153,7 +153,7 @@ static int winch_thread(void *arg) pipe_fd = data->pipe_fd; count =write (pipe_fd, &c,sizeof (c));if (count !=sizeof (c)) -printk (UM_KERN_ERR "winch_thread : failed to write " +printk (KERN_ERR "winch_thread : failed to write " "synchronization byte, err = %d\n" , -count);/*
@@ -166,7 +166,7 @@ static int winch_thread(void *arg)sigfillset (&sigs);/* Block all signals possible. */ if (sigprocmask (SIG_SETMASK , &sigs,NULL ) <0 ) { -printk (UM_KERN_ERR "winch_thread : sigprocmask failed, " +printk (KERN_ERR "winch_thread : sigprocmask failed, " "errno = %d\n" , errno);exit (1 ); }
@@ -174,19 +174,19 @@ static int winch_thread(void *arg)sigdelset (&sigs,SIGWINCH );if (setsid () <0 ) { -printk (UM_KERN_ERR "winch_thread : setsid failed, errno = %d\n" , +printk (KERN_ERR "winch_thread : setsid failed, errno = %d\n" , errno);exit (1 ); }if (ioctl (pty_fd,TIOCSCTTY ,0 ) <0 ) { -printk (UM_KERN_ERR "winch_thread : TIOCSCTTY failed on " +printk (KERN_ERR "winch_thread : TIOCSCTTY failed on " "fd %d err = %d\n" , pty_fd, errno);exit (1 ); }if (tcsetpgrp (pty_fd,os_getpid ()) <0 ) { -printk (UM_KERN_ERR "winch_thread : tcsetpgrp failed on " +printk (KERN_ERR "winch_thread : tcsetpgrp failed on " "fd %d err = %d\n" , pty_fd, errno);exit (1 ); }
@@ -199,7 +199,7 @@ static int winch_thread(void *arg)*/ count =read (pipe_fd, &c,sizeof (c));if (count !=sizeof (c)) -printk (UM_KERN_ERR "winch_thread : failed to read " +printk (KERN_ERR "winch_thread : failed to read " "synchronization byte, err = %d\n" , errno);while (1 ) {
@@ -211,7 +211,7 @@ static int winch_thread(void *arg) count =write (pipe_fd, &c,sizeof (c));if (count !=sizeof (c)) -printk (UM_KERN_ERR "winch_thread : write failed, " +printk (KERN_ERR "winch_thread : write failed, " "err = %d\n" , errno); } }
@@ -225,7 +225,7 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out, err =os_pipe (fds,1 ,1 );if (err <0 ) { -printk (UM_KERN_ERR "winch_tramp : os_pipe failed, err = %d\n" , +printk (KERN_ERR "winch_tramp : os_pipe failed, err = %d\n" , -err); goto out; }
@@ -240,7 +240,7 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out,*/ err =run_helper_thread (winch_thread, &data,CLONE_FILES , stack_out);if (err <0 ) { -printk (UM_KERN_ERR "fork of winch_thread failed - errno = %d\n" , +printk (KERN_ERR "fork of winch_thread failed - errno = %d\n" , -err); goto out_close; }
@@ -248,16 +248,16 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out, *fd_out = fds[0 ]; n =read (fds[0 ], &c,sizeof (c));if (n !=sizeof (c)) { -printk (UM_KERN_ERR "winch_tramp : failed to read " +printk (KERN_ERR "winch_tramp : failed to read " "synchronization byte\n" ); -printk (UM_KERN_ERR "read failed, err = %d\n" , errno); -printk (UM_KERN_ERR "fd %d will not support SIGWINCH\n" , fd); +printk (KERN_ERR "read failed, err = %d\n" , errno); +printk (KERN_ERR "fd %d will not support SIGWINCH\n" , fd); err = -EINVAL ; goto out_close; }if (os_set_fd_block (*fd_out,0 )) { -printk (UM_KERN_ERR "winch_tramp: failed to set thread_fd " +printk (KERN_ERR "winch_tramp: failed to set thread_fd " "non-blocking.\n" ); goto out_close; }
@@ -295,7 +295,7 @@ void register_winch(int fd, struct tty_port *port) count =write (thread_fd, &c,sizeof (c));if (count !=sizeof (c)) -printk (UM_KERN_ERR "register_winch : failed to write " +printk (KERN_ERR "register_winch : failed to write " "synchronization byte, err = %d\n" , errno); } }
arch/um/drivers/daemon_user.c +8 -8
@@ -35,7 +35,7 @@ static struct sockaddr_un *new_addr(void *name, int len) sun =uml_kmalloc (sizeof (struct sockaddr_un ),UM_GFP_KERNEL );if (sun ==NULL ) { -printk (UM_KERN_ERR "new_addr: allocation of sockaddr_un " +printk (KERN_ERR "new_addr: allocation of sockaddr_un " "failed\n" );return NULL ; }
@@ -55,7 +55,7 @@ static int connect_to_switch(struct daemon_data *pri) pri->control =socket (AF_UNIX ,SOCK_STREAM ,0 );if (pri->control <0 ) { err = -errno; -printk (UM_KERN_ERR "daemon_open : control socket failed, " +printk (KERN_ERR "daemon_open : control socket failed, " "errno = %d\n" , -err);return err; }
@@ -63,7 +63,7 @@ static int connect_to_switch(struct daemon_data *pri)if (connect (pri->control, (struct sockaddr *) ctl_addr,sizeof (*ctl_addr)) <0 ) { err = -errno; -printk (UM_KERN_ERR "daemon_open : control connect failed, " +printk (KERN_ERR "daemon_open : control connect failed, " "errno = %d\n" , -err); goto out; }
@@ -71,20 +71,20 @@ static int connect_to_switch(struct daemon_data *pri) fd =socket (AF_UNIX ,SOCK_DGRAM ,0 );if (fd <0 ) { err = -errno; -printk (UM_KERN_ERR "daemon_open : data socket failed, " +printk (KERN_ERR "daemon_open : data socket failed, " "errno = %d\n" , -err); goto out; }if (bind (fd, (struct sockaddr *) local_addr,sizeof (*local_addr)) <0 ) { err = -errno; -printk (UM_KERN_ERR "daemon_open : data bind failed, " +printk (KERN_ERR "daemon_open : data bind failed, " "errno = %d\n" , -err); goto out_close; } sun =uml_kmalloc (sizeof (struct sockaddr_un ),UM_GFP_KERNEL );if (sun ==NULL ) { -printk (UM_KERN_ERR "new_addr: allocation of sockaddr_un " +printk (KERN_ERR "new_addr: allocation of sockaddr_un " "failed\n" ); err = -ENOMEM ; goto out_close;
@@ -96,7 +96,7 @@ static int connect_to_switch(struct daemon_data *pri) req.sock = *local_addr; n =write (pri->control, &req,sizeof (req));if (n !=sizeof (req)) { -printk (UM_KERN_ERR "daemon_open : control setup request " +printk (KERN_ERR "daemon_open : control setup request " "failed, err = %d\n" , -errno); err = -ENOTCONN ; goto out_free;
@@ -104,7 +104,7 @@ static int connect_to_switch(struct daemon_data *pri) n =read (pri->control, sun,sizeof (*sun));if (n !=sizeof (*sun)) { -printk (UM_KERN_ERR "daemon_open : read of data socket failed, " +printk (KERN_ERR "daemon_open : read of data socket failed, " "err = %d\n" , -errno); err = -ENOTCONN ; goto out_free;
arch/um/drivers/fd.c +3 -3
@@ -26,14 +26,14 @@ static void *fd_init(char *str, int device, const struct chan_opts *opts)int n;if (*str !=':' ) { -printk (UM_KERN_ERR "fd_init : channel type 'fd' must specify a " +printk (KERN_ERR "fd_init : channel type 'fd' must specify a " "file descriptor\n" );return NULL ; } str++; n =strtoul (str, &end,0 );if ((*end !='\0' ) || (end == str)) { -printk (UM_KERN_ERR "fd_init : couldn't parse file descriptor " +printk (KERN_ERR "fd_init : couldn't parse file descriptor " "'%s'\n" , str);return NULL ; }
@@ -76,7 +76,7 @@ static void fd_close(int fd, void *d)CATCH_EINTR (err =tcsetattr (fd,TCSAFLUSH , &data->tt));if (err) -printk (UM_KERN_ERR "Failed to restore terminal state - " +printk (KERN_ERR "Failed to restore terminal state - " "errno = %d\n" , -err); data->raw =0 ; }
arch/um/drivers/mconsole_user.c +2 -2
@@ -187,7 +187,7 @@ int mconsole_notify(char *sock_name, int type, const void *data, int len) notify_sock =socket (PF_UNIX ,SOCK_DGRAM ,0 );if (notify_sock <0 ) { err = -errno; -printk (UM_KERN_ERR "mconsole_notify - socket failed, " +printk (KERN_ERR "mconsole_notify - socket failed, " "errno = %d\n" , errno); } }
@@ -212,7 +212,7 @@ int mconsole_notify(char *sock_name, int type, const void *data, int len) sizeof(target));if (n <0 ) { err = -errno; -printk (UM_KERN_ERR "mconsole_notify - sendto failed, " +printk (KERN_ERR "mconsole_notify - sendto failed, " "errno = %d\n" , errno); }return err;
arch/um/drivers/net_user.c +6 -6
@@ -23,7 +23,7 @@ int tap_open_common(void *dev, char *gate_addr)return 0 ;if (sscanf (gate_addr,"%d.%d.%d.%d" , &tap_addr[0 ], &tap_addr[1 ], &tap_addr[2 ], &tap_addr[3 ]) !=4 ) { -printk (UM_KERN_ERR "Invalid tap IP address - '%s'\n" , +printk (KERN_ERR "Invalid tap IP address - '%s'\n" , gate_addr);return -EINVAL ; }
@@ -41,7 +41,7 @@ void tap_check_ips(char *gate_addr, unsigned char *eth_addr) (eth_addr[1] == tap_addr[1]) && (eth_addr[2] == tap_addr[2]) && (eth_addr[3] == tap_addr[3])) { -printk (UM_KERN_ERR "The tap IP address and the UML eth IP " +printk (KERN_ERR "The tap IP address and the UML eth IP " "address must be different\n" ); } }
@@ -85,10 +85,10 @@ void read_output(int fd, char *output, int len) err:if (ret <0 ) -printk (UM_KERN_ERR "read_output - read of %s failed, " +printk (KERN_ERR "read_output - read of %s failed, " "errno = %d\n" , str, -ret);else -printk (UM_KERN_ERR "read_output - read of %s failed, read only " +printk (KERN_ERR "read_output - read of %s failed, read only " "%d of %d bytes\n" , str, ret, expected); }
@@ -184,7 +184,7 @@ static int change_tramp(char **argv, char *output, int output_len) err =os_pipe (fds,1 ,0 );if (err <0 ) { -printk (UM_KERN_ERR "change_tramp - pipe failed, err = %d\n" , +printk (KERN_ERR "change_tramp - pipe failed, err = %d\n" , -err);return err; }
@@ -222,7 +222,7 @@ static void change(char *dev, char *what, unsigned char *addr, output_len =UM_KERN_PAGE_SIZE ; output =uml_kmalloc (output_len,UM_GFP_KERNEL );if (output ==NULL ) -printk (UM_KERN_ERR "change : failed to allocate output " +printk (KERN_ERR "change : failed to allocate output " "buffer\n" ); pid =change_tramp (argv, output, output_len);
arch/um/drivers/pcap_user.c +6 -6
@@ -22,7 +22,7 @@ static int pcap_user_init(void *data, void *dev) p =pcap_open_live (pri->host_if,ETH_MAX_PACKET +ETH_HEADER_OTHER , pri->promisc,0 , errors);if (p ==NULL ) { -printk (UM_KERN_ERR "pcap_user_init : pcap_open_live failed - " +printk (KERN_ERR "pcap_user_init : pcap_open_live failed - " "'%s'\n" , errors);return -EINVAL ; }
@@ -44,14 +44,14 @@ static int pcap_open(void *data)if (pri->filter !=NULL ) { err =dev_netmask (pri->dev, &netmask);if (err <0 ) { -printk (UM_KERN_ERR "pcap_open : dev_netmask failed\n" ); +printk (KERN_ERR "pcap_open : dev_netmask failed\n" );return -EIO ; } pri->compiled =uml_kmalloc (sizeof (struct bpf_program ),UM_GFP_KERNEL );if (pri->compiled ==NULL ) { -printk (UM_KERN_ERR "pcap_open : kmalloc failed\n" ); +printk (KERN_ERR "pcap_open : kmalloc failed\n" );return -ENOMEM ; }
@@ -59,14 +59,14 @@ static int pcap_open(void *data) (struct bpf_program *) pri->compiled, pri->filter, pri->optimize, netmask);if (err <0 ) { -printk (UM_KERN_ERR "pcap_open : pcap_compile failed - " +printk (KERN_ERR "pcap_open : pcap_compile failed - " "'%s'\n" ,pcap_geterr (pri->pcap)); goto out; } err =pcap_setfilter (pri->pcap, pri->compiled);if (err <0 ) { -printk (UM_KERN_ERR "pcap_open : pcap_setfilter " +printk (KERN_ERR "pcap_open : pcap_setfilter " "failed - '%s'\n" ,pcap_geterr (pri->pcap)); goto out; }
@@ -116,7 +116,7 @@ int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri) n =pcap_dispatch (pri->pcap,1 , handler, (u_char *) &hdata);if (n <0 ) { -printk (UM_KERN_ERR "pcap_dispatch failed - %s\n" , +printk (KERN_ERR "pcap_dispatch failed - %s\n" ,pcap_geterr (pri->pcap));return -EIO ; }
arch/um/drivers/port_user.c +2 -2
@@ -29,14 +29,14 @@ static void *port_init(char *str, int device, const struct chan_opts *opts)int port;if (*str !=':' ) { -printk (UM_KERN_ERR "port_init : channel type 'port' must " +printk (KERN_ERR "port_init : channel type 'port' must " "specify a port number\n" );return NULL ; } str++; port =strtoul (str, &end,0 );if ((*end !='\0' ) || (end == str)) { -printk (UM_KERN_ERR "port_init : couldn't parse port '%s'\n" , +printk (KERN_ERR "port_init : couldn't parse port '%s'\n" , str);return NULL ; }
arch/um/drivers/pty.c +2 -2
@@ -47,7 +47,7 @@ static int pts_open(int input, int output, int primary, void *d, fd =get_pty ();if (fd <0 ) { err = -errno; -printk (UM_KERN_ERR "open_pts : Failed to open pts\n" ); +printk (KERN_ERR "open_pts : Failed to open pts\n" );return err; }
@@ -106,7 +106,7 @@ static int getmaster(char *line) } } -printk (UM_KERN_ERR "getmaster - no usable host pty devices\n" ); +printk (KERN_ERR "getmaster - no usable host pty devices\n" );return -ENOENT ; }
arch/um/drivers/slip_user.c +10 -10
@@ -30,7 +30,7 @@ static int set_up_tty(int fd)struct termios tios;if (tcgetattr (fd, &tios) <0 ) { -printk (UM_KERN_ERR "could not get initial terminal " +printk (KERN_ERR "could not get initial terminal " "attributes\n" );return -1 ; }
@@ -48,7 +48,7 @@ static int set_up_tty(int fd)cfsetispeed (&tios,B38400 );if (tcsetattr (fd,TCSAFLUSH , &tios) <0 ) { -printk (UM_KERN_ERR "failed to set terminal attributes\n" ); +printk (KERN_ERR "failed to set terminal attributes\n" );return -1 ; }return 0 ;
@@ -79,7 +79,7 @@ static int slip_tramp(char **argv, int fd) err =os_pipe (fds,1 ,0 );if (err <0 ) { -printk (UM_KERN_ERR "slip_tramp : pipe failed, err = %d\n" , +printk (KERN_ERR "slip_tramp : pipe failed, err = %d\n" , -err); goto out; }
@@ -96,7 +96,7 @@ static int slip_tramp(char **argv, int fd) output_len =UM_KERN_PAGE_SIZE ; output =uml_kmalloc (output_len,UM_GFP_KERNEL );if (output ==NULL ) { -printk (UM_KERN_ERR "slip_tramp : failed to allocate output " +printk (KERN_ERR "slip_tramp : failed to allocate output " "buffer\n" );os_kill_process (pid,1 ); err = -ENOMEM ;
@@ -131,7 +131,7 @@ static int slip_open(void *data) err =get_pty ();if (err <0 ) { -printk (UM_KERN_ERR "slip-open : Failed to open pty, err = %d\n" , +printk (KERN_ERR "slip-open : Failed to open pty, err = %d\n" , -err); goto out; }
@@ -139,7 +139,7 @@ static int slip_open(void *data) err =open (ptsname (mfd),O_RDWR ,0 );if (err <0 ) { -printk (UM_KERN_ERR "Couldn't open tty for slip line, " +printk (KERN_ERR "Couldn't open tty for slip line, " "err = %d\n" , -err); goto out_close; }
@@ -158,13 +158,13 @@ static int slip_open(void *data) err =slip_tramp (argv, sfd);if (err <0 ) { -printk (UM_KERN_ERR "slip_tramp failed - err = %d\n" , +printk (KERN_ERR "slip_tramp failed - err = %d\n" , -err); goto out_close2; } err =os_get_ifname (pri->slave, pri->name);if (err <0 ) { -printk (UM_KERN_ERR "get_ifname failed, err = %d\n" , +printk (KERN_ERR "get_ifname failed, err = %d\n" , -err); goto out_close2; }
@@ -173,7 +173,7 @@ static int slip_open(void *data)else { err =os_set_slip (sfd);if (err <0 ) { -printk (UM_KERN_ERR "Failed to set slip discipline " +printk (KERN_ERR "Failed to set slip discipline " "encapsulation - err = %d\n" , -err); goto out_close2; }
@@ -203,7 +203,7 @@ static void slip_close(int fd, void *data) err =slip_tramp (argv, pri->slave);if (err !=0 ) -printk (UM_KERN_ERR "slip_tramp failed - errno = %d\n" , -err); +printk (KERN_ERR "slip_tramp failed - errno = %d\n" , -err);close (fd);close (pri->slave); pri->slave =-1 ;
arch/um/drivers/slirp_user.c +3 -3
@@ -57,7 +57,7 @@ static int slirp_open(void *data) err =slirp_tramp (pri->argw.argv, fds[1 ]);if (err <0 ) { -printk (UM_KERN_ERR "slirp_tramp failed - errno = %d\n" , -err); +printk (KERN_ERR "slirp_tramp failed - errno = %d\n" , -err); goto out; } pid = err;
@@ -85,14 +85,14 @@ static void slirp_close(int fd, void *data) pri->slave =-1 ;if (pri->pid<1 ) { -printk (UM_KERN_ERR "slirp_close: no child process to shut " +printk (KERN_ERR "slirp_close: no child process to shut " "down\n" );return ; }#if 0 if (kill (pri->pid,SIGHUP )<0 ) { -printk (UM_KERN_ERR "slirp_close: sending hangup to %d failed " +printk (KERN_ERR "slirp_close: sending hangup to %d failed " "(%d)\n" , pri->pid, errno); }#endif
arch/um/drivers/tty.c +1 -1
@@ -21,7 +21,7 @@ static void *tty_chan_init(char *str, int device, const struct chan_opts *opts)struct tty_chan *data;if (*str !=':' ) { -printk (UM_KERN_ERR "tty_init : channel type 'tty' must specify " +printk (KERN_ERR "tty_init : channel type 'tty' must specify " "a device\n" );return NULL ; }
arch/um/drivers/umcast_user.c +10 -10
@@ -25,7 +25,7 @@ static struct sockaddr_in *new_addr(char *addr, unsigned short port) sin =uml_kmalloc (sizeof (struct sockaddr_in ),UM_GFP_KERNEL );if (sin ==NULL ) { -printk (UM_KERN_ERR "new_addr: allocation of sockaddr_in " +printk (KERN_ERR "new_addr: allocation of sockaddr_in " "failed\n" );return NULL ; }
@@ -79,14 +79,14 @@ static int umcast_open(void *data)if (fd <0 ) { err = -errno; -printk (UM_KERN_ERR "umcast_open : data socket failed, " +printk (KERN_ERR "umcast_open : data socket failed, " "errno = %d\n" , errno); goto out; }if (setsockopt (fd,SOL_SOCKET ,SO_REUSEADDR , &yes,sizeof (yes)) <0 ) { err = -errno; -printk (UM_KERN_ERR "umcast_open: SO_REUSEADDR failed, " +printk (KERN_ERR "umcast_open: SO_REUSEADDR failed, " "errno = %d\n" , errno); goto out_close; }
@@ -96,7 +96,7 @@ static int umcast_open(void *data)if (setsockopt (fd,SOL_IP ,IP_MULTICAST_TTL , &pri->ttl,sizeof (pri->ttl)) <0 ) { err = -errno; -printk (UM_KERN_ERR "umcast_open: IP_MULTICAST_TTL " +printk (KERN_ERR "umcast_open: IP_MULTICAST_TTL " "failed, error = %d\n" , errno); goto out_close; }
@@ -105,7 +105,7 @@ static int umcast_open(void *data)if (setsockopt (fd,SOL_IP ,IP_MULTICAST_LOOP , &yes,sizeof (yes)) <0 ) { err = -errno; -printk (UM_KERN_ERR "umcast_open: IP_MULTICAST_LOOP " +printk (KERN_ERR "umcast_open: IP_MULTICAST_LOOP " "failed, error = %d\n" , errno); goto out_close; }
@@ -114,7 +114,7 @@ static int umcast_open(void *data)/* bind socket to the address */ if (bind (fd, (struct sockaddr *) lsin,sizeof (*lsin)) <0 ) { err = -errno; -printk (UM_KERN_ERR "umcast_open : data bind failed, " +printk (KERN_ERR "umcast_open : data bind failed, " "errno = %d\n" , errno); goto out_close; }
@@ -126,12 +126,12 @@ static int umcast_open(void *data)if (setsockopt (fd,SOL_IP ,IP_ADD_MEMBERSHIP , &mreq,sizeof (mreq)) <0 ) { err = -errno; -printk (UM_KERN_ERR "umcast_open: IP_ADD_MEMBERSHIP " +printk (KERN_ERR "umcast_open: IP_ADD_MEMBERSHIP " "failed, error = %d\n" , errno); -printk (UM_KERN_ERR "There appears not to be a " +printk (KERN_ERR "There appears not to be a " "multicast-capable network interface on the " "host.\n" ); -printk (UM_KERN_ERR "eth0 should be configured in order " +printk (KERN_ERR "eth0 should be configured in order " "to use the multicast transport.\n" ); goto out_close; }
@@ -157,7 +157,7 @@ static void umcast_close(int fd, void *data) mreq.imr_interface.s_addr =0 ;if (setsockopt (fd,SOL_IP ,IP_DROP_MEMBERSHIP , &mreq,sizeof (mreq)) <0 ) { -printk (UM_KERN_ERR "umcast_close: IP_DROP_MEMBERSHIP " +printk (KERN_ERR "umcast_close: IP_DROP_MEMBERSHIP " "failed, error = %d\n" , errno); } }
arch/um/drivers/vde_user.c +6 -6
@@ -22,12 +22,12 @@ static int vde_user_init(void *data, void *dev)if (conn ==NULL ) { err = -errno; -printk (UM_KERN_ERR "vde_user_init: vde_open failed, " +printk (KERN_ERR "vde_user_init: vde_open failed, " "errno = %d\n" , errno);return err; } -printk (UM_KERN_INFO "vde backend - connection opened\n" ); +printk (KERN_INFO "vde backend - connection opened\n" ); pri->conn = conn;
@@ -41,7 +41,7 @@ static int vde_user_open(void *data)if (pri->conn !=NULL )return vde_datafd (pri->conn); -printk (UM_KERN_WARNING "vde_open - we have no VDECONN to open" ); +printk (KERN_WARNING "vde_open - we have no VDECONN to open" );return -EINVAL ; }
@@ -50,7 +50,7 @@ static void vde_remove(void *data)struct vde_data *pri = data;if (pri->conn !=NULL ) { -printk (UM_KERN_INFO "vde backend - closing connection\n" ); +printk (KERN_INFO "vde backend - closing connection\n" );vde_close (pri->conn); pri->conn =NULL ;kfree (pri->args);
@@ -58,7 +58,7 @@ static void vde_remove(void *data)return ; } -printk (UM_KERN_WARNING "vde_remove - we have no VDECONN to remove" ); +printk (KERN_WARNING "vde_remove - we have no VDECONN to remove" ); }const struct net_user_info vde_user_info = {
@@ -78,7 +78,7 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) vpri->args =uml_kmalloc (sizeof (struct vde_open_args ),UM_GFP_KERNEL );if (vpri->args ==NULL ) { -printk (UM_KERN_ERR "vde_init_libstuff - vde_open_args " +printk (KERN_ERR "vde_init_libstuff - vde_open_args " "allocation failed" );return ; }
arch/um/drivers/xterm.c +8 -8
@@ -99,7 +99,7 @@ static int xterm_open(int input, int output, int primary, void *d,* will work but w/o it we can be pretty sure it won't. */ if (getenv ("DISPLAY" ) ==NULL ) { -printk (UM_KERN_ERR "xterm_open: $DISPLAY not set.\n" ); +printk (KERN_ERR "xterm_open: $DISPLAY not set.\n" );return -ENODEV ; }
@@ -112,14 +112,14 @@ static int xterm_open(int input, int output, int primary, void *d, fd =mkstemp (file);if (fd <0 ) { err = -errno; -printk (UM_KERN_ERR "xterm_open : mkstemp failed, errno = %d\n" , +printk (KERN_ERR "xterm_open : mkstemp failed, errno = %d\n" , errno);return err; }if (unlink (file)) { err = -errno; -printk (UM_KERN_ERR "xterm_open : unlink failed, errno = %d\n" , +printk (KERN_ERR "xterm_open : unlink failed, errno = %d\n" , errno);close (fd);return err;
@@ -128,7 +128,7 @@ static int xterm_open(int input, int output, int primary, void *d, fd =os_create_unix_socket (file,sizeof (file),1 );if (fd <0 ) { -printk (UM_KERN_ERR "xterm_open : create_unix_socket failed, " +printk (KERN_ERR "xterm_open : create_unix_socket failed, " "errno = %d\n" , -fd);return fd; }
@@ -137,14 +137,14 @@ static int xterm_open(int input, int output, int primary, void *d, pid =run_helper (NULL ,NULL , argv);if (pid <0 ) { err = pid; -printk (UM_KERN_ERR "xterm_open : run_helper failed, " +printk (KERN_ERR "xterm_open : run_helper failed, " "errno = %d\n" , -err); goto out_close1; } err =os_set_fd_block (fd,0 );if (err <0 ) { -printk (UM_KERN_ERR "xterm_open : failed to set descriptor " +printk (KERN_ERR "xterm_open : failed to set descriptor " "non-blocking, err = %d\n" , -err); goto out_kill; }
@@ -152,14 +152,14 @@ static int xterm_open(int input, int output, int primary, void *d, new =xterm_fd (fd, &data->helper_pid);if (new <0 ) { err = new; -printk (UM_KERN_ERR "xterm_open : os_rcv_fd failed, err = %d\n" , +printk (KERN_ERR "xterm_open : os_rcv_fd failed, err = %d\n" , -err); goto out_kill; } err =os_set_fd_block (new,0 );if (err) { -printk (UM_KERN_ERR "xterm_open : failed to set xterm " +printk (KERN_ERR "xterm_open : failed to set xterm " "descriptor non-blocking, err = %d\n" , -err); goto out_close2; }
arch/um/os-Linux/aio.c +13 -13
@@ -88,7 +88,7 @@ static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf, iocbp->aio_nbytes =sizeof (c);break ;default : -printk (UM_KERN_ERR "Bogus op in do_aio - %d\n" , type); +printk (KERN_ERR "Bogus op in do_aio - %d\n" , type);return -EINVAL ; }
@@ -110,7 +110,7 @@ static int aio_thread(void *arg)if (n <0 ) {if (errno ==EINTR )continue ; -printk (UM_KERN_ERR "aio_thread - io_getevents failed, " +printk (KERN_ERR "aio_thread - io_getevents failed, " "errno = %d\n" , errno); }else {
@@ -120,7 +120,7 @@ static int aio_thread(void *arg) reply_fd = ((struct aio_context *) reply.data)->reply_fd; err =write (reply_fd, &reply,sizeof (reply));if (err !=sizeof (reply)) -printk (UM_KERN_ERR "aio_thread - write failed, " +printk (KERN_ERR "aio_thread - write failed, " "fd = %d, err = %d\n" , reply_fd, errno); } }
@@ -150,7 +150,7 @@ static int do_not_aio(struct aio_thread_req *req) n =read (req->io_fd, &c,sizeof (c));break ;default : -printk (UM_KERN_ERR "do_not_aio - bad request type : %d\n" , +printk (KERN_ERR "do_not_aio - bad request type : %d\n" , req->type);return -EINVAL ; }
@@ -177,12 +177,12 @@ static int not_aio_thread(void *arg) err =read (aio_req_fd_r, &req,sizeof (req));if (err !=sizeof (req)) {if (err <0 ) -printk (UM_KERN_ERR "not_aio_thread - " +printk (KERN_ERR "not_aio_thread - " "read failed, fd = %d, err = %d\n" , aio_req_fd_r, errno);else { -printk (UM_KERN_ERR "not_aio_thread - short " +printk (KERN_ERR "not_aio_thread - short " "read, fd = %d, length = %d\n" , aio_req_fd_r, err); }
@@ -193,7 +193,7 @@ static int not_aio_thread(void *arg) .err = err }); err =write (req.aio->reply_fd, &reply,sizeof (reply));if (err !=sizeof (reply)) -printk (UM_KERN_ERR "not_aio_thread - write failed, " +printk (KERN_ERR "not_aio_thread - write failed, " "fd = %d, err = %d\n" , req.aio->reply_fd, errno); }
@@ -230,10 +230,10 @@ out_close_pipe: aio_req_fd_r =-1 ; out:#ifndef HAVE_AIO_ABI -printk (UM_KERN_INFO "/usr/include/linux/aio_abi.h not present during " +printk (KERN_INFO "/usr/include/linux/aio_abi.h not present during " "build\n" );#endif -printk (UM_KERN_INFO "2.6 host AIO support not used - falling back to " +printk (KERN_INFO "2.6 host AIO support not used - falling back to " "I/O thread\n" );return 0 ; }
@@ -246,7 +246,7 @@ static int init_aio_26(void)if (io_setup (256 , &ctx)) { err = -errno; -printk (UM_KERN_ERR "aio_thread failed to initialize context, " +printk (KERN_ERR "aio_thread failed to initialize context, " "err = %d\n" , errno);return err; }
@@ -258,7 +258,7 @@ static int init_aio_26(void) aio_pid = err; -printk (UM_KERN_INFO "Using 2.6 host AIO\n" ); +printk (KERN_INFO "Using 2.6 host AIO\n" );return 0 ; }
@@ -275,7 +275,7 @@ static int submit_aio_26(enum aio_type type, int io_fd, char *buf, int len, err =write (aio->reply_fd, &reply,sizeof (reply));if (err !=sizeof (reply)) { err = -errno; -printk (UM_KERN_ERR "submit_aio_26 - write failed, " +printk (KERN_ERR "submit_aio_26 - write failed, " "fd = %d, err = %d\n" , aio->reply_fd, -err); }else err =0 ;
@@ -326,7 +326,7 @@ static int init_aio(void)if (!aio_24) { err =init_aio_26 ();if (err && (errno ==ENOSYS )) { -printk (UM_KERN_INFO "2.6 AIO not supported on the " +printk (KERN_INFO "2.6 AIO not supported on the " "host - reverting to 2.4 AIO\n" ); aio_24 =1 ; }
arch/um/os-Linux/drivers/ethertap_user.c +10 -10
@@ -45,14 +45,14 @@ static void etap_change(int op, unsigned char *addr, unsigned char *netmask,memcpy (change.netmask, netmask,sizeof (change.netmask));CATCH_EINTR (n =write (fd, &change,sizeof (change)));if (n !=sizeof (change)) { -printk (UM_KERN_ERR "etap_change - request failed, err = %d\n" , +printk (KERN_ERR "etap_change - request failed, err = %d\n" , errno);return ; } output =uml_kmalloc (UM_KERN_PAGE_SIZE ,UM_GFP_KERNEL );if (output ==NULL ) -printk (UM_KERN_ERR "etap_change : Failed to allocate output " +printk (KERN_ERR "etap_change : Failed to allocate output " "buffer\n" );read_output (fd, output,UM_KERN_PAGE_SIZE );if (output !=NULL ) {
@@ -123,12 +123,12 @@ static int etap_tramp(char *dev, char *gate, int control_me,CATCH_EINTR (n =read (control_me, &c,sizeof (c)));if (n !=sizeof (c)) { err = -errno; -printk (UM_KERN_ERR "etap_tramp : read of status failed, " +printk (KERN_ERR "etap_tramp : read of status failed, " "err = %d\n" , -err);return err; }if (c !=1 ) { -printk (UM_KERN_ERR "etap_tramp : uml_net failed\n" ); +printk (KERN_ERR "etap_tramp : uml_net failed\n" ); err =helper_wait (pid); }return err;
@@ -147,7 +147,7 @@ static int etap_open(void *data) err =socketpair (AF_UNIX ,SOCK_DGRAM ,0 , data_fds);if (err) { err = -errno; -printk (UM_KERN_ERR "etap_open - data socketpair failed - " +printk (KERN_ERR "etap_open - data socketpair failed - " "err = %d\n" , errno);return err; }
@@ -155,7 +155,7 @@ static int etap_open(void *data) err =socketpair (AF_UNIX ,SOCK_STREAM ,0 , control_fds);if (err) { err = -errno; -printk (UM_KERN_ERR "etap_open - control socketpair failed - " +printk (KERN_ERR "etap_open - control socketpair failed - " "err = %d\n" , errno); goto out_close_data; }
@@ -167,7 +167,7 @@ static int etap_open(void *data)read_output (control_fds[0 ], output, output_len);if (output ==NULL ) -printk (UM_KERN_ERR "etap_open : failed to allocate output " +printk (KERN_ERR "etap_open : failed to allocate output " "buffer\n" );else {printk ("%s" , output);
@@ -175,7 +175,7 @@ static int etap_open(void *data) }if (err <0 ) { -printk (UM_KERN_ERR "etap_tramp failed - err = %d\n" , -err); +printk (KERN_ERR "etap_tramp failed - err = %d\n" , -err); goto out_close_control; }
@@ -201,11 +201,11 @@ static void etap_close(int fd, void *data)close (fd);if (shutdown (pri->data_fd,SHUT_RDWR ) <0 ) -printk (UM_KERN_ERR "etap_close - shutdown data socket failed, " +printk (KERN_ERR "etap_close - shutdown data socket failed, " "errno = %d\n" , errno);if (shutdown (pri->control_fd,SHUT_RDWR ) <0 ) -printk (UM_KERN_ERR "etap_close - shutdown control socket " +printk (KERN_ERR "etap_close - shutdown control socket " "failed, errno = %d\n" , errno);close (pri->data_fd);
arch/um/os-Linux/drivers/tuntap_user.c +7 -7
@@ -102,7 +102,7 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote, *used_out = n;if (n <0 ) { err = -errno; -printk (UM_KERN_ERR "tuntap_open_tramp : recvmsg failed - " +printk (KERN_ERR "tuntap_open_tramp : recvmsg failed - " "errno = %d\n" , errno);return err; }
@@ -110,13 +110,13 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote, cmsg =CMSG_FIRSTHDR (&msg);if (cmsg ==NULL ) { -printk (UM_KERN_ERR "tuntap_open_tramp : didn't receive a " +printk (KERN_ERR "tuntap_open_tramp : didn't receive a " "message\n" );return -EINVAL ; }if ((cmsg->cmsg_level !=SOL_SOCKET ) || (cmsg->cmsg_type !=SCM_RIGHTS )) { -printk (UM_KERN_ERR "tuntap_open_tramp : didn't receive a " +printk (KERN_ERR "tuntap_open_tramp : didn't receive a " "descriptor\n" );return -EINVAL ; }
@@ -140,7 +140,7 @@ static int tuntap_open(void *data) pri->fd =os_open_file ("/dev/net/tun" ,of_cloexec (of_rdwr (OPENFLAGS ())),0 );if (pri->fd <0 ) { -printk (UM_KERN_ERR "Failed to open /dev/net/tun, " +printk (KERN_ERR "Failed to open /dev/net/tun, " "err = %d\n" , -pri->fd);return pri->fd; }
@@ -149,7 +149,7 @@ static int tuntap_open(void *data)strlcpy (ifr.ifr_name, pri->dev_name,sizeof (ifr.ifr_name));if (ioctl (pri->fd,TUNSETIFF , &ifr) <0 ) { err = -errno; -printk (UM_KERN_ERR "TUNSETIFF failed, errno = %d\n" , +printk (KERN_ERR "TUNSETIFF failed, errno = %d\n" , errno);close (pri->fd);return err;
@@ -159,7 +159,7 @@ static int tuntap_open(void *data) err =socketpair (AF_UNIX ,SOCK_DGRAM ,0 , fds);if (err) { err = -errno; -printk (UM_KERN_ERR "tuntap_open : socketpair failed - " +printk (KERN_ERR "tuntap_open : socketpair failed - " "errno = %d\n" , errno);return err; }
@@ -176,7 +176,7 @@ static int tuntap_open(void *data)if (err <0 ) {printk ("%s" , output);free_output_buffer (buffer); -printk (UM_KERN_ERR "tuntap_open_tramp failed - " +printk (KERN_ERR "tuntap_open_tramp failed - " "err = %d\n" , -err);return err; }
arch/um/os-Linux/file.c +11 -11
@@ -288,7 +288,7 @@ int os_file_size(const char *file, unsigned long long *size_out) err =os_stat_file (file, &buf);if (err <0 ) { -printk (UM_KERN_ERR "Couldn't stat \"%s\" : err = %d\n" , file, +printk (KERN_ERR "Couldn't stat \"%s\" : err = %d\n" , file, -err);return err; }
@@ -300,13 +300,13 @@ int os_file_size(const char *file, unsigned long long *size_out) fd =open (file,O_RDONLY ,0 );if (fd <0 ) { err = -errno; -printk (UM_KERN_ERR "Couldn't open \"%s\", " +printk (KERN_ERR "Couldn't open \"%s\", " "errno = %d\n" , file, errno);return err; }if (ioctl (fd,BLKGETSIZE , &blocks) <0 ) { err = -errno; -printk (UM_KERN_ERR "Couldn't get the block size of " +printk (KERN_ERR "Couldn't get the block size of " "\"%s\", errno = %d\n" , file, errno);close (fd);return err;
@@ -326,7 +326,7 @@ int os_file_modtime(const char *file, unsigned long *modtime) err =os_stat_file (file, &buf);if (err <0 ) { -printk (UM_KERN_ERR "Couldn't stat \"%s\" : err = %d\n" , file, +printk (KERN_ERR "Couldn't stat \"%s\" : err = %d\n" , file, -err);return err; }
@@ -368,7 +368,7 @@ int os_pipe(int *fds, int stream, int close_on_exec)return 0 ; error: -printk (UM_KERN_ERR "os_pipe : Setting FD_CLOEXEC failed, err = %d\n" , +printk (KERN_ERR "os_pipe : Setting FD_CLOEXEC failed, err = %d\n" , -err);close (fds[1 ]);close (fds[0 ]);
@@ -386,7 +386,7 @@ int os_set_fd_async(int fd) flags |=O_ASYNC |O_NONBLOCK ;if (fcntl (fd,F_SETFL , flags) <0 ) { err = -errno; -printk (UM_KERN_ERR "os_set_fd_async : failed to set O_ASYNC " +printk (KERN_ERR "os_set_fd_async : failed to set O_ASYNC " "and O_NONBLOCK on fd # %d, errno = %d\n" , fd, errno);return err; }
@@ -394,7 +394,7 @@ int os_set_fd_async(int fd)if ((fcntl (fd,F_SETSIG ,SIGIO ) <0 ) || (fcntl (fd,F_SETOWN ,os_getpid ()) <0 )) { err = -errno; -printk (UM_KERN_ERR "os_set_fd_async : Failed to fcntl F_SETOWN " +printk (KERN_ERR "os_set_fd_async : Failed to fcntl F_SETOWN " "(or F_SETSIG) fd %d, errno = %d\n" , fd, errno);return err; }
@@ -502,13 +502,13 @@ int os_rcv_fd(int fd, int *helper_pid_out) cmsg =CMSG_FIRSTHDR (&msg);if (cmsg ==NULL ) { -printk (UM_KERN_ERR "rcv_fd didn't receive anything, " +printk (KERN_ERR "rcv_fd didn't receive anything, " "error = %d\n" , errno);return -1 ; }if ((cmsg->cmsg_level !=SOL_SOCKET ) || (cmsg->cmsg_type !=SCM_RIGHTS )) { -printk (UM_KERN_ERR "rcv_fd didn't receive a descriptor\n" ); +printk (KERN_ERR "rcv_fd didn't receive a descriptor\n" );return -1 ; }
@@ -528,7 +528,7 @@ int os_create_unix_socket(const char *file, int len, int close_on_exec)if (close_on_exec) { err =os_set_exec_close (sock);if (err <0 ) -printk (UM_KERN_ERR "create_unix_socket : " +printk (KERN_ERR "create_unix_socket : " "close_on_exec failed, err = %d" , -err); }
@@ -568,7 +568,7 @@ int os_lock_file(int fd, int excl) goto out; } -printk (UM_KERN_ERR "F_SETLK failed, file already locked by pid %d\n" , +printk (KERN_ERR "F_SETLK failed, file already locked by pid %d\n" , lock.l_pid); err = save; out:
arch/um/os-Linux/helper.c +9 -9
@@ -52,14 +52,14 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) ret =socketpair (AF_UNIX ,SOCK_STREAM ,0 , fds);if (ret <0 ) { ret = -errno; -printk (UM_KERN_ERR "run_helper : pipe failed, errno = %d\n" , +printk (KERN_ERR "run_helper : pipe failed, errno = %d\n" , errno); goto out_free; } ret =os_set_exec_close (fds[1 ]);if (ret <0 ) { -printk (UM_KERN_ERR "run_helper : setting FD_CLOEXEC failed, " +printk (KERN_ERR "run_helper : setting FD_CLOEXEC failed, " "ret = %d\n" , -ret); goto out_close; }
@@ -74,7 +74,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) pid =clone (helper_child, (void *) sp,CLONE_VM , &data);if (pid <0 ) { ret = -errno; -printk (UM_KERN_ERR "run_helper : clone failed, errno = %d\n" , +printk (KERN_ERR "run_helper : clone failed, errno = %d\n" , errno); goto out_free2; }
@@ -92,7 +92,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) }else {if (n <0 ) { n = -errno; -printk (UM_KERN_ERR "run_helper : read on pipe failed, " +printk (KERN_ERR "run_helper : read on pipe failed, " "ret = %d\n" , -n); ret = n; }
@@ -124,7 +124,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, pid =clone (proc, (void *) sp, flags, arg);if (pid <0 ) { err = -errno; -printk (UM_KERN_ERR "run_helper_thread : clone failed, " +printk (KERN_ERR "run_helper_thread : clone failed, " "errno = %d\n" , errno);return err; }
@@ -132,12 +132,12 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,CATCH_EINTR (pid =waitpid (pid, &status, __WCLONE));if (pid <0 ) { err = -errno; -printk (UM_KERN_ERR "run_helper_thread - wait failed, " +printk (KERN_ERR "run_helper_thread - wait failed, " "errno = %d\n" , errno); pid = err; }if (!WIFEXITED (status) || (WEXITSTATUS (status) !=0 )) -printk (UM_KERN_ERR "run_helper_thread - thread " +printk (KERN_ERR "run_helper_thread - thread " "returned status 0x%x\n" , status);free_stack (stack,0 ); }else
@@ -152,11 +152,11 @@ int helper_wait(int pid)CATCH_EINTR (ret =waitpid (pid, &status, wflags));if (ret <0 ) { -printk (UM_KERN_ERR "helper_wait : waitpid process %d failed, " +printk (KERN_ERR "helper_wait : waitpid process %d failed, " "errno = %d\n" , pid, errno);return -errno; }else if (!WIFEXITED (status) ||WEXITSTATUS (status) !=0 ) { -printk (UM_KERN_ERR "helper_wait : process %d exited with " +printk (KERN_ERR "helper_wait : process %d exited with " "status 0x%x\n" , pid, status);return -ECHILD ; }else
arch/um/os-Linux/irq.c +2 -2
@@ -29,7 +29,7 @@ int os_waiting_for_events(struct irq_fd *active_fds)if (n <0 ) { err = -errno;if (errno !=EINTR ) -printk (UM_KERN_ERR "os_waiting_for_events:" +printk (KERN_ERR "os_waiting_for_events:" " poll returned %d, errno = %d\n" , n, errno);return err; }
@@ -88,7 +88,7 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,struct irq_fd *old_fd = *prev;if ((pollfds[i].fd !=-1 ) && (pollfds[i].fd != (*prev)->fd)) { -printk (UM_KERN_ERR "os_free_irq_by_cb - " +printk (KERN_ERR "os_free_irq_by_cb - " "mismatch between active_fds and " "pollfds, fd %d vs %d\n" , (*prev)->fd, pollfds[i].fd);
arch/um/os-Linux/process.c +11 -11
@@ -32,13 +32,13 @@ unsigned long os_process_pc(int pid)sprintf (proc_stat,"/proc/%d/stat" , pid); fd =open (proc_stat,O_RDONLY ,0 );if (fd <0 ) { -printk (UM_KERN_ERR "os_process_pc - couldn't open '%s', " +printk (KERN_ERR "os_process_pc - couldn't open '%s', " "errno = %d\n" , proc_stat, errno); goto out; }CATCH_EINTR (err =read (fd, buf,sizeof (buf)));if (err <0 ) { -printk (UM_KERN_ERR "os_process_pc - couldn't read '%s', " +printk (KERN_ERR "os_process_pc - couldn't read '%s', " "err = %d\n" , proc_stat, errno); goto out_close; }
@@ -47,7 +47,7 @@ unsigned long os_process_pc(int pid)if (sscanf (buf,"%*d " COMM_SCANF " %*c %*d %*d %*d %*d %*d %*d %*d " "%*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d " "%*d %*d %*d %*d %*d %lu" , &pc) !=1 ) -printk (UM_KERN_ERR "os_process_pc - couldn't find pc in '%s'\n" , +printk (KERN_ERR "os_process_pc - couldn't find pc in '%s'\n" , buf); out_close:close (fd);
@@ -67,7 +67,7 @@ int os_process_parent(int pid)snprintf (stat,sizeof (stat),"/proc/%d/stat" , pid); fd =open (stat,O_RDONLY ,0 );if (fd <0 ) { -printk (UM_KERN_ERR "Couldn't open '%s', errno = %d\n" , stat, +printk (KERN_ERR "Couldn't open '%s', errno = %d\n" , stat, errno);return parent; }
@@ -76,7 +76,7 @@ int os_process_parent(int pid)close (fd);if (n <0 ) { -printk (UM_KERN_ERR "Couldn't read '%s', errno = %d\n" , stat, +printk (KERN_ERR "Couldn't read '%s', errno = %d\n" , stat, errno);return parent; }
@@ -84,7 +84,7 @@ int os_process_parent(int pid) parent =FAILURE_PID ; n =sscanf (data,"%*d " COMM_SCANF " %*c %d" , &parent);if (n !=1 ) -printk (UM_KERN_ERR "Failed to scan '%s'\n" , data); +printk (KERN_ERR "Failed to scan '%s'\n" , data);return parent; }
@@ -185,10 +185,10 @@ int __init can_drop_memory(void)void *addr;int fd, ok =0 ; -printk (UM_KERN_INFO "Checking host MADV_REMOVE support..." ); +printk (KERN_INFO "Checking host MADV_REMOVE support..." ); fd =create_mem_file (UM_KERN_PAGE_SIZE );if (fd <0 ) { -printk (UM_KERN_ERR "Creating test memory file failed, " +printk (KERN_ERR "Creating test memory file failed, " "err = %d\n" , -fd); goto out; }
@@ -196,17 +196,17 @@ int __init can_drop_memory(void) addr =mmap64 (NULL ,UM_KERN_PAGE_SIZE ,PROT_READ |PROT_WRITE ,MAP_SHARED , fd,0 );if (addr ==MAP_FAILED ) { -printk (UM_KERN_ERR "Mapping test memory file failed, " +printk (KERN_ERR "Mapping test memory file failed, " "err = %d\n" , -errno); goto out_close; }if (madvise (addr,UM_KERN_PAGE_SIZE ,MADV_REMOVE ) !=0 ) { -printk (UM_KERN_ERR "MADV_REMOVE failed, err = %d\n" , -errno); +printk (KERN_ERR "MADV_REMOVE failed, err = %d\n" , -errno); goto out_unmap; } -printk (UM_KERN_CONT "OK\n" ); +printk (KERN_CONT "OK\n" ); ok =1 ; out_unmap:
arch/um/os-Linux/sigio.c +26 -26
188 lines not on this page · raw message
arch/um/os-Linux/skas/mem.c +7 -7
@@ -55,9 +55,9 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) n =ptrace_setregs (pid, syscall_regs);if (n <0 ) { -printk (UM_KERN_ERR "Registers - \n" ); +printk (KERN_ERR "Registers - \n" );for (i =0 ; i <MAX_REG_NR ; i++) -printk (UM_KERN_ERR "\t%d\t0x%lx\n" , i, syscall_regs[i]); +printk (KERN_ERR "\t%d\t0x%lx\n" , i, syscall_regs[i]);panic ("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n" , -n); }
@@ -79,22 +79,22 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) offset = *((unsigned long *) mm_idp->stack +1 );if (offset) { data = (unsigned long *)(mm_idp->stack + offset -STUB_DATA ); -printk (UM_KERN_ERR "do_syscall_stub : ret = %ld, offset = %ld, " +printk (KERN_ERR "do_syscall_stub : ret = %ld, offset = %ld, " "data = %p\n" , ret, offset, data); syscall = (unsigned long *)((unsigned long )data + data[0 ]); -printk (UM_KERN_ERR "do_syscall_stub: syscall %ld failed, " +printk (KERN_ERR "do_syscall_stub: syscall %ld failed, " "return value = 0x%lx, expected return value = 0x%lx\n" , syscall[0 ], ret, syscall[7 ]); -printk (UM_KERN_ERR " syscall parameters: " +printk (KERN_ERR " syscall parameters: " "0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n" , syscall[1 ], syscall[2 ], syscall[3 ], syscall[4 ], syscall[5 ], syscall[6 ]);for (n =1 ; n < data[0 ]/sizeof (long ); n++) {if (n ==1 ) -printk (UM_KERN_ERR " additional syscall " +printk (KERN_ERR " additional syscall " "data:" );if (n %4 ==1 ) -printk ("\n" UM_KERN_ERR " " ); +printk ("\n" KERN_ERR " " );printk (" 0x%lx" , data[n]); }if (n >1 )
arch/um/os-Linux/skas/process.c +35 -35
263 lines not on this page · raw message
arch/um/os-Linux/time.c +1 -1
@@ -61,7 +61,7 @@ long long disable_timer(void)long long remain, max =UM_NSEC_PER_SEC /UM_HZ ;if (setitimer (ITIMER_VIRTUAL , &time, &time) <0 ) -printk (UM_KERN_ERR "disable_timer - setitimer failed, " +printk (KERN_ERR "disable_timer - setitimer failed, " "errno = %d\n" , errno); remain =timeval_to_ns (&time.it_value);
arch/um/os-Linux/tty.c +3 -3
@@ -32,7 +32,7 @@ int get_pty(void) fd =open ("/dev/ptmx" ,O_RDWR );if (fd <0 ) { err = -errno; -printk (UM_KERN_ERR "get_pty : Couldn't open /dev/ptmx - " +printk (KERN_ERR "get_pty : Couldn't open /dev/ptmx - " "err = %d\n" , errno);return err; }
@@ -42,14 +42,14 @@ int get_pty(void)if (info.res <0 ) { err = -info.err; -printk (UM_KERN_ERR "get_pty : Couldn't grant pty - " +printk (KERN_ERR "get_pty : Couldn't grant pty - " "errno = %d\n" , -info.err); goto out; }if (unlockpt (fd) <0 ) { err = -errno; -printk (UM_KERN_ERR "get_pty : Couldn't unlock pty - " +printk (KERN_ERR "get_pty : Couldn't unlock pty - " "errno = %d\n" , errno); goto out; }
arch/um/os-Linux/umid.c +14 -14
@@ -35,7 +35,7 @@ static int __init make_uml_dir(void) err = -ENOENT ;if (home ==NULL ) { -printk (UM_KERN_ERR "make_uml_dir : no value in " +printk (KERN_ERR "make_uml_dir : no value in " "environment for $HOME\n" ); goto err; }
@@ -138,7 +138,7 @@ static inline int is_umdir_used(char *dir) n =snprintf (file,sizeof (file),"%s/pid" , dir);if (n >=sizeof (file)) { -printk (UM_KERN_ERR "is_umdir_used - pid filename too long\n" ); +printk (KERN_ERR "is_umdir_used - pid filename too long\n" ); err = -E2BIG ; goto out; }
@@ -148,7 +148,7 @@ static inline int is_umdir_used(char *dir)if (fd <0 ) { fd = -errno;if (fd != -ENOENT ) { -printk (UM_KERN_ERR "is_umdir_used : couldn't open pid " +printk (KERN_ERR "is_umdir_used : couldn't open pid " "file '%s', err = %d\n" , file, -fd); } goto out;
@@ -157,24 +157,24 @@ static inline int is_umdir_used(char *dir) err =0 ; n =read (fd, pid,sizeof (pid));if (n <0 ) { -printk (UM_KERN_ERR "is_umdir_used : couldn't read pid file " +printk (KERN_ERR "is_umdir_used : couldn't read pid file " "'%s', err = %d\n" , file, errno); goto out_close; }else if (n ==0 ) { -printk (UM_KERN_ERR "is_umdir_used : couldn't read pid file " +printk (KERN_ERR "is_umdir_used : couldn't read pid file " "'%s', 0-byte read\n" , file); goto out_close; } p =strtoul (pid, &end,0 );if (end == pid) { -printk (UM_KERN_ERR "is_umdir_used : couldn't parse pid file " +printk (KERN_ERR "is_umdir_used : couldn't parse pid file " "'%s', errno = %d\n" , file, errno); goto out_close; }if ((kill (p,0 ) ==0 ) || (errno !=ESRCH )) { -printk (UM_KERN_ERR "umid \"%s\" is already in use by pid %d\n" , +printk (KERN_ERR "umid \"%s\" is already in use by pid %d\n" , umid, p);return 1 ; }
@@ -199,7 +199,7 @@ static int umdir_take_if_dead(char *dir) ret =remove_files_and_dir (dir);if (ret) { -printk (UM_KERN_ERR "is_umdir_used - remove_files_and_dir " +printk (KERN_ERR "is_umdir_used - remove_files_and_dir " "failed with err = %d\n" , ret); }return ret;
@@ -216,7 +216,7 @@ static void __init create_pid_file(void) fd =open (file,O_RDWR |O_CREAT |O_EXCL ,0644 );if (fd <0 ) { -printk (UM_KERN_ERR "Open of machine pid file \"%s\" failed: " +printk (KERN_ERR "Open of machine pid file \"%s\" failed: " "%s\n" , file,strerror (errno));return ; }
@@ -224,7 +224,7 @@ static void __init create_pid_file(void)snprintf (pid,sizeof (pid),"%d\n" ,getpid ()); n =write (fd, pid,strlen (pid));if (n !=strlen (pid)) -printk (UM_KERN_ERR "Write of pid file failed - err = %d\n" , +printk (KERN_ERR "Write of pid file failed - err = %d\n" , errno);close (fd);
@@ -258,7 +258,7 @@ static int __init make_umid(void)strlcat (tmp,"XXXXXX" ,sizeof (tmp)); fd =mkstemp (tmp);if (fd <0 ) { -printk (UM_KERN_ERR "make_umid - mkstemp(%s) failed: " +printk (KERN_ERR "make_umid - mkstemp(%s) failed: " "%s\n" , tmp,strerror (errno)); err = -errno; goto err;
@@ -293,7 +293,7 @@ static int __init make_umid(void) }if (err) { err = -errno; -printk (UM_KERN_ERR "Failed to create '%s' - err = %d\n" , umid, +printk (KERN_ERR "Failed to create '%s' - err = %d\n" , umid, errno); goto err; }
@@ -316,7 +316,7 @@ static int __init make_umid_init(void)* If initializing with the given umid failed, then try again with * a random one. */ -printk (UM_KERN_ERR "Failed to initialize umid \"%s\", trying with a " +printk (KERN_ERR "Failed to initialize umid \"%s\", trying with a " "random umid\n" , umid); *umid ='\0' ;make_umid ();
@@ -336,7 +336,7 @@ int __init umid_file_name(char *name, char *buf, int len) n =snprintf (buf, len,"%s%s/%s" , uml_dir, umid, name);if (n >= len) { -printk (UM_KERN_ERR "umid_file_name : buffer too short\n" ); +printk (KERN_ERR "umid_file_name : buffer too short\n" );return -E2BIG ; }
arch/x86/um/bugs_32.c +7 -7
@@ -23,7 +23,7 @@ void arch_check_bugs(void) {struct sigaction old, new; -printk (UM_KERN_INFO "Checking for host processor cmov support..." ); +printk (KERN_INFO "Checking for host processor cmov support..." ); new.sa_handler = cmov_sigill_test_handler;/* Make sure that SIGILL is enabled after the handler longjmps back */
@@ -34,9 +34,9 @@ void arch_check_bugs(void)if (setjmp (cmov_test_return) ==0 ) {unsigned long foo =0 ; __asm__ __volatile__("cmovz %0, %1" :"=r" (foo) :"0" (foo)); -printk (UM_KERN_CONT "Yes\n" ); +printk (KERN_CONT "Yes\n" ); }else -printk (UM_KERN_CONT "No\n" ); +printk (KERN_CONT "No\n" );sigaction (SIGILL , &old, &new); }
@@ -53,7 +53,7 @@ void arch_examine_signal(int sig, struct uml_pt_regs *regs)return ;if (copy_from_user_proc (tmp, (void *)UPT_IP (regs),2 )) { -printk (UM_KERN_ERR "SIGILL in init, could not read " +printk (KERN_ERR "SIGILL in init, could not read " "instructions!\n" );return ; }
@@ -62,13 +62,13 @@ void arch_examine_signal(int sig, struct uml_pt_regs *regs)return ;if (host_has_cmov ==0 ) -printk (UM_KERN_ERR "SIGILL caused by cmov, which this " +printk (KERN_ERR "SIGILL caused by cmov, which this " "processor doesn't implement. Boot a filesystem " "compiled for older processors" );else if (host_has_cmov ==1 ) -printk (UM_KERN_ERR "SIGILL caused by cmov, which this " +printk (KERN_ERR "SIGILL caused by cmov, which this " "processor claims to implement" );else -printk (UM_KERN_ERR "Bad value for host_has_cmov (%d)" , +printk (KERN_ERR "Bad value for host_has_cmov (%d)" , host_has_cmov); }
arch/x86/um/os-Linux/registers.c +1 -1
@@ -106,7 +106,7 @@ unsigned long get_thread_reg(int reg, jmp_buf *buf)return buf[0 ]->__rbp;#endif default : -printk (UM_KERN_ERR "get_thread_regs - unknown register %d\n" , +printk (KERN_ERR "get_thread_regs - unknown register %d\n" , reg);return 0 ; }
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
Re: [uml-devel] [PATCH 1/4] UserModeLinux: Convert UM_KERN_<LEVEL> to KERN_<LEVEL>
Quoted 5 lines · Joe Perches
The defines are the same since commit
9429ec96c2718("um: Preincludeinclude/linux/kern_levels.h") so just convert them to the normal KERN_<LEVEL> uses.Signed-off-by Joe Perches <[email protected]>
Cfr.
https://lkml.org/lkml/2012/9/29/77
https://lkml.org/lkml/2012/9/29/106
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus
Torvaldshttps://lkml.org/lkml/2012/9/29/106
PATCH 2/4 UserModeLinux: Remove unused #defines of UM_KERN_<LEVEL>
In reply to Joe PerchesThese are now unused so delete them.
--- arch/um/include/shared/user.h | 11 ----------- 1 file changed, 11 deletions(-)
arch/um/include/shared/user.h +0 -11
@@ -26,17 +26,6 @@extern void panic (const char *fmt, ...) __attribute__ ((format (printf,1 ,2 ))); -/* Requires preincluding include/linux/kern_levels.h */ -#define UM_KERN_EMERG KERN_EMERG -#define UM_KERN_ALERT KERN_ALERT -#define UM_KERN_CRIT KERN_CRIT -#define UM_KERN_ERR KERN_ERR -#define UM_KERN_WARNING KERN_WARNING -#define UM_KERN_NOTICE KERN_NOTICE -#define UM_KERN_INFO KERN_INFO -#define UM_KERN_DEBUG KERN_DEBUG -#define UM_KERN_CONT KERN_CONT -#ifdef UML_CONFIG_PRINTK extern int printk (const char *fmt, ...) __attribute__ ((format (printf,1 ,2 )));
Signature · 13 lines
1.8.1.2.459.gbcd45b4.dirty ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 3/4 UserModeLinux: Use a more current logging style
In reply to Joe PerchesConvert printks to pr_<level>
Coalesce formats
Realign arguments
--- arch/um/drivers/chan_kern.c | 27 +++---- arch/um/drivers/chan_user.c | 47 ++++++------ arch/um/drivers/daemon_kern.c | 3 +- arch/um/drivers/daemon_user.c | 28 +++---- arch/um/drivers/fd.c | 9 +-- arch/um/drivers/hostaudio_kern.c | 13 ++-- arch/um/drivers/line.c | 24 +++--- arch/um/drivers/mconsole_kern.c | 29 +++---- arch/um/drivers/mconsole_user.c | 7 +- arch/um/drivers/mmapper_kern.c | 7 +- arch/um/drivers/net_kern.c | 53 +++++-------- arch/um/drivers/net_user.c | 20 ++--- arch/um/drivers/pcap_kern.c | 7 +- arch/um/drivers/pcap_user.c | 19 +++-- arch/um/drivers/port_kern.c | 23 +++--- arch/um/drivers/port_user.c | 6 +- arch/um/drivers/pty.c | 4 +- arch/um/drivers/slip_user.c | 29 +++---- arch/um/drivers/slirp_kern.c | 3 +- arch/um/drivers/slirp_user.c | 9 +-- arch/um/drivers/ssl.c | 10 +-- arch/um/drivers/stdio_console.c | 9 +-- arch/um/drivers/tty.c | 3 +- arch/um/drivers/ubd_kern.c | 100 ++++++++++++------------- arch/um/drivers/umcast_kern.c | 38 +++++----- arch/um/drivers/umcast_user.c | 35 ++++----- arch/um/drivers/vde_kern.c | 17 ++--- arch/um/drivers/vde_user.c | 14 ++-- arch/um/drivers/xterm.c | 26 +++---- arch/um/drivers/xterm_kern.c | 6 +- arch/um/kernel/exec.c | 4 +- arch/um/kernel/exitcode.c | 3 +- arch/um/kernel/initrd.c | 10 +-- arch/um/kernel/irq.c | 14 ++-- arch/um/kernel/physmem.c | 16 ++-- arch/um/kernel/process.c | 2 +- arch/um/kernel/sigio.c | 4 +- arch/um/kernel/skas/mmu.c | 9 +-- arch/um/kernel/smp.c | 18 ++--- arch/um/kernel/sysrq.c | 21 +++--- arch/um/kernel/time.c | 6 +- arch/um/kernel/tlb.c | 8 +- arch/um/kernel/trap.c | 9 +-- arch/um/os-Linux/aio.c | 45 +++++------ arch/um/os-Linux/drivers/ethertap_kern.c | 8 +- arch/um/os-Linux/drivers/ethertap_user.c | 32 ++++---- arch/um/os-Linux/drivers/tuntap_kern.c | 6 +- arch/um/os-Linux/drivers/tuntap_user.c | 24 +++--- arch/um/os-Linux/file.c | 37 ++++----- arch/um/os-Linux/helper.c | 33 ++++---- arch/um/os-Linux/irq.c | 8 +- arch/um/os-Linux/process.c | 31 ++++---- arch/um/os-Linux/sigio.c | 83 +++++++++----------- arch/um/os-Linux/skas/mem.c | 23 +++--- arch/um/os-Linux/skas/process.c | 125 ++++++++++++++----------------- arch/um/os-Linux/time.c | 3 +- arch/um/os-Linux/tty.c | 10 +-- arch/um/os-Linux/umid.c | 48 ++++++------ 58 files changed, 550 insertions(+), 715 deletions(-)
arch/um/drivers/chan_kern.c +9 -18
@@ -14,58 +14,50 @@static void *not_configged_init (char *str,int device,const struct chan_opts *opts) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" );return NULL ; }static int not_configged_open (int input,int output,int primary,void *data,char **dev_out) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" );return -ENODEV ; }static void not_configged_close (int fd,void *data) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" ); }static int not_configged_read (int fd,char *c_out,void *data) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" );return -EIO ; }static int not_configged_write (int fd,const char *buf,int len,void *data) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" );return -EIO ; }static int not_configged_console_write (int fd,const char *buf,int len) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" );return -EIO ; }static int not_configged_window_size (int fd,void *data,unsigned short *rows,unsigned short *cols) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" );return -ENODEV ; }static void not_configged_free (void *data) { -printk (KERN_ERR "Using a channel type which is configured out of " -"UML\n" ); +pr_err ("Using a channel type which is configured out of UML\n" ); }static const struct chan_ops not_configged_ops = {
@@ -292,8 +284,7 @@ int console_open_chan(struct line *line, struct console *co)if (err)return err; -printk (KERN_INFO "Console initialized on /dev/%s%d\n" , co->name, - co->index); +pr_info ("Console initialized on /dev/%s%d\n" , co->name, co->index);return 0 ; }
arch/um/drivers/chan_user.c +21 -26
113 lines not on this page · raw message
arch/um/drivers/daemon_kern.c +1 -2
@@ -70,8 +70,7 @@ static int daemon_setup(char *str, char **mac_out, void *data) remain =split_if_spec (str, mac_out, &init->sock_type, &init->ctl_sock,NULL );if (remain !=NULL ) -printk (KERN_WARNING "daemon_setup : Ignoring data socket " -"specification\n" ); +pr_warn ("daemon_setup : Ignoring data socket specification\n" );return 1 ; }
arch/um/drivers/daemon_user.c +12 -16
@@ -35,8 +35,7 @@ static struct sockaddr_un *new_addr(void *name, int len) sun =uml_kmalloc (sizeof (struct sockaddr_un ),UM_GFP_KERNEL );if (sun ==NULL ) { -printk (KERN_ERR "new_addr: allocation of sockaddr_un " -"failed\n" ); +pr_err ("new_addr: allocation of sockaddr_un failed\n" );return NULL ; } sun->sun_family =AF_UNIX ;
@@ -55,37 +54,34 @@ static int connect_to_switch(struct daemon_data *pri) pri->control =socket (AF_UNIX ,SOCK_STREAM ,0 );if (pri->control <0 ) { err = -errno; -printk (KERN_ERR "daemon_open : control socket failed, " -"errno = %d\n" , -err); +pr_err ("daemon_open : control socket failed, errno = %d\n" , + -err);return err; }if (connect (pri->control, (struct sockaddr *) ctl_addr,sizeof (*ctl_addr)) <0 ) { err = -errno; -printk (KERN_ERR "daemon_open : control connect failed, " -"errno = %d\n" , -err); +pr_err ("daemon_open : control connect failed, errno = %d\n" , + -err); goto out; } fd =socket (AF_UNIX ,SOCK_DGRAM ,0 );if (fd <0 ) { err = -errno; -printk (KERN_ERR "daemon_open : data socket failed, " -"errno = %d\n" , -err); +pr_err ("daemon_open : data socket failed, errno = %d\n" , -err); goto out; }if (bind (fd, (struct sockaddr *) local_addr,sizeof (*local_addr)) <0 ) { err = -errno; -printk (KERN_ERR "daemon_open : data bind failed, " -"errno = %d\n" , -err); +pr_err ("daemon_open : data bind failed, errno = %d\n" , -err); goto out_close; } sun =uml_kmalloc (sizeof (struct sockaddr_un ),UM_GFP_KERNEL );if (sun ==NULL ) { -printk (KERN_ERR "new_addr: allocation of sockaddr_un " -"failed\n" ); +pr_err ("new_addr: allocation of sockaddr_un failed\n" ); err = -ENOMEM ; goto out_close; }
@@ -96,16 +92,16 @@ static int connect_to_switch(struct daemon_data *pri) req.sock = *local_addr; n =write (pri->control, &req,sizeof (req));if (n !=sizeof (req)) { -printk (KERN_ERR "daemon_open : control setup request " -"failed, err = %d\n" , -errno); +pr_err ("daemon_open : control setup request failed, err = %d\n" , + -errno); err = -ENOTCONN ; goto out_free; } n =read (pri->control, sun,sizeof (*sun));if (n !=sizeof (*sun)) { -printk (KERN_ERR "daemon_open : read of data socket failed, " -"err = %d\n" , -errno); +pr_err ("daemon_open : read of data socket failed, err = %d\n" , + -errno); err = -ENOTCONN ; goto out_free; }
arch/um/drivers/fd.c +3 -6
@@ -26,15 +26,13 @@ static void *fd_init(char *str, int device, const struct chan_opts *opts)int n;if (*str !=':' ) { -printk (KERN_ERR "fd_init : channel type 'fd' must specify a " -"file descriptor\n" ); +pr_err ("fd_init : channel type 'fd' must specify a file descriptor\n" );return NULL ; } str++; n =strtoul (str, &end,0 );if ((*end !='\0' ) || (end == str)) { -printk (KERN_ERR "fd_init : couldn't parse file descriptor " -"'%s'\n" , str); +pr_err ("fd_init : couldn't parse file descriptor '%s'\n" , str);return NULL ; }
@@ -76,8 +74,7 @@ static void fd_close(int fd, void *d)CATCH_EINTR (err =tcsetattr (fd,TCSAFLUSH , &data->tt));if (err) -printk (KERN_ERR "Failed to restore terminal state - " -"errno = %d\n" , -err); +pr_err ("Failed to restore terminal state - errno = %d\n" , -err); data->raw =0 ; }
arch/um/drivers/hostaudio_kern.c +6 -7
@@ -268,8 +268,8 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)if (ret <0 ) {kparam_block_sysfs_write (dsp); -printk (KERN_ERR "hostaudio_open_mixdev failed to open '%s', " -"err = %d\n" , dsp, -ret); +pr_err ("hostaudio_open_mixdev failed to open '%s', err = %d\n" , + dsp, -ret);kparam_unblock_sysfs_write (dsp);kfree (state);return ret;
@@ -327,20 +327,19 @@ MODULE_LICENSE("GPL");static int __init hostaudio_init_module (void ) {__kernel_param_lock (); -printk (KERN_INFO "UML Audio Relay (host dsp = %s, host mixer = %s)\n" , - dsp, mixer); +pr_info ("UML Audio Relay (host dsp = %s, host mixer = %s)\n" , + dsp, mixer);__kernel_param_unlock (); module_data.dev_audio =register_sound_dsp (&hostaudio_fops,-1 );if (module_data.dev_audio <0 ) { -printk (KERN_ERR "hostaudio: couldn't register DSP device!\n" ); +pr_err ("hostaudio: couldn't register DSP device!\n" );return -ENODEV ; } module_data.dev_mixer =register_sound_mixer (&hostmixer_fops,-1 );if (module_data.dev_mixer <0 ) { -printk (KERN_ERR "hostmixer: couldn't register mixer " -"device!\n" ); +pr_err ("hostmixer: couldn't register mixer device!\n" );unregister_sound_dsp (module_data.dev_audio);return -ENODEV ; }
arch/um/drivers/line.c +11 -13
@@ -89,8 +89,7 @@ static int buffer_data(struct line *line, const char *buf, int len)if (line->buffer ==NULL ) { line->buffer =kmalloc (LINE_BUFSIZE ,GFP_ATOMIC );if (line->buffer ==NULL ) { -printk (KERN_ERR "buffer_data - atomic allocation " -"failed\n" ); +pr_err ("buffer_data - atomic allocation failed\n" );return 0 ; } line->head = line->buffer;
@@ -457,8 +456,8 @@ int line_setup(char **conf, unsigned int num, char **def,return 0 ; out: -printk (KERN_ERR "Failed to set up %s with " -"configuration string \"%s\" : %s\n" , name, init, error); +pr_err ("Failed to set up %s with configuration string \"%s\" : %s\n" , + name, init, error);return -EINVAL ; }
@@ -576,7 +575,7 @@ int register_lines(struct line_driver *line_driver, err =tty_register_driver (driver);if (err) { -printk (KERN_ERR "register_lines : can't register %s driver\n" , +pr_err ("register_lines : can't register %s driver\n" , line_driver->name);put_tty_driver (driver);for (i =0 ; i < nlines; i++)
@@ -640,10 +639,10 @@ static irqreturn_t winch_interrupt(int irq, void *data) winch->fd =-1 ;list_del (&winch->list);os_close_file (fd); -printk (KERN_ERR "winch_interrupt : " -"read failed, errno = %d\n" , -err); -printk (KERN_ERR "fd %d is losing SIGWINCH " -"support\n" , winch->tty_fd); +pr_err ("winch_interrupt : read failed, errno = %d\n" , + -err); +pr_err ("fd %d is losing SIGWINCH support\n" , + winch->tty_fd);INIT_WORK (&winch->work, __free_winch);schedule_work (&winch->work);return IRQ_HANDLED ;
@@ -674,7 +673,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port, winch =kmalloc (sizeof (*winch),GFP_KERNEL );if (winch ==NULL ) { -printk (KERN_ERR "register_winch_irq - kmalloc failed\n" ); +pr_err ("register_winch_irq - kmalloc failed\n" ); goto cleanup; }
@@ -687,8 +686,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port,if (um_request_irq (WINCH_IRQ , fd,IRQ_READ , winch_interrupt,IRQF_SHARED ,"winch" , winch) <0 ) { -printk (KERN_ERR "register_winch_irq - failed to register " -"IRQ\n" ); +pr_err ("register_winch_irq - failed to register IRQ\n" ); goto out_free; }
@@ -755,7 +753,7 @@ char *add_xterm_umid(char *base) len =strlen (base) +strlen (" ()" ) +strlen (umid) +1 ; title =kmalloc (len,GFP_KERNEL );if (title ==NULL ) { -printk (KERN_ERR "Failed to allocate buffer for xterm title\n" ); +pr_err ("Failed to allocate buffer for xterm title\n" );return base; }
arch/um/drivers/mconsole_kern.c +15 -14
@@ -117,7 +117,7 @@ void mconsole_log(struct mc_request *req) ptr +=strlen ("log " ); len = req->len - (ptr - req->request.data); -printk (KERN_WARNING "%.*s" , len, ptr); +pr_warn ("%.*s" , len, ptr);mconsole_reply (req,"" ,0 ,0 ); }
@@ -136,7 +136,7 @@ void mconsole_proc(struct mc_request *req) file =file_open_root (mnt->mnt_root, mnt, ptr,O_RDONLY );if (IS_ERR (file)) {mconsole_reply (req,"Failed to open file" ,1 ,0 ); -printk (KERN_ERR "open /proc/%s: %ld\n" , ptr,PTR_ERR (file)); +pr_err ("open /proc/%s: %ld\n" , ptr,PTR_ERR (file)); goto out; }
@@ -358,8 +358,8 @@ static int mem_config(char *str, char **error_out) list); err =os_drop_memory (addr,PAGE_SIZE );if (err) { -printk (KERN_ERR "Failed to release " -"memory - errno = %d\n" , err); +pr_err ("Failed to release memory - errno = %d\n" , + err); *error_out ="Failed to release memory" ; goto out_unlock; }
@@ -415,8 +415,8 @@ static int __init mem_mc_init(void) {if (can_drop_memory ())mconsole_register_dev (&mem_mc); -else printk (KERN_ERR "Can't release memory to the host - memory " -"hotplug won't be supported\n" ); +else +pr_err ("Can't release memory to the host - memory hotplug won't be supported\n" );return 0 ; }
@@ -707,7 +707,7 @@ static int __init mconsole_init(void) sock =os_create_unix_socket (file,sizeof (file),1 );if (sock <0 ) { -printk (KERN_ERR "Failed to initialize management console\n" ); +pr_err ("Failed to initialize management console\n" );return 1 ; }if (os_set_fd_block (sock,0 ))
@@ -718,7 +718,7 @@ static int __init mconsole_init(void) err =um_request_irq (MCONSOLE_IRQ , sock,IRQ_READ , mconsole_interrupt,IRQF_SHARED ,"mconsole" , (void *)sock);if (err) { -printk (KERN_ERR "Failed to get IRQ for management console\n" ); +pr_err ("Failed to get IRQ for management console\n" ); goto out; }
@@ -728,12 +728,12 @@ static int __init mconsole_init(void)mconsole_notify (notify_socket,MCONSOLE_SOCKET , mconsole_socket_name,strlen (mconsole_socket_name) +1 ); - else printk(KERN_ERR "mconsole_setup failed to strdup " - "string\n"); + else + pr_err("mconsole_setup failed to strdup string\n"); } -printk (KERN_INFO "mconsole (version %d) initialized on %s\n" , -MCONSOLE_VERSION , mconsole_socket_name); +pr_info ("mconsole (version %d) initialized on %s\n" , +MCONSOLE_VERSION , mconsole_socket_name);return 0 ; out:
@@ -780,7 +780,7 @@ static int create_proc_mconsole(void) ent =proc_create ("mconsole" ,0200 ,NULL , &mconsole_proc_fops);if (ent ==NULL ) { -printk (KERN_INFO "create_proc_mconsole : proc_create failed\n" ); +pr_info ("create_proc_mconsole : proc_create failed\n" );return 0 ; }return 0 ;
@@ -807,8 +807,9 @@ static int mconsole_setup(char *str)if (!strncmp (str,NOTIFY ,strlen (NOTIFY ))) { str +=strlen (NOTIFY ); notify_socket = str; + }else { +pr_err ("mconsole_setup : Unknown option - '%s'\n" , str); } -else printk (KERN_ERR "mconsole_setup : Unknown option - '%s'\n" , str);return 1 ; }
arch/um/drivers/mconsole_user.c +3 -4
@@ -187,8 +187,8 @@ int mconsole_notify(char *sock_name, int type, const void *data, int len) notify_sock =socket (PF_UNIX ,SOCK_DGRAM ,0 );if (notify_sock <0 ) { err = -errno; -printk (KERN_ERR "mconsole_notify - socket failed, " -"errno = %d\n" , errno); +pr_err ("mconsole_notify - socket failed, errno = %d\n" , + errno); } }unlock_notify ();
@@ -212,8 +212,7 @@ int mconsole_notify(char *sock_name, int type, const void *data, int len) sizeof(target));if (n <0 ) { err = -errno; -printk (KERN_ERR "mconsole_notify - sendto failed, " -"errno = %d\n" , errno); +pr_err ("mconsole_notify - sendto failed, errno = %d\n" , errno); }return err; }
arch/um/drivers/mmapper_kern.c +3 -4
@@ -103,19 +103,18 @@ static int __init mmapper_init(void) {int err; -printk (KERN_INFO "Mapper v0.1\n" ); +pr_info ("Mapper v0.1\n" ); v_buf = (char *)find_iomem ("mmapper" , &mmapper_size);if (mmapper_size ==0 ) { -printk (KERN_ERR "mmapper_init - find_iomem failed\n" ); +pr_err ("mmapper_init - find_iomem failed\n" );return -ENODEV ; } p_buf =__pa (v_buf); err =misc_register (&mmapper_dev);if (err) { -printk (KERN_ERR "mmapper - misc_register failed, err = %d\n" , - err); +pr_err ("mmapper - misc_register failed, err = %d\n" , err);return err; }return 0 ;
arch/um/drivers/net_kern.c +20 -33
126 lines not on this page · raw message
arch/um/drivers/net_user.c +8 -12
@@ -23,8 +23,7 @@ int tap_open_common(void *dev, char *gate_addr)return 0 ;if (sscanf (gate_addr,"%d.%d.%d.%d" , &tap_addr[0 ], &tap_addr[1 ], &tap_addr[2 ], &tap_addr[3 ]) !=4 ) { -printk (KERN_ERR "Invalid tap IP address - '%s'\n" , - gate_addr); +pr_err ("Invalid tap IP address - '%s'\n" , gate_addr);return -EINVAL ; }return 0 ;
@@ -41,8 +40,7 @@ void tap_check_ips(char *gate_addr, unsigned char *eth_addr) (eth_addr[1] == tap_addr[1]) && (eth_addr[2] == tap_addr[2]) && (eth_addr[3] == tap_addr[3])) { -printk (KERN_ERR "The tap IP address and the UML eth IP " -"address must be different\n" ); +pr_err ("The tap IP address and the UML eth IP address must be different\n" ); } }
@@ -85,11 +83,11 @@ void read_output(int fd, char *output, int len) err:if (ret <0 ) -printk (KERN_ERR "read_output - read of %s failed, " -"errno = %d\n" , str, -ret); +pr_err ("read_output - read of %s failed, errno = %d\n" , + str, -ret);else -printk (KERN_ERR "read_output - read of %s failed, read only " -"%d of %d bytes\n" , str, ret, expected); +pr_err ("read_output - read of %s failed, read only %d of %d bytes\n" , + str, ret, expected); }int net_read (int fd,void *buf,int len)
@@ -184,8 +182,7 @@ static int change_tramp(char **argv, char *output, int output_len) err =os_pipe (fds,1 ,0 );if (err <0 ) { -printk (KERN_ERR "change_tramp - pipe failed, err = %d\n" , - -err); +pr_err ("change_tramp - pipe failed, err = %d\n" , -err);return err; } pe_data.close_me = fds[0 ];
@@ -222,8 +219,7 @@ static void change(char *dev, char *what, unsigned char *addr, output_len =UM_KERN_PAGE_SIZE ; output =uml_kmalloc (output_len,UM_GFP_KERNEL );if (output ==NULL ) -printk (KERN_ERR "change : failed to allocate output " -"buffer\n" ); +pr_err ("change : failed to allocate output buffer\n" ); pid =change_tramp (argv, output, output_len);if (pid <0 ) {
arch/um/drivers/pcap_kern.c +3 -4
@@ -65,8 +65,8 @@ int pcap_setup(char *str, char **mac_out, void *data) remain =split_if_spec (str, &host_if, &init->filter, &options[0 ], &options[1 ], mac_out,NULL );if (remain !=NULL ) { -printk (KERN_ERR "pcap_setup - Extra garbage on " -"specification : '%s'\n" , remain); +pr_err ("pcap_setup - Extra garbage on specification : '%s'\n" , + remain);return 0 ; }
@@ -85,8 +85,7 @@ int pcap_setup(char *str, char **mac_out, void *data)else if (!strcmp (options[i],"nooptimize" )) init->optimize =0 ;else { -printk (KERN_ERR "pcap_setup : bad option - '%s'\n" , - options[i]); +pr_err ("pcap_setup : bad option - '%s'\n" , options[i]);return 0 ; } }
arch/um/drivers/pcap_user.c +9 -10
@@ -22,8 +22,8 @@ static int pcap_user_init(void *data, void *dev) p =pcap_open_live (pri->host_if,ETH_MAX_PACKET +ETH_HEADER_OTHER , pri->promisc,0 , errors);if (p ==NULL ) { -printk (KERN_ERR "pcap_user_init : pcap_open_live failed - " -"'%s'\n" , errors); +pr_err ("pcap_user_init : pcap_open_live failed - '%s'\n" , + errors);return -EINVAL ; }
@@ -44,14 +44,14 @@ static int pcap_open(void *data)if (pri->filter !=NULL ) { err =dev_netmask (pri->dev, &netmask);if (err <0 ) { -printk (KERN_ERR "pcap_open : dev_netmask failed\n" ); +pr_err ("pcap_open : dev_netmask failed\n" );return -EIO ; } pri->compiled =uml_kmalloc (sizeof (struct bpf_program ),UM_GFP_KERNEL );if (pri->compiled ==NULL ) { -printk (KERN_ERR "pcap_open : kmalloc failed\n" ); +pr_err ("pcap_open : kmalloc failed\n" );return -ENOMEM ; }
@@ -59,15 +59,15 @@ static int pcap_open(void *data) (struct bpf_program *) pri->compiled, pri->filter, pri->optimize, netmask);if (err <0 ) { -printk (KERN_ERR "pcap_open : pcap_compile failed - " -"'%s'\n" ,pcap_geterr (pri->pcap)); +pr_err ("pcap_open : pcap_compile failed - '%s'\n" , +pcap_geterr (pri->pcap)); goto out; } err =pcap_setfilter (pri->pcap, pri->compiled);if (err <0 ) { -printk (KERN_ERR "pcap_open : pcap_setfilter " -"failed - '%s'\n" ,pcap_geterr (pri->pcap)); +pr_err ("pcap_open : pcap_setfilter failed - '%s'\n" , +pcap_geterr (pri->pcap)); goto out; } }
@@ -116,8 +116,7 @@ int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri) n =pcap_dispatch (pri->pcap,1 , handler, (u_char *) &hdata);if (n <0 ) { -printk (KERN_ERR "pcap_dispatch failed - %s\n" , -pcap_geterr (pri->pcap)); +pr_err ("pcap_dispatch failed - %s\n" ,pcap_geterr (pri->pcap));return -EIO ; }else if (n ==0 )
arch/um/drivers/port_kern.c +10 -13
@@ -52,8 +52,7 @@ static irqreturn_t pipe_interrupt(int irq, void *data)if (fd == -EAGAIN )return IRQ_NONE ; -printk (KERN_ERR "pipe_interrupt : os_rcv_fd returned %d\n" , - -fd); +pr_err ("pipe_interrupt : os_rcv_fd returned %d\n" , -fd);os_close_file (conn->fd); }
@@ -81,15 +80,14 @@ static int port_accept(struct port_list *port) fd =port_connection (port->fd, socket, &pid);if (fd <0 ) {if (fd != -EAGAIN ) -printk (KERN_ERR "port_accept : port_connection " -"returned %d\n" , -fd); +pr_err ("port_accept : port_connection returned %d\n" , + -fd); goto out; } conn =kmalloc (sizeof (*conn),GFP_ATOMIC );if (conn ==NULL ) { -printk (KERN_ERR "port_accept : failed to allocate " -"connection\n" ); +pr_err ("port_accept : failed to allocate connection\n" ); goto out_close; } *conn = ((struct connection)
@@ -101,14 +99,13 @@ static int port_accept(struct port_list *port)if (um_request_irq (TELNETD_IRQ , socket[0 ],IRQ_READ , pipe_interrupt,IRQF_SHARED ,"telnetd" , conn)) { -printk (KERN_ERR "port_accept : failed to get IRQ for " -"telnetd\n" ); +pr_err ("port_accept : failed to get IRQ for telnetd\n" ); goto out_free; }if (atomic_read (&port->wait_count) ==0 ) {os_write_file (fd,NO_WAITER_MSG ,sizeof (NO_WAITER_MSG )); -printk (KERN_ERR "No one waiting for port\n" ); +pr_err ("No one waiting for port\n" ); }list_add (&conn->list, &port->pending);return 1 ;
@@ -171,20 +168,20 @@ void *port_data(int port_num) } port =kmalloc (sizeof (struct port_list ),GFP_KERNEL );if (port ==NULL ) { -printk (KERN_ERR "Allocation of port list failed\n" ); +pr_err ("Allocation of port list failed\n" ); goto out; } fd =port_listen_fd (port_num);if (fd <0 ) { -printk (KERN_ERR "binding to port %d failed, errno = %d\n" , +pr_err ("binding to port %d failed, errno = %d\n" , port_num, -fd); goto out_free; }if (um_request_irq (ACCEPT_IRQ , fd,IRQ_READ , port_interrupt,IRQF_SHARED ,"port" , port)) { -printk (KERN_ERR "Failed to get IRQ for port %d\n" , port_num); +pr_err ("Failed to get IRQ for port %d\n" , port_num); goto out_close; }
@@ -203,7 +200,7 @@ void *port_data(int port_num) found: dev =kmalloc (sizeof (struct port_dev ),GFP_KERNEL );if (dev ==NULL ) { -printk (KERN_ERR "Allocation of port device entry failed\n" ); +pr_err ("Allocation of port device entry failed\n" ); goto out; }
arch/um/drivers/port_user.c +2 -4
@@ -29,15 +29,13 @@ static void *port_init(char *str, int device, const struct chan_opts *opts)int port;if (*str !=':' ) { -printk (KERN_ERR "port_init : channel type 'port' must " -"specify a port number\n" ); +pr_err ("port_init : channel type 'port' must specify a port number\n" );return NULL ; } str++; port =strtoul (str, &end,0 );if ((*end !='\0' ) || (end == str)) { -printk (KERN_ERR "port_init : couldn't parse port '%s'\n" , - str); +pr_err ("port_init : couldn't parse port '%s'\n" , str);return NULL ; }
arch/um/drivers/pty.c +2 -2
@@ -47,7 +47,7 @@ static int pts_open(int input, int output, int primary, void *d, fd =get_pty ();if (fd <0 ) { err = -errno; -printk (KERN_ERR "open_pts : Failed to open pts\n" ); +pr_err ("open_pts : Failed to open pts\n" );return err; }
@@ -106,7 +106,7 @@ static int getmaster(char *line) } } -printk (KERN_ERR "getmaster - no usable host pty devices\n" ); +pr_err ("getmaster - no usable host pty devices\n" );return -ENOENT ; }
arch/um/drivers/slip_user.c +11 -18
@@ -30,8 +30,7 @@ static int set_up_tty(int fd)struct termios tios;if (tcgetattr (fd, &tios) <0 ) { -printk (KERN_ERR "could not get initial terminal " -"attributes\n" ); +pr_err ("could not get initial terminal attributes\n" );return -1 ; }
@@ -48,7 +47,7 @@ static int set_up_tty(int fd)cfsetispeed (&tios,B38400 );if (tcsetattr (fd,TCSAFLUSH , &tios) <0 ) { -printk (KERN_ERR "failed to set terminal attributes\n" ); +pr_err ("failed to set terminal attributes\n" );return -1 ; }return 0 ;
@@ -79,8 +78,7 @@ static int slip_tramp(char **argv, int fd) err =os_pipe (fds,1 ,0 );if (err <0 ) { -printk (KERN_ERR "slip_tramp : pipe failed, err = %d\n" , - -err); +pr_err ("slip_tramp : pipe failed, err = %d\n" , -err); goto out; }
@@ -96,8 +94,7 @@ static int slip_tramp(char **argv, int fd) output_len =UM_KERN_PAGE_SIZE ; output =uml_kmalloc (output_len,UM_GFP_KERNEL );if (output ==NULL ) { -printk (KERN_ERR "slip_tramp : failed to allocate output " -"buffer\n" ); +pr_err ("slip_tramp : failed to allocate output buffer\n" );os_kill_process (pid,1 ); err = -ENOMEM ; goto out_close;
@@ -131,16 +128,14 @@ static int slip_open(void *data) err =get_pty ();if (err <0 ) { -printk (KERN_ERR "slip-open : Failed to open pty, err = %d\n" , - -err); +pr_err ("slip-open : Failed to open pty, err = %d\n" , -err); goto out; } mfd = err; err =open (ptsname (mfd),O_RDWR ,0 );if (err <0 ) { -printk (KERN_ERR "Couldn't open tty for slip line, " -"err = %d\n" , -err); +pr_err ("Couldn't open tty for slip line, err = %d\n" , -err); goto out_close; } sfd = err;
@@ -158,14 +153,12 @@ static int slip_open(void *data) err =slip_tramp (argv, sfd);if (err <0 ) { -printk (KERN_ERR "slip_tramp failed - err = %d\n" , - -err); +pr_err ("slip_tramp failed - err = %d\n" , -err); goto out_close2; } err =os_get_ifname (pri->slave, pri->name);if (err <0 ) { -printk (KERN_ERR "get_ifname failed, err = %d\n" , - -err); +pr_err ("get_ifname failed, err = %d\n" , -err); goto out_close2; }iter_addresses (pri->dev, open_addr, pri->name);
@@ -173,8 +166,8 @@ static int slip_open(void *data)else { err =os_set_slip (sfd);if (err <0 ) { -printk (KERN_ERR "Failed to set slip discipline " -"encapsulation - err = %d\n" , -err); +pr_err ("Failed to set slip discipline encapsulation - err = %d\n" , + -err); goto out_close2; } }
@@ -203,7 +196,7 @@ static void slip_close(int fd, void *data) err =slip_tramp (argv, pri->slave);if (err !=0 ) -printk (KERN_ERR "slip_tramp failed - errno = %d\n" , -err); +pr_err ("slip_tramp failed - errno = %d\n" , -err);close (fd);close (pri->slave); pri->slave =-1 ;
arch/um/drivers/slirp_kern.c +1 -2
@@ -82,8 +82,7 @@ static int slirp_setup(char *str, char **mac_out, void *data) do { if (i >= SLIRP_MAX_ARGS - 1) { - printk(KERN_WARNING "slirp_setup: truncating slirp " - "arguments\n"); + pr_warn("slirp_setup: truncating slirp arguments\n"); break; } init->argw.argv[i++] = str;
arch/um/drivers/slirp_user.c +4 -5
@@ -57,7 +57,7 @@ static int slirp_open(void *data) err =slirp_tramp (pri->argw.argv, fds[1 ]);if (err <0 ) { -printk (KERN_ERR "slirp_tramp failed - errno = %d\n" , -err); +pr_err ("slirp_tramp failed - errno = %d\n" , -err); goto out; } pid = err;
@@ -85,15 +85,14 @@ static void slirp_close(int fd, void *data) pri->slave =-1 ;if (pri->pid<1 ) { -printk (KERN_ERR "slirp_close: no child process to shut " -"down\n" ); +pr_err ("slirp_close: no child process to shut down\n" );return ; }#if 0 if (kill (pri->pid,SIGHUP )<0 ) { -printk (KERN_ERR "slirp_close: sending hangup to %d failed " -"(%d)\n" , pri->pid, errno); +pr_err ("slirp_close: sending hangup to %d failed (%d)\n" , + pri->pid, errno); }#endif err =helper_wait (pri->pid);
arch/um/drivers/ssl.c +4 -6
@@ -24,8 +24,7 @@ static const int ssl_version = 1;static void ssl_announce (char *dev_name,int dev) { -printk (KERN_INFO "Serial line %d assigned device '%s'\n" , dev, - dev_name); +pr_info ("Serial line %d assigned device '%s'\n" , dev, dev_name); }/* Almost const, except that xterm_title may be changed in an initcall */
@@ -153,8 +152,7 @@ static int ssl_init(void)int err;int i; -printk (KERN_INFO "Initializing software serial port version %d\n" , - ssl_version); +pr_info ("Initializing software serial port version %d\n" , ssl_version); err =register_lines (&driver, &ssl_ops, serial_lines,ARRAY_SIZE (serial_lines));
@@ -171,8 +169,8 @@ static int ssl_init(void)if (!s) s = def_conf;if (setup_one_line (serial_lines, i, s, &opts, &error)) -printk (KERN_ERR "setup_one_line failed for " -"device %d : %s\n" , i, error); +pr_err ("setup_one_line failed for device %d : %s\n" , + i, error); } ssl_init_done =1 ;
arch/um/drivers/stdio_console.c +4 -5
@@ -29,8 +29,7 @@static void stdio_announce (char *dev_name,int dev) { -printk (KERN_INFO "Virtual console %d assigned device '%s'\n" , dev, - dev_name); +pr_info ("Virtual console %d assigned device '%s'\n" , dev, dev_name); }/* Almost const, except that xterm_title may be changed in an initcall */
@@ -158,7 +157,7 @@ static int stdio_init(void)if (err)return err; -printk (KERN_INFO "Initialized stdio console driver\n" ); +pr_info ("Initialized stdio console driver\n" ); new_title =add_xterm_umid (opts.xterm_title);if (new_title !=NULL )
@@ -172,8 +171,8 @@ static int stdio_init(void)if (!s) s = i ?CONFIG_CON_CHAN :CONFIG_CON_ZERO_CHAN ;if (setup_one_line (vts, i, s, &opts, &error)) -printk (KERN_ERR "setup_one_line failed for " -"device %d : %s\n" , i, error); +pr_err ("setup_one_line failed for device %d : %s\n" , + i, error); } con_init_done =1 ;
arch/um/drivers/tty.c +1 -2
@@ -21,8 +21,7 @@ static void *tty_chan_init(char *str, int device, const struct chan_opts *opts)struct tty_chan *data;if (*str !=':' ) { -printk (KERN_ERR "tty_init : channel type 'tty' must specify " -"a device\n" ); +pr_err ("tty_init : channel type 'tty' must specify a device\n" );return NULL ; } str++;
arch/um/drivers/ubd_kern.c +46 -54
262 lines not on this page · raw message
arch/um/drivers/umcast_kern.c +18 -20
@@ -40,11 +40,11 @@ static void umcast_init(struct net_device *dev, void *data) dpri->dev = dev;if (dpri->unicast) { -printk (KERN_INFO "ucast backend address: %s:%u listen port: " -"%u\n" , dpri->addr, dpri->rport, dpri->lport); +pr_info ("ucast backend address: %s:%u listen port: %u\n" , + dpri->addr, dpri->rport, dpri->lport); }else { -printk (KERN_INFO "mcast backend multicast address: %s:%u, " -"TTL:%u\n" , dpri->addr, dpri->lport, dpri->ttl); +pr_info ("mcast backend multicast address: %s:%u, TTL:%u\n" , + dpri->addr, dpri->lport, dpri->ttl); } }
@@ -81,16 +81,15 @@ static int mcast_setup(char *str, char **mac_out, void *data) remain =split_if_spec (str, mac_out, &init->addr, &port_str, &ttl_str,NULL );if (remain !=NULL ) { -printk (KERN_ERR "mcast_setup - Extra garbage on " -"specification : '%s'\n" , remain); +pr_err ("mcast_setup - Extra garbage on specification : '%s'\n" , + remain);return 0 ; }if (port_str !=NULL ) { init->lport =simple_strtoul (port_str, &last,10 );if ((*last !='\0' ) || (last == port_str)) { -printk (KERN_ERR "mcast_setup - Bad port : '%s'\n" , - port_str); +pr_err ("mcast_setup - Bad port : '%s'\n" , port_str);return 0 ; } }
@@ -98,8 +97,7 @@ static int mcast_setup(char *str, char **mac_out, void *data)if (ttl_str !=NULL ) { init->ttl =simple_strtoul (ttl_str, &last,10 );if ((*last !='\0' ) || (last == ttl_str)) { -printk (KERN_ERR "mcast_setup - Bad ttl : '%s'\n" , - ttl_str); +pr_err ("mcast_setup - Bad ttl : '%s'\n" , ttl_str);return 0 ; } }
@@ -107,8 +105,8 @@ static int mcast_setup(char *str, char **mac_out, void *data) init->unicast = false; init->rport = init->lport; -printk (KERN_INFO "Configured mcast device: %s:%u-%u\n" , init->addr, - init->lport, init->ttl); +pr_info ("Configured mcast device: %s:%u-%u\n" , + init->addr, init->lport, init->ttl);return 1 ; }
@@ -127,16 +125,16 @@ static int ucast_setup(char *str, char **mac_out, void *data) remain =split_if_spec (str, mac_out, &init->addr, &lport_str, &rport_str,NULL );if (remain !=NULL ) { -printk (KERN_ERR "ucast_setup - Extra garbage on " -"specification : '%s'\n" , remain); +pr_err ("ucast_setup - Extra garbage on specification : '%s'\n" , + remain);return 0 ; }if (lport_str !=NULL ) { init->lport =simple_strtoul (lport_str, &last,10 );if ((*last !='\0' ) || (last == lport_str)) { -printk (KERN_ERR "ucast_setup - Bad listen port : " -"'%s'\n" , lport_str); +pr_err ("ucast_setup - Bad listen port : '%s'\n" , + lport_str);return 0 ; } }
@@ -144,16 +142,16 @@ static int ucast_setup(char *str, char **mac_out, void *data)if (rport_str !=NULL ) { init->rport =simple_strtoul (rport_str, &last,10 );if ((*last !='\0' ) || (last == rport_str)) { -printk (KERN_ERR "ucast_setup - Bad remote port : " -"'%s'\n" , rport_str); +pr_err ("ucast_setup - Bad remote port : '%s'\n" , + rport_str);return 0 ; } } init->unicast = true; -printk (KERN_INFO "Configured ucast device: :%u -> %s:%u\n" , - init->lport, init->addr, init->rport); +pr_info ("Configured ucast device: :%u -> %s:%u\n" , + init->lport, init->addr, init->rport);return 1 ; }
arch/um/drivers/umcast_user.c +14 -21
@@ -25,8 +25,7 @@ static struct sockaddr_in *new_addr(char *addr, unsigned short port) sin =uml_kmalloc (sizeof (struct sockaddr_in ),UM_GFP_KERNEL );if (sin ==NULL ) { -printk (KERN_ERR "new_addr: allocation of sockaddr_in " -"failed\n" ); +pr_err ("new_addr: allocation of sockaddr_in failed\n" );return NULL ; } sin->sin_family =AF_INET ;
@@ -79,15 +78,13 @@ static int umcast_open(void *data)if (fd <0 ) { err = -errno; -printk (KERN_ERR "umcast_open : data socket failed, " -"errno = %d\n" , errno); +pr_err ("umcast_open : data socket failed, errno = %d\n" , errno); goto out; }if (setsockopt (fd,SOL_SOCKET ,SO_REUSEADDR , &yes,sizeof (yes)) <0 ) { err = -errno; -printk (KERN_ERR "umcast_open: SO_REUSEADDR failed, " -"errno = %d\n" , errno); +pr_err ("umcast_open: SO_REUSEADDR failed, errno = %d\n" , errno); goto out_close; }
@@ -96,8 +93,8 @@ static int umcast_open(void *data)if (setsockopt (fd,SOL_IP ,IP_MULTICAST_TTL , &pri->ttl,sizeof (pri->ttl)) <0 ) { err = -errno; -printk (KERN_ERR "umcast_open: IP_MULTICAST_TTL " -"failed, error = %d\n" , errno); +pr_err ("umcast_open: IP_MULTICAST_TTL failed, error = %d\n" , + errno); goto out_close; }
@@ -105,8 +102,8 @@ static int umcast_open(void *data)if (setsockopt (fd,SOL_IP ,IP_MULTICAST_LOOP , &yes,sizeof (yes)) <0 ) { err = -errno; -printk (KERN_ERR "umcast_open: IP_MULTICAST_LOOP " -"failed, error = %d\n" , errno); +pr_err ("umcast_open: IP_MULTICAST_LOOP failed, error = %d\n" , + errno); goto out_close; } }
@@ -114,8 +111,7 @@ static int umcast_open(void *data)/* bind socket to the address */ if (bind (fd, (struct sockaddr *) lsin,sizeof (*lsin)) <0 ) { err = -errno; -printk (KERN_ERR "umcast_open : data bind failed, " -"errno = %d\n" , errno); +pr_err ("umcast_open : data bind failed, errno = %d\n" , errno); goto out_close; }
@@ -126,13 +122,10 @@ static int umcast_open(void *data)if (setsockopt (fd,SOL_IP ,IP_ADD_MEMBERSHIP , &mreq,sizeof (mreq)) <0 ) { err = -errno; -printk (KERN_ERR "umcast_open: IP_ADD_MEMBERSHIP " -"failed, error = %d\n" , errno); -printk (KERN_ERR "There appears not to be a " -"multicast-capable network interface on the " -"host.\n" ); -printk (KERN_ERR "eth0 should be configured in order " -"to use the multicast transport.\n" ); +pr_err ("umcast_open: IP_ADD_MEMBERSHIP failed, error = %d\n" , + errno); +pr_err ("There appears not to be a multicast-capable network interface on the host\n" ); +pr_err ("eth0 should be configured in order to use the multicast transport\n" ); goto out_close; } }
@@ -157,8 +150,8 @@ static void umcast_close(int fd, void *data) mreq.imr_interface.s_addr =0 ;if (setsockopt (fd,SOL_IP ,IP_DROP_MEMBERSHIP , &mreq,sizeof (mreq)) <0 ) { -printk (KERN_ERR "umcast_close: IP_DROP_MEMBERSHIP " -"failed, error = %d\n" , errno); +pr_err ("umcast_close: IP_DROP_MEMBERSHIP failed, error = %d\n" , + errno); } }
arch/um/drivers/vde_kern.c +7 -10
@@ -44,7 +44,7 @@ static int vde_read(int fd, struct sk_buff *skb, struct uml_net_private *lp)return vde_user_read (pri->conn,skb_mac_header (skb), skb->dev->mtu +ETH_HEADER_OTHER ); -printk (KERN_ERR "vde_read - we have no VDECONN to read from" ); +pr_err ("vde_read - we have no VDECONN to read from\nx" );return -EBADF ; }
@@ -56,7 +56,7 @@ static int vde_write(int fd, struct sk_buff *skb, struct uml_net_private *lp)return vde_user_write ((void *)pri->conn, skb->data, skb->len); -printk (KERN_ERR "vde_write - we have no VDECONN to write to" ); +pr_err ("vde_write - we have no VDECONN to write to\n" );return -EBADF ; }
@@ -83,14 +83,12 @@ static int vde_setup(char *str, char **mac_out, void *data) &init->group, &mode_str, &init->descr, NULL);if (remain !=NULL ) -printk (KERN_WARNING "vde_setup - Ignoring extra data :" -"'%s'\n" , remain); +pr_warn ("vde_setup - Ignoring extra data :'%s'\n" , remain);if (port_str !=NULL ) { init->port =simple_strtoul (port_str, &last,10 );if ((*last !='\0' ) || (last == port_str)) { -printk (KERN_ERR "vde_setup - Bad port : '%s'\n" , - port_str); +pr_err ("vde_setup - Bad port : '%s'\n" , port_str);return 0 ; } }
@@ -98,14 +96,13 @@ static int vde_setup(char *str, char **mac_out, void *data)if (mode_str !=NULL ) { init->mode =simple_strtoul (mode_str, &last,8 );if ((*last !='\0' ) || (last == mode_str)) { -printk (KERN_ERR "vde_setup - Bad mode : '%s'\n" , - mode_str); +pr_err ("vde_setup - Bad mode : '%s'\n" , mode_str);return 0 ; } } -printk (KERN_INFO "Configured vde device: %s\n" , init->vde_switch ? - init->vde_switch :"(default socket)" ); +pr_info ("Configured vde device: %s\n" , + init->vde_switch ? init->vde_switch :"(default socket)" );return 1 ; }
arch/um/drivers/vde_user.c +6 -8
@@ -22,12 +22,11 @@ static int vde_user_init(void *data, void *dev)if (conn ==NULL ) { err = -errno; -printk (KERN_ERR "vde_user_init: vde_open failed, " -"errno = %d\n" , errno); +pr_err ("vde_user_init: vde_open failed, errno = %d\n" , errno);return err; } -printk (KERN_INFO "vde backend - connection opened\n" ); +pr_info ("vde backend - connection opened\n" ); pri->conn = conn;
@@ -41,7 +40,7 @@ static int vde_user_open(void *data)if (pri->conn !=NULL )return vde_datafd (pri->conn); -printk (KERN_WARNING "vde_open - we have no VDECONN to open" ); +pr_warn ("vde_open - we have no VDECONN to open\n" );return -EINVAL ; }
@@ -50,7 +49,7 @@ static void vde_remove(void *data)struct vde_data *pri = data;if (pri->conn !=NULL ) { -printk (KERN_INFO "vde backend - closing connection\n" ); +pr_info ("vde backend - closing connection\n" );vde_close (pri->conn); pri->conn =NULL ;kfree (pri->args);
@@ -58,7 +57,7 @@ static void vde_remove(void *data)return ; } -printk (KERN_WARNING "vde_remove - we have no VDECONN to remove" ); +pr_warn ("vde_remove - we have no VDECONN to remove\n" ); }const struct net_user_info vde_user_info = {
@@ -78,8 +77,7 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) vpri->args =uml_kmalloc (sizeof (struct vde_open_args ),UM_GFP_KERNEL );if (vpri->args ==NULL ) { -printk (KERN_ERR "vde_init_libstuff - vde_open_args " -"allocation failed" ); +pr_err ("vde_init_libstuff - vde_open_args allocation failed\n" );return ; }
arch/um/drivers/xterm.c +11 -15
@@ -99,7 +99,7 @@ static int xterm_open(int input, int output, int primary, void *d,* will work but w/o it we can be pretty sure it won't. */ if (getenv ("DISPLAY" ) ==NULL ) { -printk (KERN_ERR "xterm_open: $DISPLAY not set.\n" ); +pr_err ("xterm_open: $DISPLAY not set\n" );return -ENODEV ; }
@@ -112,15 +112,13 @@ static int xterm_open(int input, int output, int primary, void *d, fd =mkstemp (file);if (fd <0 ) { err = -errno; -printk (KERN_ERR "xterm_open : mkstemp failed, errno = %d\n" , - errno); +pr_err ("xterm_open : mkstemp failed, errno = %d\n" , errno);return err; }if (unlink (file)) { err = -errno; -printk (KERN_ERR "xterm_open : unlink failed, errno = %d\n" , - errno); +pr_err ("xterm_open : unlink failed, errno = %d\n" , errno);close (fd);return err; }
@@ -128,8 +126,8 @@ static int xterm_open(int input, int output, int primary, void *d, fd =os_create_unix_socket (file,sizeof (file),1 );if (fd <0 ) { -printk (KERN_ERR "xterm_open : create_unix_socket failed, " -"errno = %d\n" , -fd); +pr_err ("xterm_open : create_unix_socket failed, errno = %d\n" , + -fd);return fd; }
@@ -137,30 +135,28 @@ static int xterm_open(int input, int output, int primary, void *d, pid =run_helper (NULL ,NULL , argv);if (pid <0 ) { err = pid; -printk (KERN_ERR "xterm_open : run_helper failed, " -"errno = %d\n" , -err); +pr_err ("xterm_open : run_helper failed, errno = %d\n" , -err); goto out_close1; } err =os_set_fd_block (fd,0 );if (err <0 ) { -printk (KERN_ERR "xterm_open : failed to set descriptor " -"non-blocking, err = %d\n" , -err); +pr_err ("xterm_open : failed to set descriptor non-blocking, err = %d\n" , + -err); goto out_kill; } new =xterm_fd (fd, &data->helper_pid);if (new <0 ) { err = new; -printk (KERN_ERR "xterm_open : os_rcv_fd failed, err = %d\n" , - -err); +pr_err ("xterm_open : os_rcv_fd failed, err = %d\n" , -err); goto out_kill; } err =os_set_fd_block (new,0 );if (err) { -printk (KERN_ERR "xterm_open : failed to set xterm " -"descriptor non-blocking, err = %d\n" , -err); +pr_err ("xterm_open : failed to set xterm descriptor non-blocking, err = %d\n" , + -err); goto out_close2; }
arch/um/drivers/xterm_kern.c +3 -3
@@ -39,7 +39,7 @@ int xterm_fd(int socket, int *pid_out) data =kmalloc (sizeof (*data),GFP_KERNEL );if (data ==NULL ) { -printk (KERN_ERR "xterm_fd : failed to allocate xterm_wait\n" ); +pr_err ("xterm_fd : failed to allocate xterm_wait\n" );return -ENOMEM ; }
@@ -52,8 +52,8 @@ int xterm_fd(int socket, int *pid_out) err =um_request_irq (XTERM_IRQ , socket,IRQ_READ , xterm_interrupt,IRQF_SHARED ,"xterm" , data);if (err) { -printk (KERN_ERR "xterm_fd : failed to get IRQ for xterm, " -"err = %d\n" , err); +pr_err ("xterm_fd : failed to get IRQ for xterm, err = %d\n" , + err); ret = err; goto out; }
arch/um/kernel/exec.c +2 -2
@@ -28,8 +28,8 @@ void flush_thread(void) ret = ret ||unmap (¤t->mm->context.id,STUB_END , host_task_size -STUB_END ,1 , &data);if (ret) { -printk (KERN_ERR "flush_thread - clearing address space failed, " -"err = %d\n" , ret); +pr_err ("flush_thread - clearing address space failed, err = %d\n" , + ret);force_sig (SIGKILL , current); } get_safe_registers(current_pt_regs()->regs.gp,
arch/um/kernel/exitcode.c +1 -2
@@ -70,8 +70,7 @@ static int make_proc_exitcode(void) ent =proc_create ("exitcode" ,0600 ,NULL , &exitcode_proc_fops);if (ent ==NULL ) { -printk (KERN_WARNING "make_proc_exitcode : Failed to register " -"/proc/exitcode\n" ); +pr_warn ("make_proc_exitcode : Failed to register /proc/exitcode\n" );return 0 ; }return 0 ;
arch/um/kernel/initrd.c +4 -6
@@ -32,7 +32,7 @@ static int __init read_initrd(void)* ask for no memory. */ if (size ==0 ) { -printk (KERN_ERR "\"%s\" is a zero-size initrd\n" , initrd); +pr_err ("\"%s\" is a zero-size initrd\n" , initrd);return 0 ; }
@@ -68,15 +68,13 @@ static int load_initrd(char *filename, void *buf, int size) fd =os_open_file (filename,of_read (OPENFLAGS ()),0 );if (fd <0 ) { -printk (KERN_ERR "Opening '%s' failed - err = %d\n" , filename, - -fd); +pr_err ("Opening '%s' failed - err = %d\n" , filename, -fd);return -1 ; } n =os_read_file (fd, buf, size);if (n != size) { -printk (KERN_ERR "Read of %d bytes from '%s' failed, " -"err = %d\n" , size, - filename, -n); +pr_err ("Read of %d bytes from '%s' failed, err = %d\n" , + size, filename, -n);return -1 ; }
arch/um/kernel/irq.c +6 -8
@@ -91,9 +91,9 @@ static int activate_fd(int irq, int fd, int type, void *dev_id)spin_lock_irqsave (&irq_lock, flags);for (irq_fd = active_fds; irq_fd !=NULL ; irq_fd = irq_fd->next) {if ((irq_fd->fd == fd) && (irq_fd->type == type)) { -printk (KERN_ERR "Registering fd %d twice\n" , fd); -printk (KERN_ERR "Irqs : %d, %d\n" , irq_fd->irq, irq); -printk (KERN_ERR "Ids : 0x%p, 0x%p\n" , irq_fd->id, +pr_err ("Registering fd %d twice\n" , fd); +pr_err ("Irqs : %d, %d\n" , irq_fd->irq, irq); +pr_err ("Ids : 0x%p, 0x%p\n" , irq_fd->id, dev_id); goto out_unlock; }
@@ -205,15 +205,13 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out) i++; }if (irq ==NULL ) { -printk (KERN_ERR "find_irq_by_fd doesn't have descriptor %d\n" , - fd); +pr_err ("find_irq_by_fd doesn't have descriptor %d\n" , fd); goto out; } fdi =os_get_pollfd (i);if ((fdi !=-1 ) && (fdi != fd)) { -printk (KERN_ERR "find_irq_by_fd - mismatch between active_fds " -"and pollfds, fd %d vs %d, need %d\n" , irq->fd, - fdi, fd); +pr_err ("find_irq_by_fd - mismatch between active_fds and pollfds, fd %d vs %d, need %d\n" , + irq->fd, fdi, fd); irq =NULL ; goto out; }
arch/um/kernel/physmem.c +7 -9
@@ -67,11 +67,9 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len, err =os_map_memory ((void *) virt, fd, offset, len, r, w, x);if (err) {if (err == -ENOMEM ) -printk (KERN_ERR "try increasing the host's " -"/proc/sys/vm/max_map_count to <physical " -"memory size>/4096\n" ); -panic ("map_memory(0x%lx, %d, 0x%llx, %ld, %d, %d, %d) failed, " -"err = %d\n" , virt, fd, offset, len, r, w, x, err); +pr_err ("try increasing the host's /proc/sys/vm/max_map_count to <physical memory size>/4096\n" ); +panic ("map_memory(0x%lx, %d, 0x%llx, %ld, %d, %d, %d) failed, err = %d\n" , + virt, fd, offset, len, r, w, x, err); } }
@@ -198,10 +196,10 @@ static int setup_iomem(void)while (region !=NULL ) { err =os_map_memory ((void *) iomem_start, region->fd,0 , region->size,1 ,1 ,0 ); -if (err) -printk (KERN_ERR "Mapping iomem region for driver '%s' " -"failed, errno = %d\n" , region->driver, -err); -else { +if (err) { +pr_err ("Mapping iomem region for driver '%s' failed, errno = %d\n" , + region->driver, -err); + }else { region->virt = iomem_start; region->phys =__pa (region->virt); }
arch/um/kernel/process.c +1 -1
@@ -334,7 +334,7 @@ int __init make_proc_sysemu(void)if (ent ==NULL ) { -printk (KERN_WARNING "Failed to register /proc/sysemu\n" ); +pr_warn ("Failed to register /proc/sysemu\n" );return 0 ; }
arch/um/kernel/sigio.c +2 -2
@@ -27,8 +27,8 @@ int write_sigio_irq(int fd) err =um_request_irq (SIGIO_WRITE_IRQ , fd,IRQ_READ , sigio_interrupt,0 ,"write sigio" ,NULL );if (err) { -printk (KERN_ERR "write_sigio_irq : um_request_irq failed, " -"err = %d\n" , err); +pr_err ("write_sigio_irq : um_request_irq failed, err = %d\n" , + err);return -1 ; } sigio_irq_fd = fd;
arch/um/kernel/skas/mmu.c +4 -5
@@ -74,8 +74,8 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm) ret =init_new_ldt (to_mm, from_mm);if (ret <0 ) { -printk (KERN_ERR "init_new_context_skas - init_ldt" -" failed, errno = %d\n" , ret); +pr_err ("init_new_context_skas - init_ldt failed, errno = %d\n" , + ret); goto out_free; }
@@ -110,7 +110,7 @@ void uml_setup_stubs(struct mm_struct *mm)VM_MAYEXEC |VM_DONTCOPY |VM_PFNMAP , mm->context.stub_pages);if (err) { -printk (KERN_ERR "install_special_mapping returned %d\n" , err); +pr_err ("install_special_mapping returned %d\n" , err); goto out; }return ;
@@ -145,8 +145,7 @@ void destroy_context(struct mm_struct *mm)* 1 cases, since they shouldn't happen either. */ if (mmu->id.u.pid <2 ) { -printk (KERN_ERR "corrupt mm_context - pid = %d\n" , - mmu->id.u.pid); +pr_err ("corrupt mm_context - pid = %d\n" , mmu->id.u.pid);return ; }os_kill_ptraced_process (mmu->id.u.pid,1 );
arch/um/kernel/smp.c +9 -9
@@ -44,13 +44,13 @@ void smp_send_stop(void) {int i; -printk (KERN_INFO "Stopping all CPUs..." ); +pr_info ("Stopping all CPUs..." );for (i =0 ; i <num_online_cpus (); i++) {if (i == current_thread->cpu)continue ;os_write_file (cpu_data[i].ipi_pipe[1 ],"S" ,1 ); } -printk (KERN_CONT "done\n" ); +pr_cont ("done\n" ); }static cpumask_t smp_commenced_mask =CPU_MASK_NONE ;
@@ -68,7 +68,7 @@ static int idle_proc(void *cpup)wmb ();if (cpu_test_and_set (cpu, cpu_callin_map)) { -printk (KERN_ERR "huh, CPU#%d already present??\n" , cpu); +pr_err ("huh, CPU#%d already present??\n" , cpu);BUG (); }
@@ -120,7 +120,7 @@ void smp_prepare_cpus(unsigned int maxcpus)os_set_fd_async (cpu_data[me].ipi_pipe[0 ]);for (cpu =1 ; cpu < ncpus; cpu++) { -printk (KERN_INFO "Booting processor %d...\n" , cpu); +pr_info ("Booting processor %d...\n" , cpu); idle =idle_thread (cpu);
@@ -130,8 +130,8 @@ void smp_prepare_cpus(unsigned int maxcpus)while (waittime-- && !cpu_isset (cpu, cpu_callin_map))cpu_relax (); -printk (KERN_INFO "%s\n" , -cpu_isset (cpu, cpu_calling_map) ?"done" :"failed" ); +pr_info ("%s\n" , +cpu_isset (cpu, cpu_calling_map) ?"done" :"failed" ); } }
@@ -150,7 +150,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)int setup_profiling_timer (unsigned int multiplier) { -printk (KERN_INFO "setup_profiling_timer\n" ); +pr_info ("setup_profiling_timer\n" );return 0 ; }
@@ -173,13 +173,13 @@ void IPI_handler(int cpu)break ;case 'S' : -printk (KERN_INFO "CPU#%d stopping\n" , cpu); +pr_info ("CPU#%d stopping\n" , cpu);while (1 )pause ();break ;default : -printk (KERN_ERR "CPU#%d received unknown IPI [%c]!\n" , +pr_err ("CPU#%d received unknown IPI [%c]!\n" , cpu, c);break ; }
arch/um/kernel/sysrq.c +10 -11
@@ -25,7 +25,7 @@ static void do_stack_trace(unsigned long *sp, unsigned long bp)unsigned long addr;struct stack_frame *frame = (struct stack_frame *)bp; -printk (KERN_INFO "Call Trace:\n" ); +pr_info ("Call Trace:\n" );while (((long ) sp & (THREAD_SIZE -1 )) !=0 ) { addr = *sp;if (__kernel_text_address (addr)) {
@@ -36,14 +36,14 @@ static void do_stack_trace(unsigned long *sp, unsigned long bp) reliable =1 ; } -printk (KERN_INFO " [<%08lx>]" , addr); -printk (KERN_CONT " %s" , reliable ?"" :"? " ); +pr_info (" [<%08lx>]" , addr); +pr_cont (" %s" , reliable ?"" :"? " );print_symbol (KERN_CONT "%s" , addr); -printk (KERN_CONT "\n" ); +pr_cont ("\n" ); } sp++; } -printk (KERN_INFO "\n" ); +pr_info ("\n" ); } static unsigned long get_frame_pointer(struct task_struct *task,
@@ -71,8 +71,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)int i;if (!segv_regs &&os_is_signal_stack ()) { -printk (KERN_ERR "Received SIGSEGV in SIGSEGV handler," -" aborting stack trace!\n" ); +pr_err ("Received SIGSEGV in SIGSEGV handler, aborting stack trace!\n" );return ; }
@@ -83,16 +82,16 @@ void show_stack(struct task_struct *task, unsigned long *stack)if (!stack) sp =get_stack_pointer (task, segv_regs); -printk (KERN_INFO "Stack:\n" ); +pr_info ("Stack:\n" ); stack = sp;for (i =0 ; i <3 *STACKSLOTS_PER_LINE ; i++) {if (kstack_end (stack))break ;if (i && ((i %STACKSLOTS_PER_LINE ) ==0 )) -printk (KERN_CONT "\n" ); -printk (KERN_CONT " %08lx" , *stack++); +pr_cont ("\n" ); +pr_cont (" %08lx" , *stack++); } -printk (KERN_CONT "\n" ); +pr_cont ("\n" );do_stack_trace (sp, bp); }
arch/um/kernel/time.c +3 -3
@@ -84,8 +84,8 @@ static void __init setup_itimer(void) err =request_irq (TIMER_IRQ , um_timer,0 ,"timer" ,NULL );if (err !=0 ) -printk (KERN_ERR "register_timer : request_irq failed - " -"errno = %d\n" , -err); +pr_err ("register_timer : request_irq failed - errno = %d\n" , + -err); itimer_clockevent.mult =div_sc (HZ ,NSEC_PER_SEC ,32 ); itimer_clockevent.max_delta_ns =
@@ -94,7 +94,7 @@ static void __init setup_itimer(void)clockevent_delta2ns (1 , &itimer_clockevent); err =clocksource_register_hz (&itimer_clocksource,USEC_PER_SEC );if (err) { -printk (KERN_ERR "clocksource_register_hz returned %d\n" , err); +pr_err ("clocksource_register_hz returned %d\n" , err);return ; }clockevents_register_device (&itimer_clockevent);
arch/um/kernel/tlb.c +3 -5
@@ -73,8 +73,7 @@ static int do_ops(struct host_vm_change *hvc, int end, finished, &hvc->data);break ;default : -printk (KERN_ERR "Unknown op type %d in do_ops\n" , - op->type); +pr_err ("Unknown op type %d in do_ops\n" , op->type);BUG ();break ; }
@@ -282,8 +281,7 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,/* This is not an else because ret is modified above */ if (ret) { -printk (KERN_ERR "fix_range_common: failed, killing current " -"process\n" ); +pr_err ("fix_range_common: failed, killing current process\n" );force_sig (SIGKILL , current); } }
@@ -434,7 +432,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long address)return ; kill: -printk (KERN_ERR "Failed to flush page for address 0x%lx\n" , address); +pr_err ("Failed to flush page for address 0x%lx\n" , address);force_sig (SIGKILL , current); }
arch/um/kernel/trap.c +4 -5
@@ -153,7 +153,7 @@ static void show_segv_info(struct uml_pt_regs *regs) fi->error_code);print_vma_addr (KERN_CONT " in " ,UPT_IP (regs)); -printk (KERN_CONT "\n" ); +pr_cont ("\n" ); }static void bad_segv (struct faultinfo fi,unsigned long ip)
@@ -280,8 +280,7 @@ void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs)if (!UPT_IS_USER (regs)) {if (sig ==SIGBUS ) -printk (KERN_ERR "Bus error - the host /dev/shm or /tmp " -"mount likely just ran out of space\n" ); +pr_err ("Bus error - the host /dev/shm or /tmp mount likely just ran out of space\n" );panic ("Kernel mode signal %d" , sig); }
@@ -305,8 +304,8 @@ void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs)#endif break ;default : -printk (KERN_ERR "Attempted to relay unknown signal %d (si_code = %d)\n" , - sig, si->si_code); +pr_err ("Attempted to relay unknown signal %d (si_code = %d)\n" , + sig, si->si_code); }force_sig_info (sig, &clean_si, current);
arch/um/os-Linux/aio.c +19 -26
113 lines not on this page · raw message
arch/um/os-Linux/drivers/ethertap_kern.c +4 -4
@@ -30,10 +30,10 @@ static void etap_init(struct net_device *dev, void *data) epri->control_fd =-1 ; epri->dev = dev; -printk (KERN_INFO "ethertap backend - %s" , epri->dev_name); +pr_info ("ethertap backend - %s" , epri->dev_name);if (epri->gate_addr !=NULL ) -printk (KERN_CONT ", IP = %s" , epri->gate_addr); -printk (KERN_CONT "\n" ); +pr_cont (", IP = %s" , epri->gate_addr); +pr_cont ("\n" ); }static int etap_read (int fd,struct sk_buff *skb,struct uml_net_private *lp)
@@ -74,7 +74,7 @@ int ethertap_setup(char *str, char **mac_out, void *data) &init->gate_addr))return 0 ;if (init->dev_name ==NULL ) { -printk (KERN_ERR "ethertap_setup : Missing tap device name\n" ); +pr_err ("ethertap_setup : Missing tap device name\n" );return 0 ; }
arch/um/os-Linux/drivers/ethertap_user.c +14 -18
@@ -45,15 +45,13 @@ static void etap_change(int op, unsigned char *addr, unsigned char *netmask,memcpy (change.netmask, netmask,sizeof (change.netmask));CATCH_EINTR (n =write (fd, &change,sizeof (change)));if (n !=sizeof (change)) { -printk (KERN_ERR "etap_change - request failed, err = %d\n" , - errno); +pr_err ("etap_change - request failed, err = %d\n" , errno);return ; } output =uml_kmalloc (UM_KERN_PAGE_SIZE ,UM_GFP_KERNEL );if (output ==NULL ) -printk (KERN_ERR "etap_change : Failed to allocate output " -"buffer\n" ); +pr_err ("etap_change : Failed to allocate output buffer\n" );read_output (fd, output,UM_KERN_PAGE_SIZE );if (output !=NULL ) {printk ("%s" , output);
@@ -123,12 +121,11 @@ static int etap_tramp(char *dev, char *gate, int control_me,CATCH_EINTR (n =read (control_me, &c,sizeof (c)));if (n !=sizeof (c)) { err = -errno; -printk (KERN_ERR "etap_tramp : read of status failed, " -"err = %d\n" , -err); +pr_err ("etap_tramp : read of status failed, err = %d\n" , -err);return err; }if (c !=1 ) { -printk (KERN_ERR "etap_tramp : uml_net failed\n" ); +pr_err ("etap_tramp : uml_net failed\n" ); err =helper_wait (pid); }return err;
@@ -147,16 +144,16 @@ static int etap_open(void *data) err =socketpair (AF_UNIX ,SOCK_DGRAM ,0 , data_fds);if (err) { err = -errno; -printk (KERN_ERR "etap_open - data socketpair failed - " -"err = %d\n" , errno); +pr_err ("etap_open - data socketpair failed - err = %d\n" , + errno);return err; } err =socketpair (AF_UNIX ,SOCK_STREAM ,0 , control_fds);if (err) { err = -errno; -printk (KERN_ERR "etap_open - control socketpair failed - " -"err = %d\n" , errno); +pr_err ("etap_open - control socketpair failed - err = %d\n" , + errno); goto out_close_data; }
@@ -167,15 +164,14 @@ static int etap_open(void *data)read_output (control_fds[0 ], output, output_len);if (output ==NULL ) -printk (KERN_ERR "etap_open : failed to allocate output " -"buffer\n" ); +pr_err ("etap_open : failed to allocate output buffer\n" );else {printk ("%s" , output);kfree (output); }if (err <0 ) { -printk (KERN_ERR "etap_tramp failed - err = %d\n" , -err); +pr_err ("etap_tramp failed - err = %d\n" , -err); goto out_close_control; }
@@ -201,12 +197,12 @@ static void etap_close(int fd, void *data)close (fd);if (shutdown (pri->data_fd,SHUT_RDWR ) <0 ) -printk (KERN_ERR "etap_close - shutdown data socket failed, " -"errno = %d\n" , errno); +pr_err ("etap_close - shutdown data socket failed, errno = %d\n" , + errno);if (shutdown (pri->control_fd,SHUT_RDWR ) <0 ) -printk (KERN_ERR "etap_close - shutdown control socket " -"failed, errno = %d\n" , errno); +pr_err ("etap_close - shutdown control socket failed, errno = %d\n" , + errno);close (pri->data_fd); pri->data_fd =-1 ;
arch/um/os-Linux/drivers/tuntap_kern.c +3 -3
@@ -29,10 +29,10 @@ static void tuntap_init(struct net_device *dev, void *data) tpri->fd =-1 ; tpri->dev = dev; -printk (KERN_INFO "TUN/TAP backend - " ); +pr_info ("TUN/TAP backend - " );if (tpri->gate_addr !=NULL ) -printk (KERN_CONT "IP = %s" , tpri->gate_addr); -printk (KERN_CONT "\n" ); +pr_cont ("IP = %s" , tpri->gate_addr); +pr_cont ("\n" ); }static int tuntap_read (int fd,struct sk_buff *skb,struct uml_net_private *lp)
arch/um/os-Linux/drivers/tuntap_user.c +10 -14
@@ -102,22 +102,20 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote, *used_out = n;if (n <0 ) { err = -errno; -printk (KERN_ERR "tuntap_open_tramp : recvmsg failed - " -"errno = %d\n" , errno); +pr_err ("tuntap_open_tramp : recvmsg failed - errno = %d\n" , + errno);return err; }helper_wait (pid); cmsg =CMSG_FIRSTHDR (&msg);if (cmsg ==NULL ) { -printk (KERN_ERR "tuntap_open_tramp : didn't receive a " -"message\n" ); +pr_err ("tuntap_open_tramp : didn't receive a message\n" );return -EINVAL ; }if ((cmsg->cmsg_level !=SOL_SOCKET ) || (cmsg->cmsg_type !=SCM_RIGHTS )) { -printk (KERN_ERR "tuntap_open_tramp : didn't receive a " -"descriptor\n" ); +pr_err ("tuntap_open_tramp : didn't receive a descriptor\n" );return -EINVAL ; } *fd_out = ((int *)CMSG_DATA (cmsg))[0 ];
@@ -140,8 +138,8 @@ static int tuntap_open(void *data) pri->fd =os_open_file ("/dev/net/tun" ,of_cloexec (of_rdwr (OPENFLAGS ())),0 );if (pri->fd <0 ) { -printk (KERN_ERR "Failed to open /dev/net/tun, " -"err = %d\n" , -pri->fd); +pr_err ("Failed to open /dev/net/tun, err = %d\n" , + -pri->fd);return pri->fd; }memset (&ifr,0 ,sizeof (ifr));
@@ -149,8 +147,7 @@ static int tuntap_open(void *data)strlcpy (ifr.ifr_name, pri->dev_name,sizeof (ifr.ifr_name));if (ioctl (pri->fd,TUNSETIFF , &ifr) <0 ) { err = -errno; -printk (KERN_ERR "TUNSETIFF failed, errno = %d\n" , - errno); +pr_err ("TUNSETIFF failed, errno = %d\n" , errno);close (pri->fd);return err; }
@@ -159,8 +156,8 @@ static int tuntap_open(void *data) err =socketpair (AF_UNIX ,SOCK_DGRAM ,0 , fds);if (err) { err = -errno; -printk (KERN_ERR "tuntap_open : socketpair failed - " -"errno = %d\n" , errno); +pr_err ("tuntap_open : socketpair failed - errno = %d\n" , + errno);return err; }
@@ -176,8 +173,7 @@ static int tuntap_open(void *data)if (err <0 ) {printk ("%s" , output);free_output_buffer (buffer); -printk (KERN_ERR "tuntap_open_tramp failed - " -"err = %d\n" , -err); +pr_err ("tuntap_open_tramp failed - err = %d\n" , -err);return err; }
arch/um/os-Linux/file.c +16 -21
@@ -288,8 +288,7 @@ int os_file_size(const char *file, unsigned long long *size_out) err =os_stat_file (file, &buf);if (err <0 ) { -printk (KERN_ERR "Couldn't stat \"%s\" : err = %d\n" , file, - -err); +pr_err ("Couldn't stat \"%s\" : err = %d\n" , file, -err);return err; }
@@ -300,14 +299,14 @@ int os_file_size(const char *file, unsigned long long *size_out) fd =open (file,O_RDONLY ,0 );if (fd <0 ) { err = -errno; -printk (KERN_ERR "Couldn't open \"%s\", " -"errno = %d\n" , file, errno); +pr_err ("Couldn't open \"%s\", errno = %d\n" , + file, errno);return err; }if (ioctl (fd,BLKGETSIZE , &blocks) <0 ) { err = -errno; -printk (KERN_ERR "Couldn't get the block size of " -"\"%s\", errno = %d\n" , file, errno); +pr_err ("Couldn't get the block size of \"%s\", errno = %d\n" , + file, errno);close (fd);return err; }
@@ -326,8 +325,7 @@ int os_file_modtime(const char *file, unsigned long *modtime) err =os_stat_file (file, &buf);if (err <0 ) { -printk (KERN_ERR "Couldn't stat \"%s\" : err = %d\n" , file, - -err); +pr_err ("Couldn't stat \"%s\" : err = %d\n" , file, -err);return err; }
@@ -368,8 +366,7 @@ int os_pipe(int *fds, int stream, int close_on_exec)return 0 ; error: -printk (KERN_ERR "os_pipe : Setting FD_CLOEXEC failed, err = %d\n" , - -err); +pr_err ("os_pipe : Setting FD_CLOEXEC failed, err = %d\n" , -err);close (fds[1 ]);close (fds[0 ]);return err;
@@ -386,16 +383,16 @@ int os_set_fd_async(int fd) flags |=O_ASYNC |O_NONBLOCK ;if (fcntl (fd,F_SETFL , flags) <0 ) { err = -errno; -printk (KERN_ERR "os_set_fd_async : failed to set O_ASYNC " -"and O_NONBLOCK on fd # %d, errno = %d\n" , fd, errno); +pr_err ("os_set_fd_async : failed to set O_ASYNC and O_NONBLOCK on fd # %d, errno = %d\n" , + fd, errno);return err; }if ((fcntl (fd,F_SETSIG ,SIGIO ) <0 ) || (fcntl (fd,F_SETOWN ,os_getpid ()) <0 )) { err = -errno; -printk (KERN_ERR "os_set_fd_async : Failed to fcntl F_SETOWN " -"(or F_SETSIG) fd %d, errno = %d\n" , fd, errno); +pr_err ("os_set_fd_async : Failed to fcntl F_SETOWN (or F_SETSIG) fd %d, errno = %d\n" , + fd, errno);return err; }
@@ -502,13 +499,12 @@ int os_rcv_fd(int fd, int *helper_pid_out) cmsg =CMSG_FIRSTHDR (&msg);if (cmsg ==NULL ) { -printk (KERN_ERR "rcv_fd didn't receive anything, " -"error = %d\n" , errno); +pr_err ("rcv_fd didn't receive anything, error = %d\n" , errno);return -1 ; }if ((cmsg->cmsg_level !=SOL_SOCKET ) || (cmsg->cmsg_type !=SCM_RIGHTS )) { -printk (KERN_ERR "rcv_fd didn't receive a descriptor\n" ); +pr_err ("rcv_fd didn't receive a descriptor\n" );return -1 ; }
@@ -528,8 +524,8 @@ int os_create_unix_socket(const char *file, int len, int close_on_exec)if (close_on_exec) { err =os_set_exec_close (sock);if (err <0 ) -printk (KERN_ERR "create_unix_socket : " -"close_on_exec failed, err = %d" , -err); +pr_err ("create_unix_socket : close_on_exec failed, err = %d\n" , + -err); } addr.sun_family =AF_UNIX ;
@@ -568,8 +564,7 @@ int os_lock_file(int fd, int excl) goto out; } -printk (KERN_ERR "F_SETLK failed, file already locked by pid %d\n" , - lock.l_pid); +pr_err ("F_SETLK failed, file already locked by pid %d\n" , lock.l_pid); err = save; out:return err;
arch/um/os-Linux/helper.c +15 -18
@@ -52,15 +52,14 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) ret =socketpair (AF_UNIX ,SOCK_STREAM ,0 , fds);if (ret <0 ) { ret = -errno; -printk (KERN_ERR "run_helper : pipe failed, errno = %d\n" , - errno); +pr_err ("run_helper : pipe failed, errno = %d\n" , errno); goto out_free; } ret =os_set_exec_close (fds[1 ]);if (ret <0 ) { -printk (KERN_ERR "run_helper : setting FD_CLOEXEC failed, " -"ret = %d\n" , -ret); +pr_err ("run_helper : setting FD_CLOEXEC failed, ret = %d\n" , + -ret); goto out_close; }
@@ -74,8 +73,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) pid =clone (helper_child, (void *) sp,CLONE_VM , &data);if (pid <0 ) { ret = -errno; -printk (KERN_ERR "run_helper : clone failed, errno = %d\n" , - errno); +pr_err ("run_helper : clone failed, errno = %d\n" , errno); goto out_free2; }
@@ -92,8 +90,8 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) }else {if (n <0 ) { n = -errno; -printk (KERN_ERR "run_helper : read on pipe failed, " -"ret = %d\n" , -n); +pr_err ("run_helper : read on pipe failed, ret = %d\n" , + -n); ret = n; }CATCH_EINTR (waitpid (pid,NULL , __WCLONE));
@@ -124,21 +122,20 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, pid =clone (proc, (void *) sp, flags, arg);if (pid <0 ) { err = -errno; -printk (KERN_ERR "run_helper_thread : clone failed, " -"errno = %d\n" , errno); +pr_err ("run_helper_thread : clone failed, errno = %d\n" , errno);return err; }if (stack_out ==NULL ) {CATCH_EINTR (pid =waitpid (pid, &status, __WCLONE));if (pid <0 ) { err = -errno; -printk (KERN_ERR "run_helper_thread - wait failed, " -"errno = %d\n" , errno); +pr_err ("run_helper_thread - wait failed, errno = %d\n" , + errno); pid = err; }if (!WIFEXITED (status) || (WEXITSTATUS (status) !=0 )) -printk (KERN_ERR "run_helper_thread - thread " -"returned status 0x%x\n" , status); +pr_err ("run_helper_thread - thread returned status 0x%x\n" , + status);free_stack (stack,0 ); }else *stack_out = stack;
@@ -152,12 +149,12 @@ int helper_wait(int pid)CATCH_EINTR (ret =waitpid (pid, &status, wflags));if (ret <0 ) { -printk (KERN_ERR "helper_wait : waitpid process %d failed, " -"errno = %d\n" , pid, errno); +pr_err ("helper_wait : waitpid process %d failed, errno = %d\n" , + pid, errno);return -errno; }else if (!WIFEXITED (status) ||WEXITSTATUS (status) !=0 ) { -printk (KERN_ERR "helper_wait : process %d exited with " -"status 0x%x\n" , pid, status); +pr_err ("helper_wait : process %d exited with status 0x%x\n" , + pid, status);return -ECHILD ; }else return 0 ;
arch/um/os-Linux/irq.c +3 -5
@@ -29,8 +29,8 @@ int os_waiting_for_events(struct irq_fd *active_fds)if (n <0 ) { err = -errno;if (errno !=EINTR ) -printk (KERN_ERR "os_waiting_for_events:" -" poll returned %d, errno = %d\n" , n, errno); +pr_err ("os_waiting_for_events: poll returned %d, errno = %d\n" , + n, errno);return err; }
@@ -88,9 +88,7 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,struct irq_fd *old_fd = *prev;if ((pollfds[i].fd !=-1 ) && (pollfds[i].fd != (*prev)->fd)) { -printk (KERN_ERR "os_free_irq_by_cb - " -"mismatch between active_fds and " -"pollfds, fd %d vs %d\n" , +pr_err ("os_free_irq_by_cb - mismatch between active_fds and pollfds, fd %d vs %d\n" , (*prev)->fd, pollfds[i].fd); goto out; }
arch/um/os-Linux/process.c +13 -18
@@ -32,14 +32,14 @@ unsigned long os_process_pc(int pid)sprintf (proc_stat,"/proc/%d/stat" , pid); fd =open (proc_stat,O_RDONLY ,0 );if (fd <0 ) { -printk (KERN_ERR "os_process_pc - couldn't open '%s', " -"errno = %d\n" , proc_stat, errno); +pr_err ("os_process_pc - couldn't open '%s', errno = %d\n" , + proc_stat, errno); goto out; }CATCH_EINTR (err =read (fd, buf,sizeof (buf)));if (err <0 ) { -printk (KERN_ERR "os_process_pc - couldn't read '%s', " -"err = %d\n" , proc_stat, errno); +pr_err ("os_process_pc - couldn't read '%s', err = %d\n" , + proc_stat, errno); goto out_close; }os_close_file (fd);
@@ -47,8 +47,7 @@ unsigned long os_process_pc(int pid)if (sscanf (buf,"%*d " COMM_SCANF " %*c %*d %*d %*d %*d %*d %*d %*d " "%*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d " "%*d %*d %*d %*d %*d %lu" , &pc) !=1 ) -printk (KERN_ERR "os_process_pc - couldn't find pc in '%s'\n" , - buf); +pr_err ("os_process_pc - couldn't find pc in '%s'\n" , buf); out_close:close (fd); out:
@@ -67,8 +66,7 @@ int os_process_parent(int pid)snprintf (stat,sizeof (stat),"/proc/%d/stat" , pid); fd =open (stat,O_RDONLY ,0 );if (fd <0 ) { -printk (KERN_ERR "Couldn't open '%s', errno = %d\n" , stat, - errno); +pr_err ("Couldn't open '%s', errno = %d\n" , stat, errno);return parent; }
@@ -76,15 +74,14 @@ int os_process_parent(int pid)close (fd);if (n <0 ) { -printk (KERN_ERR "Couldn't read '%s', errno = %d\n" , stat, - errno); +pr_err ("Couldn't read '%s', errno = %d\n" , stat, errno);return parent; } parent =FAILURE_PID ; n =sscanf (data,"%*d " COMM_SCANF " %*c %d" , &parent);if (n !=1 ) -printk (KERN_ERR "Failed to scan '%s'\n" , data); +pr_err ("Failed to scan '%s'\n" , data);return parent; }
@@ -185,28 +182,26 @@ int __init can_drop_memory(void)void *addr;int fd, ok =0 ; -printk (KERN_INFO "Checking host MADV_REMOVE support..." ); +pr_info ("Checking host MADV_REMOVE support..." ); fd =create_mem_file (UM_KERN_PAGE_SIZE );if (fd <0 ) { -printk (KERN_ERR "Creating test memory file failed, " -"err = %d\n" , -fd); +pr_err ("Creating test memory file failed, err = %d\n" , -fd); goto out; } addr =mmap64 (NULL ,UM_KERN_PAGE_SIZE ,PROT_READ |PROT_WRITE ,MAP_SHARED , fd,0 );if (addr ==MAP_FAILED ) { -printk (KERN_ERR "Mapping test memory file failed, " -"err = %d\n" , -errno); +pr_err ("Mapping test memory file failed, err = %d\n" , -errno); goto out_close; }if (madvise (addr,UM_KERN_PAGE_SIZE ,MADV_REMOVE ) !=0 ) { -printk (KERN_ERR "MADV_REMOVE failed, err = %d\n" , -errno); +pr_err ("MADV_REMOVE failed, err = %d\n" , -errno); goto out_unmap; } -printk (KERN_CONT "OK\n" ); +pr_cont ("OK\n" ); ok =1 ; out_unmap:
arch/um/os-Linux/sigio.c +35 -48
213 lines not on this page · raw message
arch/um/os-Linux/skas/mem.c +10 -13
@@ -55,9 +55,9 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) n =ptrace_setregs (pid, syscall_regs);if (n <0 ) { -printk (KERN_ERR "Registers - \n" ); +pr_err ("Registers -\n" );for (i =0 ; i <MAX_REG_NR ; i++) -printk (KERN_ERR "\t%d\t0x%lx\n" , i, syscall_regs[i]); +pr_err ("\t%d\t0x%lx\n" , i, syscall_regs[i]);panic ("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n" , -n); }
@@ -79,26 +79,23 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) offset = *((unsigned long *) mm_idp->stack +1 );if (offset) { data = (unsigned long *)(mm_idp->stack + offset -STUB_DATA ); -printk (KERN_ERR "do_syscall_stub : ret = %ld, offset = %ld, " -"data = %p\n" , ret, offset, data); +pr_err ("do_syscall_stub : ret = %ld, offset = %ld, data = %p\n" , + ret, offset, data); syscall = (unsigned long *)((unsigned long )data + data[0 ]); -printk (KERN_ERR "do_syscall_stub: syscall %ld failed, " -"return value = 0x%lx, expected return value = 0x%lx\n" , +pr_err ("do_syscall_stub: syscall %ld failed, return value = 0x%lx, expected return value = 0x%lx\n" , syscall[0 ], ret, syscall[7 ]); -printk (KERN_ERR " syscall parameters: " -"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n" , +pr_err (" syscall parameters: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n" , syscall[1 ], syscall[2 ], syscall[3 ], syscall[4 ], syscall[5 ], syscall[6 ]);for (n =1 ; n < data[0 ]/sizeof (long ); n++) {if (n ==1 ) -printk (KERN_ERR " additional syscall " -"data:" ); +pr_err (" additional syscall data:" );if (n %4 ==1 ) -printk ("\n" KERN_ERR " " ); -printk (" 0x%lx" , data[n]); +pr_err (" " ); +pr_cont (" 0x%lx" , data[n]); }if (n >1 ) -printk ("\n" ); +pr_cont ("\n" ); }else ret =0 ;
arch/um/os-Linux/skas/process.c +57 -68
137 lines not on this page · raw message
arch/um/os-Linux/umid.c +22 -26
48 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
Part of the diff is not shown here. View the raw message.
PATCH 4/4 UserModeLinux: Convert printks to pr_<level>
In reply to Joe PerchesUse a more current logging style.
Convert the remaining printks without a KERN_<PREFIX> to pr_<level> where appropriate.
There a few additional printks without a level that are emitted at KERN_DEFAULT for stack dumps and such.
Add printf format/argument verification to the static inline just in case.
--- arch/um/drivers/daemon_kern.c | 5 ++--- arch/um/drivers/harddog_kern.c | 4 +--- arch/um/drivers/harddog_user.c | 14 +++++++------- arch/um/drivers/pcap_kern.c | 2 +- arch/um/drivers/random.c | 3 +-- arch/um/drivers/slip_kern.c | 2 +- arch/um/drivers/slirp_kern.c | 6 +++--- arch/um/drivers/ubd_kern.c | 35 +++++++++++++++++------------------ arch/um/drivers/ubd_user.c | 6 +++--- arch/um/drivers/vde_kern.c | 6 +++--- arch/um/drivers/vde_user.c | 3 +-- arch/um/include/asm/pgtable-2level.h | 12 ++++++------ arch/um/include/asm/pgtable-3level.h | 18 +++++++++--------- arch/um/include/shared/user.h | 1 + 14 files changed, 56 insertions(+), 61 deletions(-)
arch/um/drivers/daemon_kern.c +2 -3
@@ -34,9 +34,8 @@ static void daemon_init(struct net_device *dev, void *data) dpri->data_addr =NULL ; dpri->local_addr =NULL ; -printk ("daemon backend (uml_switch version %d) - %s:%s" , -SWITCH_VERSION , dpri->sock_type, dpri->ctl_sock); -printk ("\n" ); +pr_info ("daemon backend (uml_switch version %d) - %s:%s\n" , +SWITCH_VERSION , dpri->sock_type, dpri->ctl_sock); }static int daemon_read (int fd,struct sk_buff *skb,struct uml_net_private *lp)
arch/um/drivers/harddog_kern.c +1 -3
@@ -176,8 +176,6 @@ static struct miscdevice harddog_miscdev = { .fops = &harddog_fops, }; -static char banner[]__initdata =KERN_INFO "UML Watchdog Timer\n" ; -static int __init harddog_init (void ) {int ret;
@@ -187,7 +185,7 @@ static int __init harddog_init(void)if (ret)return ret; -printk (banner); +pr_info ("UML Watchdog Timer\n" );return 0 ; }
arch/um/drivers/harddog_user.c +7 -7
@@ -39,13 +39,13 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock) err =os_pipe (in_fds,1 ,0 );if (err <0 ) { -printk ("harddog_open - os_pipe failed, err = %d\n" , -err); +pr_err ("harddog_open - os_pipe failed, err = %d\n" , -err); goto out; } err =os_pipe (out_fds,1 ,0 );if (err <0 ) { -printk ("harddog_open - os_pipe failed, err = %d\n" , -err); +pr_err ("harddog_open - os_pipe failed, err = %d\n" , -err); goto out_close_in; }
@@ -71,20 +71,20 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)if (pid <0 ) { err = -pid; -printk ("harddog_open - run_helper failed, errno = %d\n" , -err); +pr_err ("harddog_open - run_helper failed, errno = %d\n" , -err); goto out_close_out; } n =read (in_fds[0 ], &c,sizeof (c));if (n ==0 ) { -printk ("harddog_open - EOF on watchdog pipe\n" ); +pr_err ("harddog_open - EOF on watchdog pipe\n" );helper_wait (pid); err = -EIO ; goto out_close_out; }else if (n <0 ) { -printk ("harddog_open - read of watchdog pipe failed, " -"err = %d\n" , errno); +pr_err ("harddog_open - read of watchdog pipe failed, err = %d\n" , + errno);helper_wait (pid); err = n; goto out_close_out;
@@ -116,7 +116,7 @@ int ping_watchdog(int fd) n =write (fd, &c,sizeof (c));if (n !=sizeof (c)) { -printk ("ping_watchdog - write failed, ret = %d, err = %d\n" , +pr_err ("ping_watchdog - write failed, ret = %d, err = %d\n" , n, errno);if (n <0 )return n;
arch/um/drivers/pcap_kern.c +1 -1
@@ -28,7 +28,7 @@ void pcap_init(struct net_device *dev, void *data) ppri->optimize = init->optimize; ppri->filter = init->filter; -printk ("pcap backend, host interface %s\n" , ppri->host_if); +pr_info ("pcap backend, host interface %s\n" , ppri->host_if); }static int pcap_read (int fd,struct sk_buff *skb,struct uml_net_private *lp)
arch/um/drivers/random.c +1 -2
@@ -139,8 +139,7 @@ static int __init rng_init (void) err =misc_register (&rng_miscdev);if (err) { - printk (KERN_ERR RNG_MODULE_NAME ": misc device register " - "failed\n"); +pr_err (RNG_MODULE_NAME ": misc device register failed\n" ); goto err_out_cleanup_hw; } out:
arch/um/drivers/slip_kern.c +1 -1
@@ -36,7 +36,7 @@ static void slip_init(struct net_device *dev, void *data) dev->type =ARPHRD_SLIP ; dev->tx_queue_len =256 ; dev->flags =IFF_NOARP ; -printk ("SLIP backend - SLIP IP = %s\n" , spri->gate_addr); +pr_info ("SLIP backend - SLIP IP = %s\n" , spri->gate_addr); }static unsigned short slip_protocol (struct sk_buff *skbuff)
arch/um/drivers/slirp_kern.c +3 -3
@@ -38,10 +38,10 @@ void slirp_init(struct net_device *dev, void *data) dev->type =ARPHRD_SLIP ; dev->tx_queue_len =256 ; dev->flags =IFF_NOARP ; -printk ("SLIRP backend - command line:" ); +pr_info ("SLIRP backend - command line:" );for (i =0 ; spri->argw.argv[i] !=NULL ; i++) -printk (" '%s'" ,spri->argw.argv[i]); -printk ("\n" ); +pr_cont (" '%s'" ,spri->argw.argv[i]); +pr_cont ("\n" ); }static unsigned short slirp_protocol (struct sk_buff *skbuff)
arch/um/drivers/ubd_kern.c +17 -18
@@ -421,8 +421,8 @@ __uml_help(ubd_setup,static int udb_setup (char *str) { -printk ("udb%s specified on command line is almost certainly a ubd -> udb TYPO\n" , - str); +pr_notice ("udb%s specified on command line is almost certainly a ubd -> udb TYPO\n" , + str);return 1 ; }
@@ -752,8 +752,7 @@ static int ubd_open_dev(struct ubd *ubd_dev) }if (fd <0 ){ -printk ("Failed to open '%s', errno = %d\n" , ubd_dev->file, - -fd); +pr_err ("Failed to open '%s', errno = %d\n" , ubd_dev->file, -fd);return fd; } ubd_dev->fd = fd;
@@ -1251,7 +1250,7 @@ static bool submit_request(struct io_thread_req *io_req, struct ubd *dev) sizeof(io_req));if (n !=sizeof (io_req)) {if (n != -EAGAIN ) -printk ("write to io thread failed, errno = %d\n" , -n); +pr_err ("write to io thread failed, errno = %d\n" , -n);else if (list_empty (&dev->restart))list_add (&dev->restart, &restart);
@@ -1370,15 +1369,15 @@ static int update_bitmap(struct io_thread_req *req) n =os_seek_file (req->fds[1 ], req->cow_offset);if (n <0 ){ -printk ("do_io - bitmap lseek failed : err = %d\n" , -n); +pr_err ("do_io - bitmap lseek failed : err = %d\n" , -n);return 1 ; } n =os_write_file (req->fds[1 ], &req->bitmap_words,sizeof (req->bitmap_words));if (n !=sizeof (req->bitmap_words)){ -printk ("do_io - bitmap update failed, err = %d fd = %d\n" , -n, - req->fds[1 ]); +pr_err ("do_io - bitmap update failed, err = %d fd = %d\n" , + -n, req->fds[1 ]);return 1 ; }
@@ -1397,7 +1396,7 @@ static void do_io(struct io_thread_req *req)/* fds[0] is always either the rw image or our cow file */ n =os_sync_file (req->fds[0 ]);if (n !=0 ) { -printk ("do_io - sync failed err = %d fd = %d\n" , +pr_err ("do_io - sync failed err = %d fd = %d\n" , -n, req->fds[0 ]); req->error =1 ; }
@@ -1421,7 +1420,7 @@ static void do_io(struct io_thread_req *req) err =os_seek_file (req->fds[bit], off);if (err <0 ){ -printk ("do_io - lseek failed : err = %d\n" , -err); +pr_err ("do_io - lseek failed : err = %d\n" , -err); req->error =1 ;return ; }
@@ -1432,7 +1431,7 @@ static void do_io(struct io_thread_req *req) len -= n; n =os_read_file (req->fds[bit], buf, len);if (n <0 ) { -printk ("do_io - read failed, err = %d fd = %d\n" , +pr_err ("do_io - read failed, err = %d fd = %d\n" , -n, req->fds[bit]); req->error =1 ;return ;
@@ -1442,7 +1441,7 @@ static void do_io(struct io_thread_req *req) }else { n =os_write_file (req->fds[bit], buf, len);if (n != len){ -printk ("do_io - write failed err = %d fd = %d\n" , +pr_err ("do_io - write failed err = %d fd = %d\n" , -n, req->fds[bit]); req->error =1 ;return ;
@@ -1474,12 +1473,12 @@ int io_thread(void *arg) n =os_read_file (kernel_fd, &req,sizeof (struct io_thread_req *));if (n !=sizeof (struct io_thread_req *)){ -if (n <0 ) -printk ("io_thread - read failed, fd = %d, err = %d\n" , +if (n <0 ) { +pr_err ("io_thread - read failed, fd = %d, err = %d\n" , kernel_fd, -n); -else { -printk ("io_thread - short read, fd = %d, length = %d\n" , - kernel_fd, n); + }else { +pr_notice ("io_thread - short read, fd = %d, length = %d\n" , + kernel_fd, n); }continue ; }
@@ -1488,7 +1487,7 @@ int io_thread(void *arg) n =os_write_file (kernel_fd, &req,sizeof (struct io_thread_req *));if (n !=sizeof (struct io_thread_req *)) -printk ("io_thread - write failed, fd = %d, err = %d\n" , +pr_err ("io_thread - write failed, fd = %d, err = %d\n" , kernel_fd, -n); }
arch/um/drivers/ubd_user.c +3 -3
@@ -27,7 +27,7 @@ int start_io_thread(unsigned long sp, int *fd_out) err =os_pipe (fds,1 ,1 );if (err <0 ){ -printk ("start_io_thread - os_pipe failed, err = %d\n" , -err); +pr_err ("start_io_thread - os_pipe failed, err = %d\n" , -err); goto out; }
@@ -36,14 +36,14 @@ int start_io_thread(unsigned long sp, int *fd_out) err =os_set_fd_block (*fd_out,0 );if (err) { -printk ("start_io_thread - failed to set nonblocking I/O.\n" ); +pr_err ("start_io_thread - failed to set nonblocking I/O\n" ); goto out_close; } pid =clone (io_thread, (void *) sp,CLONE_FILES |CLONE_VM ,NULL );if (pid <0 ){ err = -errno; -printk ("start_io_thread - clone failed : errno = %d\n" , errno); +pr_err ("start_io_thread - clone failed : errno = %d\n" , errno); goto out_close; }
arch/um/drivers/vde_kern.c +3 -3
@@ -28,12 +28,12 @@ static void vde_init(struct net_device *dev, void *data) vpri->conn =NULL ; vpri->dev = dev; -printk ("vde backend - %s, " , vpri->vde_switch ? - vpri->vde_switch :"(default socket)" ); +pr_info ("vde backend - %s, " , + vpri->vde_switch ? vpri->vde_switch :"(default socket)" );vde_init_libstuff (vpri, init); -printk ("\n" ); +pr_cont ("\n" ); }static int vde_read (int fd,struct sk_buff *skb,struct uml_net_private *lp)
arch/um/drivers/vde_user.c +1 -2
@@ -87,8 +87,7 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) args->group = init->group; args->mode = init->mode ? init->mode :0700 ; - args->port ?printk ("port %d" , args->port) : -printk ("undefined port" ); + args->port ?pr_cont ("port %d" , args->port) :pr_cont ("undefined port" ); }int vde_user_read (void *conn,void *buf,int len)
arch/um/include/asm/pgtable-2level.h +6 -6
@@ -25,12 +25,12 @@#define PTRS_PER_PGD 1024#define FIRST_USER_ADDRESS 0 -#define pte_ERROR (e) \ - printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \ - pte_val(e)) -#define pgd_ERROR (e) \ - printk("%s:%d: bad pgd %p(%08lx).\n", __FILE__, __LINE__, &(e), \ - pgd_val(e)) +#define pte_ERROR (e) \ + printk("%s:%d: bad pte %p(%08lx)\n", \ + __FILE__, __LINE__, &(e), pte_val(e)) +#define pgd_ERROR (e) \ + printk("%s:%d: bad pgd %p(%08lx)\n", \ + __FILE__, __LINE__, &(e), pgd_val(e))static inline int pgd_newpage (pgd_t pgd) {return 0 ; }static inline void pgd_mkuptodate (pgd_t pgd) { }
arch/um/include/asm/pgtable-3level.h +9 -9
@@ -43,15 +43,15 @@#define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE)#define FIRST_USER_ADDRESS 0 -#define pte_ERROR (e) \ - printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \ - pte_val(e)) -#define pmd_ERROR (e) \ - printk("%s:%d: bad pmd %p(%016lx).\n", __FILE__, __LINE__, &(e), \ - pmd_val(e)) -#define pgd_ERROR (e) \ - printk("%s:%d: bad pgd %p(%016lx).\n", __FILE__, __LINE__, &(e), \ - pgd_val(e)) +#define pte_ERROR (e) \ + printk("%s:%d: bad pte %p(%016lx)\n", \ + __FILE__, __LINE__, &(e), pte_val(e)) +#define pmd_ERROR (e) \ + printk("%s:%d: bad pmd %p(%016lx)\n", \ + __FILE__, __LINE__, &(e), pmd_val(e)) +#define pgd_ERROR (e) \ + printk("%s:%d: bad pgd %p(%016lx)\n", \ + __FILE__, __LINE__, &(e), pgd_val(e))#define pud_none (x) (!(pud_val(x) & ~_PAGE_NEWPAGE))#define pud_bad (x) ((pud_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
arch/um/include/shared/user.h +1 -0
@@ -31,6 +31,7 @@ extern int printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));#else static inline int printk (const char *fmt, ...) + __attribute__ ((format (printf,1 ,2 ))) {return 0 ; }
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
Richard Weinberger
maintainerAm 10.05.2014 01:43, schrieb Joe Perches:
Quoted 67 lines
Joe Perches (4):
UserModeLinux: Convert UM_KERN_<LEVEL> to KERN_<LEVEL>
UserModeLinux: Remove unused #defines of UM_KERN_<LEVEL>
UserModeLinux: Use a more current logging style
UserModeLinux: Convert printks to pr_<level>arch/um/drivers/chan_kern.c | 27 +++---- arch/um/drivers/chan_user.c | 47 ++++++------ arch/um/drivers/daemon_kern.c | 8 +- arch/um/drivers/daemon_user.c | 28 +++---- arch/um/drivers/fd.c | 9 +-- arch/um/drivers/harddog_kern.c | 4 +- arch/um/drivers/harddog_user.c | 14 ++-- arch/um/drivers/hostaudio_kern.c | 13 ++-- arch/um/drivers/line.c | 24 +++--- arch/um/drivers/mconsole_kern.c | 29 +++---- arch/um/drivers/mconsole_user.c | 7 +- arch/um/drivers/mmapper_kern.c | 7 +- arch/um/drivers/net_kern.c | 53 +++++-------- arch/um/drivers/net_user.c | 20 ++--- arch/um/drivers/pcap_kern.c | 9 +-- arch/um/drivers/pcap_user.c | 19 +++-- arch/um/drivers/port_kern.c | 23 +++--- arch/um/drivers/port_user.c | 6 +- arch/um/drivers/pty.c | 4 +- arch/um/drivers/random.c | 3 +- arch/um/drivers/slip_kern.c | 2 +- arch/um/drivers/slip_user.c | 29 +++---- arch/um/drivers/slirp_kern.c | 9 +-- arch/um/drivers/slirp_user.c | 9 +-- arch/um/drivers/ssl.c | 10 +-- arch/um/drivers/stdio_console.c | 9 +-- arch/um/drivers/tty.c | 3 +- arch/um/drivers/ubd_kern.c | 117 +++++++++++++---------------- arch/um/drivers/ubd_user.c | 6 +- arch/um/drivers/umcast_kern.c | 38 +++++----- arch/um/drivers/umcast_user.c | 35 ++++----- arch/um/drivers/vde_kern.c | 23 +++--- arch/um/drivers/vde_user.c | 17 ++--- arch/um/drivers/xterm.c | 26 +++---- arch/um/drivers/xterm_kern.c | 6 +- arch/um/include/asm/pgtable-2level.h | 12 +-- arch/um/include/asm/pgtable-3level.h | 18 ++--- arch/um/include/shared/user.h | 12 +-- arch/um/kernel/exec.c | 4 +- arch/um/kernel/exitcode.c | 3 +- arch/um/kernel/initrd.c | 10 +-- arch/um/kernel/irq.c | 14 ++-- arch/um/kernel/physmem.c | 16 ++-- arch/um/kernel/process.c | 2 +- arch/um/kernel/sigio.c | 4 +- arch/um/kernel/skas/mmu.c | 9 +-- arch/um/kernel/smp.c | 18 ++--- arch/um/kernel/sysrq.c | 21 +++--- arch/um/kernel/time.c | 6 +- arch/um/kernel/tlb.c | 8 +- arch/um/kernel/trap.c | 9 +-- arch/um/os-Linux/aio.c | 45 +++++------ arch/um/os-Linux/drivers/ethertap_kern.c | 8 +- arch/um/os-Linux/drivers/ethertap_user.c | 32 ++++---- arch/um/os-Linux/drivers/tuntap_kern.c | 6 +- arch/um/os-Linux/drivers/tuntap_user.c | 24 +++--- arch/um/os-Linux/file.c | 37 ++++----- arch/um/os-Linux/helper.c | 33 ++++---- arch/um/os-Linux/irq.c | 8 +- arch/um/os-Linux/process.c | 31 ++++---- arch/um/os-Linux/sigio.c | 83 +++++++++-----------
Quoted 9 lines
arch/um/os-Linux/skas/mem.c | 23 +++--- arch/um/os-Linux/skas/process.c | 125 ++++++++++++++----------------- arch/um/os-Linux/time.c | 3 +- arch/um/os-Linux/tty.c | 10 +-- arch/um/os-Linux/umid.c | 48 ++++++------ arch/x86/um/bugs_32.c | 14 ++-- arch/x86/um/os-Linux/registers.c | 2 +- 68 files changed, 605 insertions(+), 786 deletions(-)
Thank you Joe!
I'll queue your patches for 3.16.
Thanks,
//richard
Quoted 9 lines · Richard Weinberger
Am 10.05.2014 01:43, schrieb Joe Perches:
Quoted 5 lines
Joe Perches (4):
UserModeLinux: Convert UM_KERN_<LEVEL> to KERN_<LEVEL>
UserModeLinux: Remove unused #defines of UM_KERN_<LEVEL>
UserModeLinux: Use a more current logging style
UserModeLinux: Convert printks to pr_<level>Thank you Joe!
I'll queue your patches for 3.16.
(adding Geert to cc's)
Hi Richard.
Please queue only patches 1 and 2.
Patches 3 and 4 are currently defective. These need a bit of rework to compile appropriately.
I'll do what Al suggested below one day soon.
from: https://lkml.org/lkml/2012/9/29/106
Quoted 23 lines · Al Viro
Quoted 10 lines · Geert Uytterhoeven
Quoted 8 lines · Joe Perches
Review static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf, · line 91
Quoted 6 lines
(quoted diff) +1
-1@@ -88,7 +88,7 @@ static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf, iocbp->aio_nbytes = sizeof(c); break; default: - printk(UM_KERN_ERR "Bogus op in do_aio - %d\n", type); + printk(KERN_ERR "Bogus op in do_aio - %d\n", type);Maybe a follow-on patch to convert these to pr_<level>?
Quoted 4 lines
That requires adding pr_<level> to
arch/um/include/shared/user.hfirst. Or to avoid duplication, extracting the pr_<level> definitions frominclude/linux/printk.hto a new header file, and preincluding that one for the user part of UML, too.Yecchhh.... Just how many of those pre-includes do you want to add? Seriously, if we get enough of those, it might make more sense to take them into a separate directory and add it to search paths, including that for userland objects of uml. If not, I'd rather copy them to
include/generatedinarch/um/Makefileand explicitly #include <generated/foo.h> them fromuser.h. It's trivially doable and as long as we have relatively few of those guys it's less PITA...
Richard Weinberger
maintainerAm 14.05.2014 22:07, schrieb Joe Perches:
Quoted 11 lines · Richard Weinberger
Quoted 9 lines
Am 10.05.2014 01:43, schrieb Joe Perches:
Quoted 5 lines
Joe Perches (4):
UserModeLinux: Convert UM_KERN_<LEVEL> to KERN_<LEVEL>
UserModeLinux: Remove unused #defines of UM_KERN_<LEVEL>
UserModeLinux: Use a more current logging style
UserModeLinux: Convert printks to pr_<level>Thank you Joe!
I'll queue your patches for 3.16.
Quoted 8 lines
(adding Geert to cc's)
Hi Richard.
Please queue only patches 1 and 2.
Patches 3 and 4 are currently defective. These need a bit of rework to compile appropriately.
Oh, I thought you have tested your patches. :-(
Thanks,
//richard