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


Groups > linux.kernel > #1322309 > unrolled thread

[PATCH v2 2/3] [ALSA] portman2x4 - assignment in if

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2016-01-30 10:40 +0100
Last post2016-01-30 10:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 2/3] [ALSA] portman2x4 - assignment in if Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-01-30 10:40 +0100

#1322309 — [PATCH v2 2/3] [ALSA] portman2x4 - assignment in if

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2016-01-30 10:40 +0100
Subject[PATCH v2 2/3] [ALSA] portman2x4 - assignment in if
Message-ID<qWAaD-Eg-33@gated-at.bofh.it>
It is not general practice to assign some values inside if statement.

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

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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web