From: Takashi Iwai <tiwai@suse.de>
To: Kyle Chamberlin <kylechamberlin@project20million.org>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Kyle Chamberlin <KyleChamberlin@project20million.org>
Subject: Re: [PATCH] Sound: drivers: virmidi: fixed code style issues
Date: Sat, 29 Nov 2014 21:36:39 +0100 [thread overview]
Message-ID: <s5h7fydbv6w.wl-tiwai@suse.de> (raw)
In-Reply-To: <1417201196-12392-1-git-send-email-KyleChamberlin@project20million.org>
At Fri, 28 Nov 2014 13:59:56 -0500,
Kyle Chamberlin wrote:
>
> Fixed some minor code style issues and also removed some
> assignments inside of if conditionals.
>
> Signed-off-by: Kyle Chamberlin <KyleChamberlin@project20million.org>
Thanks, applied.
But, it's better to keep your both from and sign-off addresses same at
the next time.
Takashi
> ---
> sound/drivers/virmidi.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
> index b17872429..0af88d9 100644
> --- a/sound/drivers/virmidi.c
> +++ b/sound/drivers/virmidi.c
> @@ -99,30 +99,33 @@ static int snd_virmidi_probe(struct platform_device *devptr)
>
> if (midi_devs[dev] > MAX_MIDI_DEVICES) {
> snd_printk(KERN_WARNING
> - "too much midi devices for virmidi %d: "
> - "force to use %d\n", dev, MAX_MIDI_DEVICES);
> + "too much midi devices for virmidi %d: force to use %d\n",
> + dev, MAX_MIDI_DEVICES);
> midi_devs[dev] = MAX_MIDI_DEVICES;
> }
> for (idx = 0; idx < midi_devs[dev]; idx++) {
> struct snd_rawmidi *rmidi;
> struct snd_virmidi_dev *rdev;
> - if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
> +
> + err = snd_virmidi_new(card, idx, &rmidi);
> + if (err < 0)
> goto __nodev;
> rdev = rmidi->private_data;
> vmidi->midi[idx] = rmidi;
> strcpy(rmidi->name, "Virtual Raw MIDI");
> rdev->seq_mode = SNDRV_VIRMIDI_SEQ_DISPATCH;
> }
> -
> +
> strcpy(card->driver, "VirMIDI");
> strcpy(card->shortname, "VirMIDI");
> sprintf(card->longname, "Virtual MIDI Card %i", dev + 1);
>
> - if ((err = snd_card_register(card)) == 0) {
> + err = snd_card_register(card);
> + if (err) {
> platform_set_drvdata(devptr, card);
> return 0;
> }
> - __nodev:
> +__nodev:
> snd_card_free(card);
> return err;
> }
> @@ -157,13 +160,15 @@ static int __init alsa_card_virmidi_init(void)
> {
> int i, cards, err;
>
> - if ((err = platform_driver_register(&snd_virmidi_driver)) < 0)
> + err = platform_driver_register(&snd_virmidi_driver);
> + if (err < 0)
> return err;
>
> cards = 0;
> for (i = 0; i < SNDRV_CARDS; i++) {
> struct platform_device *device;
> - if (! enable[i])
> +
> + if (!enable[i])
> continue;
> device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
> i, NULL, 0);
> --
> 2.1.3
>
WARNING: multiple messages have this Message-ID (diff)
From: Takashi Iwai <tiwai@suse.de>
To: Kyle Chamberlin <kylechamberlin@project20million.org>
Cc: perex@perex.cz, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org,
Kyle Chamberlin <KyleChamberlin@project20million.org>
Subject: Re: [PATCH] Sound: drivers: virmidi: fixed code style issues
Date: Sat, 29 Nov 2014 21:36:39 +0100 [thread overview]
Message-ID: <s5h7fydbv6w.wl-tiwai@suse.de> (raw)
In-Reply-To: <1417201196-12392-1-git-send-email-KyleChamberlin@project20million.org>
At Fri, 28 Nov 2014 13:59:56 -0500,
Kyle Chamberlin wrote:
>
> Fixed some minor code style issues and also removed some
> assignments inside of if conditionals.
>
> Signed-off-by: Kyle Chamberlin <KyleChamberlin@project20million.org>
Thanks, applied.
But, it's better to keep your both from and sign-off addresses same at
the next time.
Takashi
> ---
> sound/drivers/virmidi.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
> index b17872429..0af88d9 100644
> --- a/sound/drivers/virmidi.c
> +++ b/sound/drivers/virmidi.c
> @@ -99,30 +99,33 @@ static int snd_virmidi_probe(struct platform_device *devptr)
>
> if (midi_devs[dev] > MAX_MIDI_DEVICES) {
> snd_printk(KERN_WARNING
> - "too much midi devices for virmidi %d: "
> - "force to use %d\n", dev, MAX_MIDI_DEVICES);
> + "too much midi devices for virmidi %d: force to use %d\n",
> + dev, MAX_MIDI_DEVICES);
> midi_devs[dev] = MAX_MIDI_DEVICES;
> }
> for (idx = 0; idx < midi_devs[dev]; idx++) {
> struct snd_rawmidi *rmidi;
> struct snd_virmidi_dev *rdev;
> - if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
> +
> + err = snd_virmidi_new(card, idx, &rmidi);
> + if (err < 0)
> goto __nodev;
> rdev = rmidi->private_data;
> vmidi->midi[idx] = rmidi;
> strcpy(rmidi->name, "Virtual Raw MIDI");
> rdev->seq_mode = SNDRV_VIRMIDI_SEQ_DISPATCH;
> }
> -
> +
> strcpy(card->driver, "VirMIDI");
> strcpy(card->shortname, "VirMIDI");
> sprintf(card->longname, "Virtual MIDI Card %i", dev + 1);
>
> - if ((err = snd_card_register(card)) == 0) {
> + err = snd_card_register(card);
> + if (err) {
> platform_set_drvdata(devptr, card);
> return 0;
> }
> - __nodev:
> +__nodev:
> snd_card_free(card);
> return err;
> }
> @@ -157,13 +160,15 @@ static int __init alsa_card_virmidi_init(void)
> {
> int i, cards, err;
>
> - if ((err = platform_driver_register(&snd_virmidi_driver)) < 0)
> + err = platform_driver_register(&snd_virmidi_driver);
> + if (err < 0)
> return err;
>
> cards = 0;
> for (i = 0; i < SNDRV_CARDS; i++) {
> struct platform_device *device;
> - if (! enable[i])
> +
> + if (!enable[i])
> continue;
> device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
> i, NULL, 0);
> --
> 2.1.3
>
next prev parent reply other threads:[~2014-11-29 20:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-28 18:59 [PATCH] Sound: drivers: virmidi: fixed code style issues Kyle Chamberlin
2014-11-29 20:36 ` Takashi Iwai [this message]
2014-11-29 20:36 ` Takashi Iwai
2014-11-29 20:58 ` [PATCH] sound: use enum names instead of magic numbers Joe Perches
2014-11-30 4:52 ` Takashi Sakamoto
2014-11-30 4:52 ` Takashi Sakamoto
2014-11-30 4:57 ` Joe Perches
2014-11-30 8:41 ` Takashi Iwai
2014-11-30 8:55 ` Joe Perches
2014-11-30 9:04 ` Takashi Iwai
2014-11-30 19:26 ` Joe Perches
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=s5h7fydbv6w.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=kylechamberlin@project20million.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.