[PATCH] tiny fix for ide-proc.c

Andries.Brouwer@cwi.nl
Mon, 21 Jun 1999 17:23:21 +0200 (MET DST)


I just noticed

% cat /proc/ide/hda/geometry
physical -32053/16/63
logical -32053/16/63
% dmesg | grep hda
...
hda: Maxtor 91728D8, 16479MB w/512kB Cache, CHS=33483/16/63, (U)DMA
...

So, somebody casts an unsigned short to short.
A patch follows [pasted from screen - tabs will have become spaces].

Andries

--- ide-proc.c~ Sat May 15 21:11:22 1999
+++ ide-proc.c Mon Jun 21 17:13:39 1999
@@ -525,8 +525,10 @@
char *out = page;
int len;

- out += sprintf(out,"physical %hi/%hi/%hi\n", drive->cyl, drive->head, drive->sect);
- out += sprintf(out,"logical %hi/%hi/%hi\n", drive->bios_cyl, drive->bios_head, drive->bios_sect);
+ out += sprintf(out,"physical %d/%d/%d\n",
+ drive->cyl, drive->head, drive->sect);
+ out += sprintf(out,"logical %d/%d/%d\n",
+ drive->bios_cyl, drive->bios_head, drive->bios_sect);
len = out - page;
PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/