On Mon, Dec 10, 2018 at 07:00:12PM +0000, Jason Gunthorpe wrote: > On Mon, Dec 10, 2018 at 11:35:34AM +0200, Leon Romanovsky wrote: > > + if (resp_len < attrs->ucore.outlen) > > + /* > > + * Zero fill any extra memory that user > > + * space might have provided. > > + */ > > + ret = clear_user(attrs->ucore.outbuf + resp_len, > > + attrs->ucore.outlen - resp_len); > > > > - return 0; > > + return (ret) ? -EFAULT : 0; > > This would be nicer to stay as return 0 so we don't have to have extra > branches on the fast path. Code is clearer that way too.. I don't see usage of this function in "fast path", only in our standard control verbs which are far to be optimized for the speed. Let's try to avoid premature optimization and I disagree with second part of the question too :) > > Jason
Attachment:
signature.asc
Description: PGP signature