mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Gavin Schenk <g.schenk@eckelmann.de>
To: Sascha Hauer <s.hauer@pengutronix.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 15:37:23 +0100	[thread overview]
Message-ID: <20201109143723.mz6tu45bydnnfhek@NB061.eckelmann.group> (raw)
In-Reply-To: <20201109090215.GF29830@pengutronix.de>

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


and Remove this:
> +#define BUFLEN 32
> +#undef BUFLEN


--
Regards
Gavin Schenk
Eckelmann AG
Vorstand: Dipl.-Ing. Peter Frankenbach (Sprecher) Dipl.-Wi.-Ing. Philipp Eckelmann
Dr.-Ing. Marco Münchhof Dr.-Ing. Frank Uhlemann
Vorsitzender des Aufsichtsrats: Hubertus G. Krossa Stv. Vorsitzender des Aufsichtsrats: Dr.-Ing. Gerd Eckelmann
Sitz der Gesellschaft: Berliner Str. 161, 65205 Wiesbaden, Amtsgericht Wiesbaden HRB 12636
www.eckelmann.de

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

  reply	other threads:[~2020-11-09 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 20:09 Uwe Kleine-König
2020-11-09  9:02 ` Sascha Hauer
2020-11-09 14:37   ` Gavin Schenk [this message]
2020-11-09 16:09     ` Sascha Hauer

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=20201109143723.mz6tu45bydnnfhek@NB061.eckelmann.group \
    --to=g.schenk@eckelmann.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox