linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Malathi Gottam <mgottam@codeaurora.org>
Cc: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl,
	mchehab@kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	acourbot@chromium.org, vgarodia@codeaurora.org
Subject: Re: [PATCH v2] media: venus: add debugfs support
Date: Mon, 7 Jan 2019 16:55:17 +0000	[thread overview]
Message-ID: <20190107165517.GS2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1546871340-13009-1-git-send-email-mgottam@codeaurora.org>

On Mon, Jan 07, 2019 at 07:59:00PM +0530, Malathi Gottam wrote:

> +static struct dentry *venus_debugfs_init_drv(void)
> +{
> +	bool ok = false;
> +	struct dentry *dir = NULL;
> +
> +	dir = debugfs_create_dir("venus", NULL);
> +	if (IS_ERR_OR_NULL(dir)) {
> +		dir = NULL;
> +		pr_err("failed to create debug dir");
> +		goto failed_create_dir;
> +	}

Huh?  When does debugfs_create_dir() return ERR_PTR()?

Any interface that mixes returning NULL for error-reporting with returning
ERR_PTR(...) for the same needs to be put out of its misery.  As it happens,
debugfs_create_dir() returns NULL on all errors.  And if you've meant the
above as "future-proofing"... don't do that, please.  That only breeds
confusion down the road, as the code gets cut'n'pasted around.

> -	if (ret)
> +	if (ret) {
> +		dprintk(ERR,
> +			"Failed to set actual buffer count %d for buffer type %d\n",
> +			buf_count.count_actual, buf_count.type);
>  		return ret;
>  
>  	buf_count.type = HFI_BUFFER_OUTPUT;
>  	buf_count.count_actual = output_bufs;
>  

*blink*
Does that even compile?

  reply	other threads:[~2019-01-07 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 14:29 [PATCH v2] media: venus: add debugfs support Malathi Gottam
2019-01-07 16:55 ` Al Viro [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-12-28  9:23 Malathi Gottam
2018-12-28 11:32 ` kbuild test robot
2018-12-29 17:22 ` kbuild test robot

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=20190107165517.GS2217@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=acourbot@chromium.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mgottam@codeaurora.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vgarodia@codeaurora.org \
    /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;
as well as URLs for NNTP newsgroup(s).