From patchwork Fri Nov 28 18:59:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Chamberlin X-Patchwork-Id: 5405801 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 59D53BEEA8 for ; Fri, 28 Nov 2014 19:08:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EB73201C7 for ; Fri, 28 Nov 2014 19:08:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3FB6E2015E for ; Fri, 28 Nov 2014 19:08:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 06A88260542; Fri, 28 Nov 2014 20:08:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5B9BB2604D2; Fri, 28 Nov 2014 20:07:34 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 776C92604DC; Fri, 28 Nov 2014 19:58:02 +0100 (CET) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by alsa0.perex.cz (Postfix) with ESMTP id 690732604C2 for ; Fri, 28 Nov 2014 19:57:54 +0100 (CET) Received: by mail-ie0-f182.google.com with SMTP id x19so6544239ier.13 for ; Fri, 28 Nov 2014 10:57:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xUFQBeJSmmrkNBNhpWHO6GUTT7neqRWFwqeAETzbbKM=; b=Emf+aB8rOfiOsHEJ0HBS8ApG/YU44oB8oVERsF6ZYg95/ZEzQfuvPWPF46K9d2TXJ9 q27qoMhA1xmMXHIm2X84VJqhQHCNGyJPVasnIQAGOzu+dhBE3P3+POrsF458CGqXxWKY lROEBv+RiMcmBOXEDh+s16yky4whthOwqJwQCvnQ5rGomfHiBkcpEXijqGpt/A2KW14n SKiBe3nTzTTfCW3sfJgS9R3MKWCvRWczZR48njf34vKuuSmst2lyygsKn3zekEnhKJ1w jKCE6vvjP4e/+vv1vpaDYURtDuJThw8g1jCL7jj2DyEMOFZcrDauuhPHkyJ/WF1r5eqM r/Sg== X-Gm-Message-State: ALoCoQmFZ+cj5Io5bPJUJ2t4kQXc0Clq8h6oLtiDHMy+cIm+Ifn6lbMrfUfyqXuYelIEZ5ZYONho X-Received: by 10.50.6.112 with SMTP id z16mr34365389igz.43.1417201072892; Fri, 28 Nov 2014 10:57:52 -0800 (PST) Received: from ArchT440s.ntp.kentcommunications.com ([69.51.128.242]) by mx.google.com with ESMTPSA id c1sm11005862igo.17.2014.11.28.10.57.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Nov 2014 10:57:51 -0800 (PST) From: Kyle Chamberlin X-Google-Original-From: Kyle Chamberlin To: perex@perex.cz Date: Fri, 28 Nov 2014 13:59:56 -0500 Message-Id: <1417201196-12392-1-git-send-email-KyleChamberlin@project20million.org> X-Mailer: git-send-email 2.1.3 X-Mailman-Approved-At: Fri, 28 Nov 2014 20:07:32 +0100 Cc: tiwai@suse.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Kyle Chamberlin Subject: [alsa-devel] [PATCH] Sound: drivers: virmidi: fixed code style issues X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Fixed some minor code style issues and also removed some assignments inside of if conditionals. Signed-off-by: Kyle Chamberlin --- 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);