Skip to contentSkip to conversation

Remove pointless curr_queue calculation in block/cciss.c

PATCH In review Hannes Reinecke 2 participants 2 messages Jul 22, 2008 – Aug 4, 2008 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove pointless curr_queue calculation in block/cciss.c

Hi Mike,

in block/cciss.c:cciss_check_queues() curr_queue is calculated as the last statement in a for loop, although it's being initialized with the next round again and never been used afterwards. So this can be removed.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

Remove curr_queue calculation in block/cciss.c

curr_queue is a local variable in a for loop, and it's being initialized at the start of each loop. So any assignment at the end of the loop is pointless.

drivers/block/cciss.c +0 -2
index d81632c..0ce0c27 100644
@@ -1292,8 +1292,6 @@ static void cciss_check_queues(ctlr_info_t *h)
 				h->next_to_run = curr_queue;
 				break;
 			}
-		} else {
-			curr_queue = (curr_queue + 1) % (h->highest_lun + 1);
 		}
 	}
 }
#1 lore raw
Quoted 6 lines · Hannes Reinecke

Hi Mike,

in block/cciss.c:cciss_check_queues() curr_queue is calculated as the last statement in a for loop, although it's being initialized with the next round again and never been used afterwards. So this can be removed.

Indeed, pretty silly. Applied, thanks.

Signature · 1 line
Jens Axboe