Re: [PATCH v2 1/2] nfsd: Replace open-coded conversion of bytes to hex

Andy Shevchenko <[email protected]>
Newsgroups gmane.linux.nfs
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Message-ID <[email protected]>
On Mon, Aug 04, 2025 at 10:46:59PM +0000, Eric Biggers wrote:
> Since the Linux kernel's sprintf() has conversion to hex built-in via
> "%*phN", delete md5_to_hex() and just use that.  Also add an explicit
> array bound to the dname parameter of nfs4_make_rec_clidname() to make
> its size clear.  No functional change.

...

> +	sprintf(dname, "%*phN", 16, cksum.data);

FWIW, since the length is static no need to use stack for that:

	sprintf(dname, "%16phN", cksum.data);

will be better.

-- 
With Best Regards,
Andy Shevchenko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.