From: Takashi Iwai <tiwai@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
Antonio Ospite <ao2@amarulasolutions.com>,
alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ALSA: usx2y: remove an unneeded check
Date: Mon, 29 Jul 2013 11:58:38 +0000 [thread overview]
Message-ID: <s5hioztfuey.wl%tiwai@suse.de> (raw)
In-Reply-To: <20130728202738.GC8684@elgon.mountain>
At Sun, 28 Jul 2013 23:27:38 +0300,
Dan Carpenter wrote:
>
> The test here is always true because S[i].urb is an array not a pointer.
> Also it's bogus because the intent was to test:
> if (S->urb[i]) {
> instead of:
> if (S[i].urb) {
>
> Anway, usb_kill_urb() and usb_free_urb() accept NULL pointers so we can
> just remove this.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks, applied.
Takashi
>
> diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
> index 1f9bbd5..5a51b18 100644
> --- a/sound/usb/usx2y/usbusx2y.c
> +++ b/sound/usb/usx2y/usbusx2y.c
> @@ -305,11 +305,9 @@ static void usX2Y_unlinkSeq(struct snd_usX2Y_AsyncSeq *S)
> {
> int i;
> for (i = 0; i < URBS_AsyncSeq; ++i) {
> - if (S[i].urb) {
> - usb_kill_urb(S->urb[i]);
> - usb_free_urb(S->urb[i]);
> - S->urb[i] = NULL;
> - }
> + usb_kill_urb(S->urb[i]);
> + usb_free_urb(S->urb[i]);
> + S->urb[i] = NULL;
> }
> kfree(S->buffer);
> }
>
prev parent reply other threads:[~2013-07-29 11:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-28 20:27 [patch] ALSA: usx2y: remove an unneeded check Dan Carpenter
2013-07-29 11:58 ` 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=s5hioztfuey.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=ao2@amarulasolutions.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=perex@perex.cz \
/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