On 2019/8/30 11:36, Gao Xiang wrote:
> As Joe Perches suggested [1],
>               err = bio_add_page(bio, page, PAGE_SIZE, 0);
> -             if (unlikely(err != PAGE_SIZE)) {
> +             if (err != PAGE_SIZE) {
>                       err = -EFAULT;
>                       goto err_out;
>               }
> 
> The initial assignment to err is odd as it's not
> actually an error value -E<FOO> but a int size
> from a unsigned int len.
> 
> Here the return is either 0 or PAGE_SIZE.
> 
> This would be more legible to me as:
> 
>               if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) {
>                       err = -EFAULT;
>                       goto err_out;
>               }
> 
> [1] 
> https://lore.kernel.org/r/[email protected]/
> Reported-by: Joe Perches <[email protected]>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to