All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Gavin Schenk <g.schenk@eckelmann.de>
Cc: barebox@lists.infradead.org,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH v2] nfs: check return value of various rpc calls
Date: Mon, 9 Nov 2020 17:09:11 +0100	[thread overview]
Message-ID: <20201109160911.GL29830@pengutronix.de> (raw)
In-Reply-To: <20201109143723.mz6tu45bydnnfhek@NB061.eckelmann.group>

On Mon, Nov 09, 2020 at 03:37:23PM +0100, Gavin Schenk wrote:
> Hi,
> 
> > I've rewritten this thing a little bit. First of all, this doesn't need
> > preprocessor tricks and also with this the nfserror to error mapping
> > function returns the error string, so we can convert printing the
> > messages to pr_* or dev_* functions. Also we use the human readable
> > error names for the errors we have a string for.
> >
> Nice to here that there is progress.
> 
> > +
> > +static const char *nfserrstr(u32 nfserror, int *errcode)
> > +{
> 
> Instead using this Preprocessor thing wouldn't it be better to use a number and
> sizeof(str) at the other locations?
> 
> > +	static char str[BUFLEN];
> static char str[32];
> 
> here
> > +				snprintf(str, BUFLEN, "NFS3ERR_%s", err->name);
> snprintf(str, sizeof(str), "NFS3ERR_%s", err->name);
> 
> 
> and here
> > +	snprintf(str, BUFLEN, "Unknown NFS error %d", nfserror);
> snprintf(str, sizeof(str), "Unknown NFS error %d", nfserror);

Much better, thanks. I'll change that

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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:[~2020-11-09 16:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 20:09 [PATCH v2] nfs: check return value of various rpc calls Uwe Kleine-König
2020-11-09  9:02 ` Sascha Hauer
2020-11-09 14:37   ` Gavin Schenk
2020-11-09 16:09     ` Sascha Hauer [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=20201109160911.GL29830@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=g.schenk@eckelmann.de \
    --cc=u.kleine-koenig@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.