Re: Question about /proc/ide

tenthumbs (10@dhyp2-150.cybernex.net)
Fri, 15 Oct 1999 11:12:32 -0400 (EDT)


On Thu, 14 Oct 1999, Wakko Warner wrote:

> > No.
> > The patch below will make them positive again, I suppose.
> > (this is on /usr/src/linux/drivers/block/ide-proc.c or so)
> >
> >
> > --- ide-proc.c~ Wed May 6 23:42:53 1998
> > +++ ide-proc.c Thu Oct 14 18:18:31 1999
> > @@ -516,8 +516,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);
>
> shouldn't that be %u instead of %d?
>

I would say %hu. Cyl and bios_cyl are unsigned shorts and the rest are
unsigned chars. Something like this:

--- linux-2.2.12/drivers/block/ide-proc.c.orig Wed May 6 17:42:53 1998
+++ linux-2.2.12/drivers/block/ide-proc.c Fri Oct 15 11:05:58 1999
@@ -516,8 +516,8 @@
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 %hu/%hu/%hu\n", drive->cyl, drive->head, drive->sect);
+ out += sprintf(out,"logical %hu/%hu/%hu\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/