Commit 4872acfd authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] fix proc handling in serverworks and sc1200 ide

parent 00c49324
......@@ -87,6 +87,7 @@ static int sc1200_get_info (char *buffer, char **addr, off_t offset, int count)
{
char *p = buffer;
unsigned long bibma = pci_resource_start(bmide_dev, 4);
int len;
u8 c0 = 0, c1 = 0;
/*
......@@ -111,7 +112,10 @@ static int sc1200_get_info (char *buffer, char **addr, off_t offset, int count)
p += sprintf(p, "DMA\n");
p += sprintf(p, "PIO\n");
return p-buffer;
len = (p - buffer) - offset;
*addr = buffer + offset;
return len > count ? count : len;
}
#endif /* DISPLAY_SC1200_TIMINGS && CONFIG_PROC_FS */
......
......@@ -57,7 +57,7 @@ static int n_svwks_devs;
static int svwks_get_info (char *buffer, char **addr, off_t offset, int count)
{
char *p = buffer;
int i;
int i, len;
p += sprintf(p, "\n "
"ServerWorks OSB4/CSB5/CSB6\n");
......@@ -195,7 +195,11 @@ static int svwks_get_info (char *buffer, char **addr, off_t offset, int count)
}
p += sprintf(p, "\n");
return p-buffer; /* => must be less than 4k! */
/* p - buffer must be less than 4k! */
len = (p - buffer) - offset;
*addr = buffer + offset;
return len > count ? count : len;
}
#endif /* defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment