lkml.org 
[lkml]   [1999]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] tiny fix for ide-proc.c
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/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.070 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site