Re: [PATCH v2] nfs: check return value of various rpc calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux