linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Ryan Mallon <rmallon@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] serial: serial_core.c: printk replacement
Date: Mon, 1 Sep 2014 19:51:07 +0530	[thread overview]
Message-ID: <20140901142107.GA3068@sudip-PC> (raw)
In-Reply-To: <5403B9B1.4010407@gmail.com>

On Mon, Sep 01, 2014 at 10:11:29AM +1000, Ryan Mallon wrote:
> 
> 
> 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@vectorindia.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.
> 

they are not equivalent. drv->dev_name is giving "ttyS" , and the driver string as printed by dev_printk() is "serial".
So, I guess I will make a v3 of the patch and mention all these in the commit message.

thanks
sudip

> >  
> >  		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

      reply	other threads:[~2014-09-01 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 14:15 [PATCH v2] serial: serial_core.c: printk replacement Sudip Mukherjee
2014-09-01  0:11 ` Ryan Mallon
2014-09-01 14:21   ` Sudip Mukherjee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140901142107.GA3068@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rmallon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).