lkml.org 
[lkml]   [2020]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] crypto: hisilicon - allow smaller reads in debugfs
On Tue, Jun 02, 2020 at 04:54:09PM +0300, Dan Carpenter wrote:
> Originally this code rejected any read less than 256 bytes. There
> is no need for this artificial limit. We should just use the normal
> helper functions to read a string from the kernel.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: Use simple_read_from_buffer(). The v1 was slightly half arsed
> because I left the original check for:
>
> if (*pos)
> return 0;
>
> So it could result in partial reads. The new code means that if you
> want to read the buffer one byte at a time, that's fine or if you want
> to read it in one 256 byte chunk that's also fine. Plus it deletes 21
> lines of code and is a lot cleaner.
>
> drivers/crypto/hisilicon/qm.c | 33 ++++++---------------------------
> 1 file changed, 6 insertions(+), 27 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2020-06-18 09:57    [W:0.229 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site