linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Linus Walleij <linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] spi: fixed some core weirdness
Date: Fri, 22 Oct 2010 10:43:43 -0600	[thread overview]
Message-ID: <20101022164343.GA20713@angua.secretlab.ca> (raw)
In-Reply-To: <1287688004-27410-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>

On Thu, Oct 21, 2010 at 09:06:44PM +0200, Linus Walleij wrote:
> Those things in the SPI core just strike me as particularly odd:
> dev_dbg() used in an obvious error branch, and then two hardcoded
> strings passed in as parameters.
> 
> Signed-off-by: Linus Walleij <linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>

Merged, thanks.

I ready David's nack, but We're quibbling over *bytes* in the single
digits in a multi-megabyte kernel.  The total size of printk messages
is indeed a problem, but it isn't going to be solved by the kind of
micro-optimizations employed here.

I have dropped the dev_dbg->dev_err hunk though.

g.


> ---
>  drivers/spi/spi.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index b5a78a1..fcaa200 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -300,16 +300,16 @@ int spi_add_device(struct spi_device *spi)
>  	 */
>  	status = spi_setup(spi);
>  	if (status < 0) {
> -		dev_err(dev, "can't %s %s, status %d\n",
> -				"setup", dev_name(&spi->dev), status);
> +		dev_err(dev, "can't setup %s, status %d\n",
> +				dev_name(&spi->dev), status);
>  		goto done;
>  	}
>  
>  	/* Device may be bound to an active driver when this returns */
>  	status = device_add(&spi->dev);
>  	if (status < 0)
> -		dev_err(dev, "can't %s %s, status %d\n",
> -				"add", dev_name(&spi->dev), status);
> +		dev_err(dev, "can't add %s, status %d\n",
> +				dev_name(&spi->dev), status);
>  	else
>  		dev_dbg(dev, "registered child %s\n", dev_name(&spi->dev));
>  
> @@ -652,7 +652,7 @@ int spi_setup(struct spi_device *spi)
>  	 */
>  	bad_bits = spi->mode & ~spi->master->mode_bits;
>  	if (bad_bits) {
> -		dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
> +		dev_err(&spi->dev, "setup: unsupported mode bits %x\n",
>  			bad_bits);
>  		return -EINVAL;
>  	}
> -- 
> 1.6.3.3
> 

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev

  parent reply	other threads:[~2010-10-22 16:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21 19:06 [PATCH] spi: fixed some core weirdness Linus Walleij
     [not found] ` <1287688004-27410-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2010-10-21 22:28   ` David Brownell
2010-10-21 23:11     ` Linus Walleij
2010-10-22 10:55     ` Linus Walleij
2010-10-22 16:43   ` Grant Likely [this message]
     [not found]     ` <20101022164343.GA20713-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-22 23:20       ` David Brownell
     [not found]         ` <528767.85891.qm-4JhmkcZgSkmZZBmlwP4mLPu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-10-23 15:36           ` Linus Walleij

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=20101022164343.GA20713@angua.secretlab.ca \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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).