Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1710408

Re: [PATCH 2/3] ALSA: mpu401: Use common error handling code in snd_mpu401_uart_new()

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] ALSA: mpu401: Use common error handling code in snd_mpu401_uart_new()
Date 2017-08-13 03:10 +0200
Message-ID <udPzI-aT-9@gated-at.bofh.it> (permalink)
References <udK6Z-4Y3-5@gated-at.bofh.it> <udK6Z-4Y3-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] ALSA: mpu401: Adjustments for three function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-12 21:20 +0200
  [PATCH 2/3] ALSA: mpu401: Use common error handling code in  snd_mpu401_uart_new() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-12 21:20 +0200
    Re: [PATCH 2/3] ALSA: mpu401: Use common error handling code in  snd_mpu401_uart_new() Joe Perches <joe@perches.com> - 2017-08-13 03:10 +0200
  [PATCH 3/3] ALSA: mpu401: Adjust four checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-12 21:20 +0200
  Re: [PATCH 0/3] ALSA: mpu401: Adjustments for three function implementations Takashi Iwai <tiwai@suse.de> - 2017-08-12 23:40 +0200

csiph-web