The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Bui Duc Phuc <phucduc.bui@gmail.com>, Kees Cook <kees@kernel.org>,
	Dan Carpenter <error27@gmail.com>,
	Cen Zhang <zzzccc427@gmail.com>, Len Bao <len.bao@gmx.us>,
	Mehul Rao <mehulrao@gmail.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	<cassiogabrielcontato@gmail.com>
Subject: Re: [PATCH 0/6] Return -ENODEV instead of -EFAULT on module-get failure
Date: Mon, 06 Jul 2026 15:26:33 +0200	[thread overview]
Message-ID: <87jyr88d12.wl-tiwai@suse.de> (raw)
In-Reply-To: <83d2a230-71e8-4a24-9dce-363e1b230b54@intel.com>

On Mon, 06 Jul 2026 15:13:15 +0200,
Cezary Rojewski wrote:
> 
> On 7/6/2026 2:31 PM, Bui Duc Phuc wrote:
> 
> >> Now, there is a benefit of having a different error code in
> >> try_module_get() case: easier to find the offending bit when viewing
> >> logs.  All the functions in the area have rather low log-coverage so
> >> distinct error codes help.
> >> 
> >> Regardless, as you mentioned, -EFAULT isn't exactly the right return
> >> code either so the direction of the patchset is good.
> > 
> > Should I also add dev_err() at these paths, or is the distinct error
> > code enough for now?
> Nah, typically I prefer not to mix the changes, let them remain
> atomic. Distinct error code is enough.
> 
> In regard to the specific constant, I'd ask Takashi and Jaroslav
> what's their view on the subject.  Perhaps -EPERM or -ENOENT are good
> candidates.

A quick grep showed the statics like:
     85 ENODEV
     41 EINVAL
     17 EBUSY
     16 EFAULT
     14 ENOENT
     10 EPROBE
      8 EIO
      6 ENXIO
      3 EPROTONOSUPPORT
      3 EAGAIN
      3 EACCES
      2 EXPORT
      2 EPERM
      2 ENOLCK
      1 EPROTO
      1 EOPNOTSUPP
      1 ENOSYS
      1 ENOPROTOOPT
      1 EAFNOSUPPORT

So -ENODEV looks fine.


thanks,

Takashi

      reply	other threads:[~2026-07-06 13:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06  8:49 [PATCH 0/6] Return -ENODEV instead of -EFAULT on module-get failure phucduc.bui
2026-07-06  8:49 ` [PATCH 1/6] ALSA: control: Return -ENODEV instead of -EFAULT in snd_ctl_open() phucduc.bui
2026-07-06  9:35   ` Cezary Rojewski
2026-07-06  9:40     ` Bui Duc Phuc
2026-07-06  8:49 ` [PATCH 2/6] ALSA: hwdep: Return -ENODEV instead of -EFAULT in snd_hwdep_open() phucduc.bui
2026-07-06  8:49 ` [PATCH 3/6] ALSA: info: Return -ENODEV instead of -EFAULT in alloc_info_private() phucduc.bui
2026-07-06  8:49 ` [PATCH 4/6] ALSA: mixer: oss: Return -ENODEV instead of -EFAULT in snd_mixer_oss_open() phucduc.bui
2026-07-06  8:49 ` [PATCH 5/6] ALSA: pcm: oss: Return -ENODEV instead of -EFAULT in snd_pcm_oss_open() phucduc.bui
2026-07-06  8:49 ` [PATCH 6/6] ALSA: pcm: Return -ENODEV instead of -EFAULT in snd_pcm_open() phucduc.bui
2026-07-06  9:42 ` [PATCH 0/6] Return -ENODEV instead of -EFAULT on module-get failure Cezary Rojewski
2026-07-06 12:31   ` Bui Duc Phuc
2026-07-06 13:13     ` Cezary Rojewski
2026-07-06 13:26       ` Takashi Iwai [this message]

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=87jyr88d12.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=bigeasy@linutronix.de \
    --cc=cassiogabrielcontato@gmail.com \
    --cc=cezary.rojewski@intel.com \
    --cc=error27@gmail.com \
    --cc=kees@kernel.org \
    --cc=len.bao@gmx.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mehulrao@gmail.com \
    --cc=perex@perex.cz \
    --cc=phucduc.bui@gmail.com \
    --cc=tiwai@suse.com \
    --cc=zzzccc427@gmail.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