public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [alsa-devel] ALSA: pcsp: Use common error handling code in snd_card_pcsp_probe()
Date: Tue, 22 Aug 2017 16:07:35 +0200	[thread overview]
Message-ID: <s5hbmn78zmg.wl-tiwai@suse.de> (raw)
In-Reply-To: <fc4d8c96-7de2-e8f0-4cb4-5dda795d298a@users.sourceforge.net>

On Tue, 22 Aug 2017 15:15:02 +0200,
SF Markus Elfring wrote:
> 
> >> Is it appropriate to treat non-zero values as error codes there generally?
> > 
> > No, it can't be in general.
> 
> I got the impression that the functions which are called at the updated places
> by the function “snd_card_pcsp_probe” indicate a successful execution
> only by zero so far.

You have the impression, great.  And what's the reason to drop the
negative check?  It's not clearer, not better readable.
And, the worst part is that you've done it silently even without
mentioning in the change log at all.  That's really bad.
Just don't do it.

> > Lots of functions return a positive value, too.
> 
> Would you like to point any example out from the programming interface?

For example, the control API functions may return the positive number
when the value got changed, 0 for else, and a negative number for the
error.  The functions returning some numbers may return positive
numbers, of course.


Takashi

  reply	other threads:[~2017-08-22 14:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 12:10 [PATCH] ALSA: pcsp: Use common error handling code in snd_card_pcsp_probe() SF Markus Elfring
2017-08-22 12:16 ` Dan Carpenter
2017-08-22 12:28   ` Takashi Iwai
2017-08-22 12:47     ` SF Markus Elfring
2017-08-22 12:55       ` [alsa-devel] " Takashi Iwai
2017-08-22 13:15         ` SF Markus Elfring
2017-08-22 14:07           ` Takashi Iwai [this message]
2017-08-22 14:36             ` SF Markus Elfring
2017-08-22 14:49               ` Takashi Iwai
2017-08-22 15:03                 ` SF Markus Elfring
2017-08-22 15:07                   ` Takashi Iwai
2017-08-22 15:47                     ` [PATCH v3] " SF Markus Elfring
2017-08-22 15:59                       ` Takashi Iwai
2017-08-22 14:00     ` [PATCH v2] " SF Markus Elfring

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=s5hbmn78zmg.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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