lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 01 Sep 2014 10:11:29 +1000 From: Ryan Mallon <rmallon@...il.com> To: Sudip Mukherjee <sudipm.mukherjee@...il.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jiri Slaby <jslaby@...e.cz> CC: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v2] serial: serial_core.c: printk replacement On 29/08/14 00:15, Sudip Mukherjee wrote: > printk replaced with corresponding pr_err, dev_alert, dev_notice and pr_info. > fixed two broken user-visible strings used by the corresponding printk > > Signed-off-by: Sudip Mukherjee <sudip@...torindia.org> > --- > > In the first patch i sent Greg suggested to use dev_err instead of pr_err , but as later Jiri pointed out in my later patches that uport->dev is having a null check so can not be used , tty_dev is also having a put_device , so back to pr_err. > > drivers/tty/serial/serial_core.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > @@ -1975,12 +1976,11 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) > for (tries = 3; !ops->tx_empty(uport) && tries; tries--) > msleep(10); > if (!tries) > - printk(KERN_ERR "%s%s%s%d: Unable to drain " > - "transmitter\n", > - uport->dev ? dev_name(uport->dev) : "", > - uport->dev ? ": " : "", > - drv->dev_name, > - drv->tty_driver->name_base + uport->line); > + pr_err("%s%s%s%d: Unable to drain transmitter\n", > + uport->dev ? dev_name(uport->dev) : "", > + uport->dev ? ": " : "", > + drv->dev_name, > + drv->tty_driver->name_base + uport->line); dev_printk() prints the value of dev_name() and handles the NULL case, so this could be changed to: dev_err(uport->dev, "%s%d: Unable to drain transmitter\n", drv->dev_name, drv->tty_driver->name_base + uport->line); It might also be possible to remove drv->dev_name since dev_printk() also prints the driver string, but I don't know if they are equivalent in this case. > > if (console_suspend_enabled || !uart_console(uport)) > ops->shutdown(uport); > @@ -2109,7 +2109,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port) > break; > } > > - printk(KERN_INFO "%s%s%s%d at %s (irq = %d, base_baud = %d) is a %s\n", > + pr_info("%s%s%s%d at %s (irq = %d, base_baud = %d) is a %s\n", > port->dev ? dev_name(port->dev) : "", > port->dev ? ": " : "", > drv->dev_name, Same here. ~Ryan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists