Skip to contentSkip to conversation

aoa i2sbus: don't overwrite module parameter

PATCH Applied Johannes Berg 2 participants 3 messages Oct 23, 2008

Subsystems (2)
lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 aoa i2sbus: don't overwrite module parameter

We shouldn't modify a global variable here.

---
 sound/aoa/soundbus/i2sbus/i2sbus-core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/aoa/soundbus/i2sbus/i2sbus-core.c +3 -3
@@ -159,7 +159,7 @@ static int i2sbus_add_dev(struct macio_d
 	struct i2sbus_dev *dev;
 	struct device_node *child = NULL, *sound = NULL;
 	struct resource *r;
-	int i, layout = 0, rlen;
+	int i, layout = 0, rlen, ok = force;
 	static const char *rnames[] = { "i2sbus: %s (control)",
 					"i2sbus: %s (tx)",
 					"i2sbus: %s (rx)" };
@@ -192,7 +192,7 @@ static int i2sbus_add_dev(struct macio_d
 			layout = *layout_id;
 			snprintf(dev->sound.modalias, 32,
 				 "sound-layout-%d", layout);
-			force = 1;
+			ok = 1;
 		}
 	}
 	/* for the time being, until we can handle non-layout-id
@@ -201,7 +201,7 @@ static int i2sbus_add_dev(struct macio_d
 	 * When there are two i2s busses and only one has a layout-id,
 	 * then this depends on the order, but that isn't important
 	 * either as the second one in that case is just a modem. */
-	if (!force) {
+	if (!ok) {
 		kfree(dev);
 		return -ENODEV;
 	}
Applied
#1 lore raw

At Thu, 23 Oct 2008 13:57:39 +0200,

Quoted 4 lines · Johannes Berg

We shouldn't modify a global variable here.

Applied. This seems a good thing to go to 2.6.28, so I'll put it to the next pull request.

thanks,

Takashi

Quoted 35 lines
---
 sound/aoa/soundbus/i2sbus/i2sbus-core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/aoa/soundbus/i2sbus/i2sbus-core.c +3 -3
@@ -159,7 +159,7 @@ static int i2sbus_add_dev(struct macio_d
 	struct i2sbus_dev *dev;
 	struct device_node *child = NULL, *sound = NULL;
 	struct resource *r;
-	int i, layout = 0, rlen;
+	int i, layout = 0, rlen, ok = force;
 	static const char *rnames[] = { "i2sbus: %s (control)",
 					"i2sbus: %s (tx)",
 					"i2sbus: %s (rx)" };
@@ -192,7 +192,7 @@ static int i2sbus_add_dev(struct macio_d
 			layout = *layout_id;
 			snprintf(dev->sound.modalias, 32,
 				 "sound-layout-%d", layout);
-			force = 1;
+			ok = 1;
 		}
 	}
 	/* for the time being, until we can handle non-layout-id
@@ -201,7 +201,7 @@ static int i2sbus_add_dev(struct macio_d
 	 * When there are two i2s busses and only one has a layout-id,
 	 * then this depends on the order, but that isn't important
 	 * either as the second one in that case is just a modem. */
-	if (!force) {
+	if (!ok) {
 		kfree(dev);
 		return -ENODEV;
 	}
author maintainer
#2 lore raw
Quoted 9 lines · Takashi Iwai

At Thu, 23 Oct 2008 13:57:39 +0200,

Quoted 4 lines · Johannes Berg

We shouldn't modify a global variable here.

Applied. This seems a good thing to go to 2.6.28, so I'll put it to the next pull request.

Heh, well, it doesn't _really_ matter, it's just cleaner for reporting to userspace via sysfs what the module parameters are. It's been that way since I wrote it over two years ago, so ... up to you, I don't really care.

Thanks for taking it.

johannes

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel