alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH v3 2/3] portman2x4 - assignment in if
Date: Thu,  4 Feb 2016 22:08:22 +0530	[thread overview]
Message-ID: <1454603903-15967-2-git-send-email-sudipm.mukherjee@gmail.com> (raw)
In-Reply-To: <1454603903-15967-1-git-send-email-sudipm.mukherjee@gmail.com>

It is not general practice to assign some values inside if statement.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

v3: no change
v2: no change

 sound/drivers/portman2x4.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c
index 65b0650..172685d 100644
--- a/sound/drivers/portman2x4.c
+++ b/sound/drivers/portman2x4.c
@@ -743,7 +743,8 @@ static int snd_portman_probe(struct platform_device *pdev)
 	if (!enable[dev])
 		return -ENOENT;
 
-	if ((err = snd_portman_probe_port(p)) < 0)
+	err = snd_portman_probe_port(p);
+	if (err < 0)
 		return err;
 
 	err = snd_card_new(&pdev->dev, index[dev], id[dev], THIS_MODULE,
@@ -770,7 +771,8 @@ static int snd_portman_probe(struct platform_device *pdev)
 		goto __err;
 	}
 
-	if ((err = portman_create(card, pardev, &pm)) < 0) {
+	err = portman_create(card, pardev, &pm);
+	if (err < 0) {
 		snd_printd("Cannot create main component\n");
 		parport_unregister_device(pardev);
 		goto __err;
@@ -778,7 +780,8 @@ static int snd_portman_probe(struct platform_device *pdev)
 	card->private_data = pm;
 	card->private_free = snd_portman_card_private_free;
 
-	if ((err = snd_portman_rawmidi_create(card)) < 0) {
+	err = snd_portman_rawmidi_create(card);
+	if (err < 0) {
 		snd_printd("Creating Rawmidi component failed\n");
 		goto __err;
 	}
@@ -792,13 +795,15 @@ static int snd_portman_probe(struct platform_device *pdev)
 	pm->pardev_claimed = 1;
 
 	/* init device */
-	if ((err = portman_device_init(pm)) < 0)
+	err = portman_device_init(pm);
+	if (err < 0)
 		goto __err;
 
 	platform_set_drvdata(pdev, card);
 
 	/* At this point card will be usable */
-	if ((err = snd_card_register(card)) < 0) {
+	err = snd_card_register(card);
+	if (err < 0) {
 		snd_printd("Cannot register card\n");
 		goto __err;
 	}
@@ -850,7 +855,8 @@ static int __init snd_portman_module_init(void)
 {
 	int err;
 
-	if ((err = platform_driver_register(&snd_portman_driver)) < 0)
+	err = platform_driver_register(&snd_portman_driver);
+	if (err < 0)
 		return err;
 
 	if (parport_register_driver(&portman_parport_driver) != 0) {
-- 
1.9.1

  reply	other threads:[~2016-02-04 16:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 16:38 [PATCH v3 1/3] portman2x4 - whitespace fixes Sudip Mukherjee
2016-02-04 16:38 ` Sudip Mukherjee [this message]
2016-02-04 16:38 ` [PATCH v3 3/3] portman2x4 - use new parport device model Sudip Mukherjee
2016-02-04 16:51   ` Takashi Iwai
2016-02-05  6:17     ` Sudip Mukherjee
2016-02-05 11:55       ` Takashi Iwai
2016-02-05 16:50         ` Sudip Mukherjee
2016-02-05 17:01           ` Takashi Iwai
2016-02-05 17:04             ` Sudip Mukherjee
2016-02-05 17:06             ` Takashi Iwai
2016-02-05 17:21               ` Sudip Mukherjee
2016-02-05 19:11                 ` Takashi Iwai
2016-02-07 14:49                   ` Sudip Mukherjee
2016-02-09 11:32                     ` Takashi Iwai
2016-02-09 12:05                       ` Sudip Mukherjee

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=1454603903-15967-2-git-send-email-sudipm.mukherjee@gmail.com \
    --to=sudipm.mukherjee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).