Skip to contentSkip to conversation

drm/nouveau: Fix a complier warning in the card init error path

PATCH In review Jimmy Rentz 3 participants 4 messages Apr 17, 2011 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: Fix a complier warning in the card init error path

Fix an unitialized variable complier warning in nouveau_card_init.

drivers/gpu/drm/nouveau/nouveau_state.c +1 -1
index 3404950..66e8037 100644
@@ -679,7 +679,7 @@ out_fifo:
 		engine->fifo.takedown(dev);
 out_engine:
 	if (!nouveau_noaccel) {
-		for (e = e - 1; e >= 0; e--) {
+		for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) {
 			if (!dev_priv->eng[e])
 				continue;
 			dev_priv->eng[e]->fini(dev, e);

A message that is not in the archive (sent off-list or not yet received): 20110417161453.0310de4d-bEIzoA7YQWm4miubQJdzGGS2/mPcPMSI/[email protected]

#2 lore raw
Quoted 9 lines · Jimmy Rentz

Fix an unitialized variable complier warning in nouveau_card_init.

drivers/gpu/drm/nouveau/nouveau_state.c +0 -0
index 3404950..66e8037 100644

drivers/gpu/drm/nouveau/nouveau_state.c out_fifo: · line 685

Quoted 8 lines
drivers/gpu/drm/nouveau/nouveau_state.c +1 -1
@@ -679,7 +679,7 @@ out_fifo:
 		engine->fifo.takedown(dev);
 out_engine:
 	if (!nouveau_noaccel) {
-		for (e = e - 1; e >= 0; e--) {
+		for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) {
 			if (!dev_priv->eng[e])
 				continue;
 			dev_priv->eng[e]->fini(dev, e);

This code is supposed to handle the situation when one of engine initialization routines failed and this change will break it...

Marcin

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 22 lines · On Sun, 17 Apr 2011 23:18:36 +0200 Marcin Slusarz…
Quoted 9 lines · Jimmy Rentz

Fix an unitialized variable complier warning in nouveau_card_init.

(quoted diff) +0 -0

b/drivers/gpu/drm/nouveau/nouveau_state.c index 3404950..66e8037 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c

drivers/gpu/drm/nouveau/nouveau_state.c out_fifo: · line 685

Quoted 8 lines
drivers/gpu/drm/nouveau/nouveau_state.c +1 -1
@@ -679,7 +679,7 @@ out_fifo:
 		engine->fifo.takedown(dev);
 out_engine:
 	if (!nouveau_noaccel) {
-		for (e = e - 1; e >= 0; e--) {
+		for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) {
 			if (!dev_priv->eng[e])
 				continue;
 			dev_priv->eng[e]->fini(dev, e);

This code is supposed to handle the situation when one of engine initialization routines failed and this change will break it...

Quoted 1 line

Marcin

Really? It wasn't intentional. I didn't see the e referenced above.

A message that is not in the archive (sent off-list or not yet received): 20110417182745.212a6516-bEIzoA7YQWm4miubQJdzGGS2/mPcPMSI/[email protected]

#6 lore raw
Quoted 25 lines · Jimmy Rentz
Quoted 22 lines · On Sun, 17 Apr 2011 23:18:36 +0200 Marcin Slusarz…
Quoted 9 lines · Jimmy Rentz

Fix an unitialized variable complier warning in nouveau_card_init.

(quoted diff) +0 -0

b/drivers/gpu/drm/nouveau/nouveau_state.c index 3404950..66e8037 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c

drivers/gpu/drm/nouveau/nouveau_state.c out_fifo: · line 685

Quoted 8 lines
drivers/gpu/drm/nouveau/nouveau_state.c +1 -1
@@ -679,7 +679,7 @@ out_fifo:
 		engine->fifo.takedown(dev);
 out_engine:
 	if (!nouveau_noaccel) {
-		for (e = e - 1; e >= 0; e--) {
+		for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) {
 			if (!dev_priv->eng[e])
 				continue;
 			dev_priv->eng[e]->fini(dev, e);

This code is supposed to handle the situation when one of engine initialization routines failed and this change will break it...

Quoted 3 lines
Quoted 1 line

Marcin

Really? It wasn't intentional. I didn't see the e referenced above.

It's used above, but I don't think it's actually an error. The situation where it's uninitialised can't actually happen

I pushed a patch that'll silence any compiler that may be complaining.

Ben.

Quoted 4 lines

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau