lkml.org 
[lkml]   [2016]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] IB/qib: Use memdup_user() rather than duplicating its implementation
From
Date
On 8/19/2016 11:27 AM, Marciniszyn, Mike wrote:
>> Subject: [PATCH] IB/qib: Use memdup_user() rather than duplicating its
>> diff --git a/drivers/infiniband/hw/qib/qib_fs.c
>
> I would be even more aggressive at reducing lines of code.
>
> For example do direct returns when ok to do:
> if (pos != 0 || count != sizeof(struct qib_flash))
> return -EINVAL;
>
> tmp = memdup_user(buf, count);
> if (IS_ERR(tmp))
> return PTR_ERR(tmp);
>
> The bail_tmp: label is then not needed.
>
> Mike
>

With Mike's additional cleanups in place, patch applied.

--
Doug Ledford <dledford@redhat.com>
GPG Key ID: 0E572FDD

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.072 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site