All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 5/5] sound: soc: core: no need to check return value of debugfs_create functions
Date: Fri, 14 Jun 2019 16:34:05 +0100	[thread overview]
Message-ID: <20190614153405.GD5316@sirena.org.uk> (raw)
In-Reply-To: <20190614094756.2965-5-gregkh@linuxfoundation.org>


[-- Attachment #1.1: Type: text/plain, Size: 1410 bytes --]

On Fri, Jun 14, 2019 at 11:47:56AM +0200, Greg Kroah-Hartman wrote:

> Note, the soc-pcm "state" file has now moved to a subdirectory, as it is
> only a good idea to save the dentries for debugfs directories, not
> individual files, as the individual file debugfs functions are changing
> to not return a dentry.

It'd be better to split this out into a separate change for ease of
review.

> -	d = debugfs_create_file(w->name, 0444,
> -				dapm->debugfs_dapm, w,
> -				&dapm_widget_power_fops);
> -	if (!d)
> -		dev_warn(w->dapm->dev,
> -			"ASoC: Failed to create %s debugfs file\n",
> -			w->name);
> +	debugfs_create_file(w->name, 0444, dapm->debugfs_dapm, w,
> +			    &dapm_widget_power_fops);

The majority of this is removing error prints rather than code that
actively does something different.  If this was like kmalloc() where the
API is itself reported errors then this wouldn't be an issue but unless
I'm missing something debugfs fails silently so this means that if
something goes wrong it's going to be harder for the user to figure out
where the debugfs files they wanted to check went to.  I'm guessing you
don't want to add error prints in debugfs itself so I'd rather they
stayed here.

Yes, the error check is looking for NULL not an error pointer - it was
correct when written but I see that the debugfs API changed earlier this
year to return error pointers so we ought to fix that up.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2019-06-14 15:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  9:47 [PATCH 1/5] sound: SoC: sof: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-14  9:47 ` [PATCH 2/5] sound: soc: skylake: " Greg Kroah-Hartman
2019-06-22 19:57   ` Cezary Rojewski
2019-06-22 20:39     ` Takashi Iwai
     [not found]       ` <20190624105334.GJ5316@sirena.org.uk>
2019-06-24 13:15         ` Takashi Iwai
2019-06-24 13:33           ` Mark Brown
2019-06-27  0:23             ` Greg Kroah-Hartman
2019-06-23  4:57     ` Greg Kroah-Hartman
2019-06-23 15:18       ` Cezary Rojewski
2019-06-23 15:55         ` Greg Kroah-Hartman
2019-06-14  9:47 ` [PATCH 3/5] sound: soc: codecs: wm_adsp: " Greg Kroah-Hartman
2019-06-14 10:24   ` Richard Fitzgerald
2019-06-14 15:43   ` Applied "ASoC: wm_adsp: no need to check return value of debugfs_create functions" to the asoc tree Mark Brown
2019-06-14  9:47 ` [PATCH 4/5] sound: soc: fsl: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-14 15:43   ` Applied "ASoC: fsl: no need to check return value of debugfs_create functions" to the asoc tree Mark Brown
2019-06-14  9:47 ` [PATCH 5/5] sound: soc: core: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-14 15:34   ` Mark Brown [this message]
2019-06-14 16:13     ` Greg Kroah-Hartman
2019-06-14 17:41       ` Mark Brown
2019-06-14 14:59 ` [PATCH 1/5] sound: SoC: sof: " Mark Brown
2019-06-14 15:28   ` Greg Kroah-Hartman
2019-06-14 15:14 ` Mark Brown
2019-06-14 15:27   ` Greg Kroah-Hartman
2019-06-14 16:37     ` Mark Brown

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=20190614153405.GD5316@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.