[PATCH] uacce: fix some coding styles

yekai(A) yekai13 at huawei.com
Mon Jul 27 23:32:27 AEST 2020


Thank you for your prompt reply, we should not add extra checked.

I will fix it in the next v2.
Thanks.
On 2020/7/21 14:57, Zhangfei Gao wrote:
>
>
> On 2020/7/20 下午3:18, Kai Ye wrote:
>> 1. add some parameter check.
>> 2. delete some redundant code.
>> 3. modify the module author information.
>>
>> Signed-off-by: Kai Ye <yekai13 at huawei.com>
>> Reviewed-by: Zhou Wang <wangzhou1 at hisilicon.com>
> Thanks Kai.
>> ---
>>   drivers/misc/uacce/uacce.c | 28 +++++++++++++---------------
>>   1 file changed, 13 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
>> index 107028e..2e1af58 100644
>> --- a/drivers/misc/uacce/uacce.c
>> +++ b/drivers/misc/uacce/uacce.c
>> @@ -63,8 +63,12 @@ static long uacce_fops_unl_ioctl(struct file *filep,
>>                    unsigned int cmd, unsigned long arg)
>>   {
>>       struct uacce_queue *q = filep->private_data;
>> -    struct uacce_device *uacce = q->uacce;
>> +    struct uacce_device *uacce;
>> +
>> +    if (WARN_ON(!q))
>> +        return -EINVAL;
> WARN_ON should not be used in uacce, instead error can be printed in 
> user space driver.
> Error should not be printed in kernel log as pasid can be used by 
> unpriv user.
>
> And I think we do not need check filep->private_data.
> The fd is double checked in __fget_files.
>
> Thanks
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-accelerators/attachments/20200727/2a03301a/attachment.htm>


More information about the Linux-accelerators mailing list