public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/acpi/ac.c: convert to seq_file
@ 2002-11-14 16:45 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2002-11-14 16:45 UTC (permalink / raw)
  To: andrew.grover; +Cc: Linux Kernel Mailing List, Linus Torvalds, aris, acpi-devel

Hi Andrew,

	Please consider pulling from:

bk://oops.kerneljanitors.org:acpi-2.5

	This is the first in a series of changesets converting
ACPI to seq_file, please lets us know if something is unacceptable.

	The work was done by Aristeu Rozanski.

- Arnaldo

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


ChangeSet@1.846, 2002-11-13 19:35:45-02:00, aris@cathedrallabs.org
  drivers/acpi/ac.c: convert to seq_file


 ac.c |   57 ++++++++++++++++++++++++++-------------------------------
 1 files changed, 26 insertions(+), 31 deletions(-)


diff -Nru a/drivers/acpi/ac.c b/drivers/acpi/ac.c
--- a/drivers/acpi/ac.c	Thu Nov 14 14:20:40 2002
+++ b/drivers/acpi/ac.c	Thu Nov 14 14:20:40 2002
@@ -29,6 +29,7 @@
 #include <linux/types.h>
 #include <linux/compatmac.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include "acpi_bus.h"
 #include "acpi_drivers.h"
 
@@ -53,6 +54,7 @@
 
 int acpi_ac_add (struct acpi_device *device);
 int acpi_ac_remove (struct acpi_device *device, int type);
+static int acpi_ac_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_ac_driver = {
 	.name =		ACPI_AC_DRIVER_NAME,
@@ -69,6 +71,12 @@
 	unsigned long		state;
 };
 
+static struct file_operations acpi_ac_fops = {
+	.open		= acpi_ac_open_fs,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
 
 /* --------------------------------------------------------------------------
                                AC Adapter Management
@@ -103,53 +111,40 @@
 
 struct proc_dir_entry		*acpi_ac_dir = NULL;
 
-static int
-acpi_ac_read_state (
-	char			*page,
-	char			**start,
-	off_t			off,
-	int 			count,
-	int 			*eof,
-	void			*data)
+int acpi_ac_seq_show(struct seq_file *seq, void *offset)
 {
-	struct acpi_ac		*ac = (struct acpi_ac *) data;
-	char			*p = page;
-	int			len = 0;
+	struct acpi_ac		*ac = (struct acpi_ac *) seq->private;
 
-	ACPI_FUNCTION_TRACE("acpi_ac_read_state");
+	ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
 
-	if (!ac || (off != 0))
-		goto end;
+	if (!ac)
+		return 0;
 
 	if (acpi_ac_get_state(ac)) {
-		p += sprintf(p, "ERROR: Unable to read AC Adapter state\n");
-		goto end;
+		seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
+		return 0;
 	}
 
-	p += sprintf(p, "state:                   ");
+	seq_puts(seq, "state:                   ");
 	switch (ac->state) {
 	case ACPI_AC_STATUS_OFFLINE:
-		p += sprintf(p, "off-line\n");
+		seq_puts(seq, "off-line\n");
 		break;
 	case ACPI_AC_STATUS_ONLINE:
-		p += sprintf(p, "on-line\n");
+		seq_puts(seq, "on-line\n");
 		break;
 	default:
-		p += sprintf(p, "unknown\n");
+		seq_puts(seq, "unknown\n");
 		break;
 	}
 
-end:
-	len = (p - page);
-	if (len <= off+count) *eof = 1;
-	*start = page + off;
-	len -= off;
-	if (len>count) len = count;
-	if (len<0) len = 0;
-
-	return_VALUE(len);
+	return 0;
+}
+	
+static int acpi_ac_open_fs(struct inode *inode, struct file *file)
+{
+	return single_open(file, acpi_ac_seq_show, PDE(inode)->data);
 }
-
 
 static int
 acpi_ac_add_fs (
@@ -180,7 +175,7 @@
 			"Unable to create '%s' fs entry\n",
 			ACPI_AC_FILE_STATE));
 	else {
-		entry->read_proc = acpi_ac_read_state;
+		entry->proc_fops = &acpi_ac_fops;
 		entry->data = acpi_driver_data(device);
 	}
 

===================================================================


This BitKeeper patch contains the following changesets:
1.846
## Wrapped with gzip_uu ##


begin 664 bkpatch5049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Y<H=T=8M5^:8M4J*X?2INV:T2JW,
M24=VM!UWJ>N:%LQK,/\J6+W$1C4V^AIVK1Z4?E)[;$"A;[$<6X4^V]@GY'T'
MZ:./!\Z=^!Q!P\7:)TIKP^3ZIE%Q-3N7J3"B:I"[\5R3B%5[JHSG266*#TXZ
C^G!C?GY^@RZ^_,4G2YD\E.O'03"?)SSB`?H,4J``R#X(````
`
end

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

* RE: [PATCH] drivers/acpi/ac.c: convert to seq_file
@ 2002-11-14 22:34 Grover, Andrew
  2002-11-15  5:37 ` Arnaldo Carvalho de Melo
  2002-11-23 17:02 ` [PATCHES] convert acpi " Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 4+ messages in thread
From: Grover, Andrew @ 2002-11-14 22:34 UTC (permalink / raw)
  To: 'Arnaldo Carvalho de Melo'
  Cc: Linux Kernel Mailing List, Linus Torvalds, aris, acpi-devel

> From: Arnaldo Carvalho de Melo [mailto:acme@conectiva.com.br] 
> 	Please consider pulling from:
> 
> bk://oops.kerneljanitors.org:acpi-2.5
> 
> 	This is the first in a series of changesets converting
> ACPI to seq_file, please lets us know if something is unacceptable.
> 
> 	The work was done by Aristeu Rozanski.

Hi acme,

Looks like an improvement. My thanks to you and Aristeu.

Let me know when you're done with all the changesets and I'll pull
everything.

Regards -- Andy

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

* Re: [PATCH] drivers/acpi/ac.c: convert to seq_file
  2002-11-14 22:34 [PATCH] drivers/acpi/ac.c: convert to seq_file Grover, Andrew
@ 2002-11-15  5:37 ` Arnaldo Carvalho de Melo
  2002-11-23 17:02 ` [PATCHES] convert acpi " Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2002-11-15  5:37 UTC (permalink / raw)
  To: Grover, Andrew
  Cc: Linux Kernel Mailing List, Linus Torvalds, aris, acpi-devel

Em Thu, Nov 14, 2002 at 02:34:35PM -0800, Grover, Andrew escreveu:
> > From: Arnaldo Carvalho de Melo [mailto:acme@conectiva.com.br] 
> > 	Please consider pulling from:
> > 
> > bk://oops.kerneljanitors.org:acpi-2.5
> > 
> > 	This is the first in a series of changesets converting
> > ACPI to seq_file, please lets us know if something is unacceptable.
> > 
> > 	The work was done by Aristeu Rozanski.
> 
> Hi acme,
> 
> Looks like an improvement. My thanks to you and Aristeu.

np
 
> Let me know when you're done with all the changesets and I'll pull
> everything.

mmmkay, I have already more than 10 changesets from Aristeu, its just a
matter of reviewing it all and I'll be back talking with you.

Best Regards,

- Arnaldo

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

* [PATCHES] convert acpi to seq_file
  2002-11-14 22:34 [PATCH] drivers/acpi/ac.c: convert to seq_file Grover, Andrew
  2002-11-15  5:37 ` Arnaldo Carvalho de Melo
@ 2002-11-23 17:02 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2002-11-23 17:02 UTC (permalink / raw)
  To: Grover, Andrew; +Cc: Linux Kernel Mailing List, aris, acpi-devel

Em Thu, Nov 14, 2002 at 02:34:35PM -0800, Grover, Andrew escreveu:
> > From: Arnaldo Carvalho de Melo [mailto:acme@conectiva.com.br] 
> > 	Please consider pulling from:
> > 
> > bk://oops.kerneljanitors.org:acpi-2.5
> > 
> > 	This is the first in a series of changesets converting
> > ACPI to seq_file, please lets us know if something is unacceptable.
> > 
> > 	The work was done by Aristeu Rozanski.
> 
> Hi acme,
> 
> Looks like an improvement. My thanks to you and Aristeu.
> 
> Let me know when you're done with all the changesets and I'll pull
> everything.

Andrew,

	Sorry for the delay, now you can pull all from:

bk://oops.kerneljanitors.org:acpi-2.5

or 

master.kernel.org:/home/acme/BK/acpi-2.5

Here is a summary of what was done:

ChangeSet@1.864, 2002-11-23 14:34:10-02:00, aris@cathedrallabs.org
  o acpi: convert drivers/acpi/toshiba_acpi.c to seq_file

ChangeSet@1.863, 2002-11-23 14:20:41-02:00, aris@cathedrallabs.org
  o acpi: convert drivers/acpi/thermal.c

ChangeSet@1.862, 2002-11-23 14:13:27-02:00, acme@conectiva.com.br
  o acpi/processor.o: fix up seq_file conversion, add missing comma

ChangeSet@1.861, 2002-11-23 13:57:42-02:00, aris@cathedrallabs.org
  o acpi: convert drivers/acpi/sleep.c to seq_file

ChangeSet@1.860, 2002-11-23 13:45:39-02:00, aris@cathedrallabs.org
  o acpi: convert drivers/acpi/processor.c to seq_file

ChangeSet@1.859, 2002-11-23 13:37:09-02:00, aris@cathedrallabs.org
  o acpi: convert drivers/acpi/power.c to seq_file

ChangeSet@1.805.15.3, 2002-11-15 05:43:42-02:00, aris@cathedrallabs.org
  o acpi: convert drivers/acpi/button.c to seq_file

ChangeSet@1.805.15.1, 2002-11-13 19:35:45-02:00, aris@cathedrallabs.org
  drivers/acpi/ac.c: convert to seq_file


Best Regards,

- Arnaldo

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

end of thread, other threads:[~2002-11-23 19:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-14 22:34 [PATCH] drivers/acpi/ac.c: convert to seq_file Grover, Andrew
2002-11-15  5:37 ` Arnaldo Carvalho de Melo
2002-11-23 17:02 ` [PATCHES] convert acpi " Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2002-11-14 16:45 [PATCH] drivers/acpi/ac.c: convert " Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox