mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhangfei Gao <zhangfei.gao@linaro.org>
To: Kai Ye <yekai13@huawei.com>,
	linux-accelerators@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, linuxarm@huawei.com
Subject: Re: [PATCH] uacce: fix some coding styles
Date: Tue, 21 Jul 2020 14:57:57 +0800	[thread overview]
Message-ID: <0775c541-5802-cdf3-e2aa-c62c027ab8a7@linaro.org> (raw)
In-Reply-To: <1595229523-14103-1-git-send-email-yekai13@huawei.com>



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@huawei.com>
> Reviewed-by: Zhou Wang <wangzhou1@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

  reply	other threads:[~2020-07-21  6:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  7:18 Kai Ye
2020-07-21  6:57 ` Zhangfei Gao [this message]
2020-07-30  6:13 Kai Ye
2020-07-31  2:40 ` Zhou Wang
2020-07-31  3:09 ` Zhangfei Gao
2020-09-11  7:37   ` yekai(A)
2020-09-11  7:41     ` Greg KH
2020-09-14  2:29 Kai Ye
2020-09-14  7:59 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0775c541-5802-cdf3-e2aa-c62c027ab8a7@linaro.org \
    --to=zhangfei.gao@linaro.org \
    --cc=linux-accelerators@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=yekai13@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®