Skip to contentSkip to conversation

Isn't sd_major() broken ?

DISCUSSION Pete Zaitcev 1 participant 1 message Apr 10, 2003 1 message not in the archive SCSI

lore
Share & tools
lore

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

#1 lore raw

scsi/sd.c static int sd_major(int major_idx) · line 129

Quoted 12 lines
scsi/sd.c renamed from scsi/sd.c.org +1 -1
@@ -123,7 +123,7 @@ static int sd_major(int major_idx)
 	case 1 ... 7:
 		return SCSI_DISK1_MAJOR + major_idx - 1;
 	case 8 ... 15:
-		return SCSI_DISK8_MAJOR + major_idx;
+		return SCSI_DISK8_MAJOR + major_idx - 8;
 	default:
 		BUG();
 		return 0;	/* shut up gcc */

Yes this seems good.

One is left to wonder, however, why 2.5 version is not using a little array of majors here.

-- Pete