linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: fix proc handling in sis, siimageand slc90e66
@ 2003-03-21 19:36 Alan Cox
  2003-03-22  7:49 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2003-03-21 19:36 UTC (permalink / raw)
  To: linux-kernel, torvalds

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/drivers/ide/pci/siimage.c linux-2.5.65-ac2/drivers/ide/pci/siimage.c
--- linux-2.5.65/drivers/ide/pci/siimage.c	2003-03-03 19:20:09.000000000 +0000
+++ linux-2.5.65-ac2/drivers/ide/pci/siimage.c	2003-03-06 23:35:51.000000000 +0000
@@ -55,6 +55,7 @@
 static int siimage_get_info (char *buffer, char **addr, off_t offset, int count)
 {
 	char *p = buffer;
+	int len;
 	u16 i;
 
 	p += sprintf(p, "\n");
@@ -62,7 +63,11 @@
 		struct pci_dev *dev	= siimage_devs[i];
 		p = print_siimage_get_info(p, dev, i);
 	}
-	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_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) */
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/drivers/ide/pci/sis5513.c linux-2.5.65-ac2/drivers/ide/pci/sis5513.c
--- linux-2.5.65/drivers/ide/pci/sis5513.c	2003-03-03 19:20:09.000000000 +0000
+++ linux-2.5.65-ac2/drivers/ide/pci/sis5513.c	2003-03-06 23:35:34.000000000 +0000
@@ -424,6 +424,7 @@
 static int sis_get_info (char *buffer, char **addr, off_t offset, int count)
 {
 	char *p = buffer;
+	int len;
 	u8 reg;
 	u16 reg2, reg3;
 
@@ -494,7 +495,10 @@
 	p = get_masters_info(p);
 	p = get_slaves_info(p);
 
-	return p-buffer;
+	len = (p - buffer) - offset;
+	*addr = buffer + offset;
+	
+	return len > count ? count : len;
 }
 #endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */
 
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/drivers/ide/pci/slc90e66.c linux-2.5.65-ac2/drivers/ide/pci/slc90e66.c
--- linux-2.5.65/drivers/ide/pci/slc90e66.c	2003-03-03 19:20:09.000000000 +0000
+++ linux-2.5.65-ac2/drivers/ide/pci/slc90e66.c	2003-03-06 23:34:56.000000000 +0000
@@ -34,8 +34,9 @@
 static int slc90e66_get_info (char *buffer, char **addr, off_t offset, int count)
 {
 	char *p = buffer;
+	int len;
 	unsigned long bibma = pci_resource_start(bmide_dev, 4);
-        u16 reg40 = 0, psitre = 0, reg42 = 0, ssitre = 0;
+	u16 reg40 = 0, psitre = 0, reg42 = 0, ssitre = 0;
 	u8  c0 = 0, c1 = 0;
 	u8  reg44 = 0, reg47 = 0, reg48 = 0, reg4a = 0, reg4b = 0;
 
@@ -110,7 +111,11 @@
  *	FIXME.... Add configuration junk data....blah blah......
  */
 
-	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_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: fix proc handling in sis, siimageand slc90e66
  2003-03-21 19:36 PATCH: fix proc handling in sis, siimageand slc90e66 Alan Cox
@ 2003-03-22  7:49 ` Christoph Hellwig
  2003-03-22 15:03   ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2003-03-22  7:49 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, torvalds

On Fri, Mar 21, 2003 at 07:36:12PM +0000, Alan Cox wrote:
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/drivers/ide/pci/siimage.c linux-2.5.65-ac2/drivers/ide/pci/siimage.c
> --- linux-2.5.65/drivers/ide/pci/siimage.c	2003-03-03 19:20:09.000000000 +0000
> +++ linux-2.5.65-ac2/drivers/ide/pci/siimage.c	2003-03-06 23:35:51.000000000 +0000
> @@ -55,6 +55,7 @@
>  static int siimage_get_info (char *buffer, char **addr, off_t offset, int count)
>  {
>  	char *p = buffer;
> +	int len;
>  	u16 i;
>  
>  	p += sprintf(p, "\n");
> @@ -62,7 +63,11 @@
>  		struct pci_dev *dev	= siimage_devs[i];
>  		p = print_siimage_get_info(p, dev, i);
>  	}
> -	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;

Shouldn't this just move to the seq_file interface?  (probably the "simple"
variant)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: fix proc handling in sis, siimageand slc90e66
  2003-03-22 15:03   ` Alan Cox
@ 2003-03-22 14:15     ` Christoph Hellwig
  2003-03-22 17:34       ` Randy.Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2003-03-22 14:15 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List, Linus Torvalds

On Sat, Mar 22, 2003 at 03:03:06PM +0000, Alan Cox wrote:
> On Sat, 2003-03-22 at 07:49, Christoph Hellwig wrote:
> > > +	
> > > +	return len > count ? count : len;
> > 
> > Shouldn't this just move to the seq_file interface?  (probably the "simple"
> > variant)
> 
> That means making the 2.4 and 2.5 drives diverge which is a pain I don't want 
> before 2.6

The seq_file interface is already and a backport of the single stuff is
trivial and should happen anyway.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: fix proc handling in sis, siimageand slc90e66
  2003-03-22  7:49 ` Christoph Hellwig
@ 2003-03-22 15:03   ` Alan Cox
  2003-03-22 14:15     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2003-03-22 15:03 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Linux Kernel Mailing List, Linus Torvalds

On Sat, 2003-03-22 at 07:49, Christoph Hellwig wrote:
> > +	
> > +	return len > count ? count : len;
> 
> Shouldn't this just move to the seq_file interface?  (probably the "simple"
> variant)

That means making the 2.4 and 2.5 drives diverge which is a pain I don't want 
before 2.6


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: fix proc handling in sis, siimageand slc90e66
  2003-03-22 14:15     ` Christoph Hellwig
@ 2003-03-22 17:34       ` Randy.Dunlap
  0 siblings, 0 replies; 5+ messages in thread
From: Randy.Dunlap @ 2003-03-22 17:34 UTC (permalink / raw)
  To: hch; +Cc: alan, linux-kernel, torvalds

> On Sat, Mar 22, 2003 at 03:03:06PM +0000, Alan Cox wrote:
>> On Sat, 2003-03-22 at 07:49, Christoph Hellwig wrote:
>> > > +
>> > > +	return len > count ? count : len;
>> >
>> > Shouldn't this just move to the seq_file interface?  (probably the
>> "simple" variant)
>>
>> That means making the 2.4 and 2.5 drives diverge which is a pain I don't
>> want  before 2.6
>
> The seq_file interface is already and a backport of the single stuff is
> trivial and should happen anyway.

I agree.  I helped someone do that for /proc/mdstat[s?] in 2.4
about 2 weeks ago.  Very simple to do.

~Randy




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-22 17:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21 19:36 PATCH: fix proc handling in sis, siimageand slc90e66 Alan Cox
2003-03-22  7:49 ` Christoph Hellwig
2003-03-22 15:03   ` Alan Cox
2003-03-22 14:15     ` Christoph Hellwig
2003-03-22 17:34       ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).