public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [patch] ALSA: asihpi - fix return type of hpios_locked_mem_alloc()
Date: Thu, 29 Mar 2012 05:33:54 +0000	[thread overview]
Message-ID: <s5hk424t1h9.wl%tiwai@suse.de> (raw)
In-Reply-To: <4F7385F8.4050004@audioscience.com>

At Thu, 29 Mar 2012 10:43:20 +1300,
Eliot Blennerhassett wrote:
> 
> On 29/03/12 03:38, Takashi Iwai wrote:
> > At Wed, 28 Mar 2012 09:57:02 +0300,
> > Dan Carpenter wrote:
> >>
> >> This function returns zero or -ENOMEM, but because it's type is u16, the
> >> -ENOMEM gets changed to 65524.  None of the callers care, but lets fix
> >> it anyway as a cleanup.
> >>
> >> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > Applied it now.  Thanks.
> 
> Hmm. I guess it is too late to NAK this change?

Yes, Dan's fix itself is correct, so no big reason to revert.

> I'd prefer changing the return value to HPI_ERROR_MEMORY_ALLOC and
> leaving the function signature alone.

It's fine to change to HPI_ERROR_MEMORY_ALLOC.  Just write another
patch to change it appropriately and submit.

But, if we change in that way, we should think again over the return
type of these functions, too.  If functions are supposed to return
these specific error numbers, they should return rather enum
HPI_ERROR_CODES type instead of u16.  Otherwise it's misleading and an
error like this can happen again.

Or, follow the common style, returning int with 0 or a negative error
number.


thanks,

Takashi

  reply	other threads:[~2012-03-29  5:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28  6:57 [patch] ALSA: asihpi - fix return type of hpios_locked_mem_alloc() Dan Carpenter
2012-03-28 14:38 ` Takashi Iwai
2012-03-28 21:43 ` Eliot Blennerhassett
2012-03-29  5:33   ` Takashi Iwai [this message]
2012-03-29  5:56     ` Dan Carpenter
2012-03-29 20:52     ` [PATCH] ALSA: asihpi - fix return value " linux
2012-03-30 14:25       ` Takashi Iwai

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=s5hk424t1h9.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=eblennerhassett@audioscience.com \
    --cc=kernel-janitors@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