mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] common: env: make error message more verbose
Date: Mon, 4 May 2015 09:43:59 +0200	[thread overview]
Message-ID: <20150504074359.GA27811@pengutronix.de> (raw)
In-Reply-To: <20150504073219.GO6325@pengutronix.de>

Hi!

On Mon, May 04, 2015 at 09:32:19AM +0200, Sascha Hauer wrote:
> On Tue, Apr 28, 2015 at 12:32:27PM +0200, Steffen Trumtrar wrote:
> > Change the setenv error message from
> > 
> > 	set parameter: Invalid argument
> > 
> > to a more helpful
> > 
> > 	net: cannot set parameter 'nameserver': Invalid argument
> > 
> > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> > ---
> >  common/env.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/common/env.c b/common/env.c
> > index 2e33eb35856b..434170a7468b 100644
> > --- a/common/env.c
> > +++ b/common/env.c
> > @@ -225,8 +225,10 @@ int setenv(const char *_name, const char *value)
> >  
> >  		errno = -ret;
> >  
> > -		if (ret < 0)
> > -			perror("set parameter");
> > +		if (ret < 0) {
> > +			dev_err(dev, "cannot set parameter '%s'", par);
> > +			perror("");
> > +		}
> 
> dev may be invalid here, so you shouldn't use dev_err.
> 

Argh, yeah, of course *facepalm*.

> After we talked about the missing informations in the setenv failure
> path I created the following patch. I applied this one now.

Thanks for fixing.
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2015-05-04  7:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 10:32 Steffen Trumtrar
2015-05-04  7:32 ` Sascha Hauer
2015-05-04  7:43   ` Steffen Trumtrar [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=20150504074359.GA27811@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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