Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Ultrix compat_label: is loop useless?



Looking at sys/arch/vax/vax/disksubr.c on one of my systems, I noticed
something.  cvsweb makes me think it's present in -current too.

In compat_label(), there is a loop that looks to me like

	for (step dlp through dp, ie bp->b_data, by sizeof(long) {
		if (dlp->magic != DEC_LABEL_MAGIC) {
			print gripe
			goto done;
		}
		convert to in-core label
		break;
	}
done:

What function does the loop serve?  It looks to me as though it is
always exited, via either goto or break, on its very first iteration,
and thus could be replaced by just the assignment in the for loop's
init part.  (For that matter, the goto could be replaced by another
break, but that's far less of an issue.)

Of course, the flow control needs a little rearrangement without the
loop around it, but only a little.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index