public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	alsa-devel@alsa-project.org, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/3] ALSA: mpu401: Use common error handling code in snd_mpu401_uart_new()
Date: Sat, 12 Aug 2017 18:08:18 -0700	[thread overview]
Message-ID: <1502586498.3099.27.camel@perches.com> (raw)
In-Reply-To: <06592078-5382-5f6a-f9aa-c85f293e1734@users.sourceforge.net>

On Sat, 2017-08-12 at 21:12 +0200, SF Markus Elfring wrote:
> Add a jump target so that a bit of exception handling can be better
> reused at the end of this function.
[]
> diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
[]
> @@ -612,6 +612,9 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
>  	if (rrawmidi)
>  		*rrawmidi = rmidi;
>  	return 0;
> +free_device:
> +	snd_device_free(card, rmidi);
> +	return err;
>  }
>  
>  EXPORT_SYMBOL(snd_mpu401_uart_new);

It may be more common and better to leave a blank line
between a single line return and a label.

It separates logical points in the function a bit more.

  reply	other threads:[~2017-08-13  1:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-12 19:10 [PATCH 0/3] ALSA: mpu401: Adjustments for three function implementations SF Markus Elfring
2017-08-12 19:11 ` [PATCH 1/3] ALSA: mpu401: Delete an error message for a failed memory allocation in snd_mpu401_uart_new() SF Markus Elfring
2017-08-12 19:12 ` [PATCH 2/3] ALSA: mpu401: Use common error handling code " SF Markus Elfring
2017-08-13  1:08   ` Joe Perches [this message]
2017-08-12 19:13 ` [PATCH 3/3] ALSA: mpu401: Adjust four checks for null pointers SF Markus Elfring
2017-08-12 21:36 ` [PATCH 0/3] ALSA: mpu401: Adjustments for three function implementations 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=1502586498.3099.27.camel@perches.com \
    --to=joe@perches.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o-takashi@sakamocchi.jp \
    --cc=perex@perex.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox