All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trivial: cleanup hpfall example code (checkpatch)
@ 2009-06-22  9:08 Frans Pop
  2009-06-22 17:21 ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Frans Pop @ 2009-06-22  9:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jiri Kosina, Pavel Machek

This patch makes hpfall.c conform to kernel coding style.

I have not fixed the C99 // comments on two lines as they
help indicate that those are not actually comments but
incomplete code.

Before:
 total: 10 errors, 6 warnings, 101 lines checked
After:
 total: 2 errors, 0 warnings, 99 lines checked

Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Pavel Machek <pavel@suse.cz>

diff --git a/Documentation/hwmon/hpfall.c b/Documentation/hwmon/hpfall.c
index bbea1cc..d2f6711 100644
--- a/Documentation/hwmon/hpfall.c
+++ b/Documentation/hwmon/hpfall.c
@@ -57,45 +57,43 @@ void ignore_me(void)
 {
 	protect(0);
 	set_led(0);
-
 }
 
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
 {
-       int fd, ret;
+	int fd, ret;
 
-       fd = open("/dev/freefall", O_RDONLY);
-       if (fd < 0) {
-               perror("open");
-               return EXIT_FAILURE;
-       }
+	fd = open("/dev/freefall", O_RDONLY);
+	if (fd < 0) {
+		perror("open");
+		return EXIT_FAILURE;
+	}
 
 	signal(SIGALRM, ignore_me);
 
-       for (;;) {
-	       unsigned char count;
-
-               ret = read(fd, &count, sizeof(count));
-	       alarm(0);
-	       if ((ret == -1) && (errno == EINTR)) {
-		       /* Alarm expired, time to unpark the heads */
-		       continue;
-	       }
-
-               if (ret != sizeof(count)) {
-                       perror("read");
-                       break;
-               }
-
-	       protect(21);
-	       set_led(1);
-	       if (1 || on_ac() || lid_open()) {
-		       alarm(2);
-	       } else {
-		       alarm(20);
-	       }
-       }
+	for (;;) {
+		unsigned char count;
+
+		ret = read(fd, &count, sizeof(count));
+		alarm(0);
+		if ((ret == -1) && (errno == EINTR)) {
+			/* Alarm expired, time to unpark the heads */
+			continue;
+		}
+
+		if (ret != sizeof(count)) {
+			perror("read");
+			break;
+		}
+
+		protect(21);
+		set_led(1);
+		if (1 || on_ac() || lid_open())
+			alarm(2);
+		else
+			alarm(20);
+	}
 
-       close(fd);
-       return EXIT_SUCCESS;
+	close(fd);
+	return EXIT_SUCCESS;
 }

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

* Re: [PATCH] trivial: cleanup hpfall example code (checkpatch)
  2009-06-22  9:08 [PATCH] trivial: cleanup hpfall example code (checkpatch) Frans Pop
@ 2009-06-22 17:21 ` Pavel Machek
  2009-06-23  9:20   ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2009-06-22 17:21 UTC (permalink / raw)
  To: Frans Pop; +Cc: linux-kernel, Jiri Kosina

On Mon 2009-06-22 11:08:36, Frans Pop wrote:
> This patch makes hpfall.c conform to kernel coding style.
> 
> I have not fixed the C99 // comments on two lines as they
> help indicate that those are not actually comments but
> incomplete code.
> 
> Before:
>  total: 10 errors, 6 warnings, 101 lines checked
> After:
>  total: 2 errors, 0 warnings, 99 lines checked
> 
> Signed-off-by: Frans Pop <elendil@planet.nl>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH] trivial: cleanup hpfall example code (checkpatch)
  2009-06-22 17:21 ` Pavel Machek
@ 2009-06-23  9:20   ` Jiri Kosina
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2009-06-23  9:20 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Frans Pop, linux-kernel

On Mon, 22 Jun 2009, Pavel Machek wrote:

> On Mon 2009-06-22 11:08:36, Frans Pop wrote:
> > This patch makes hpfall.c conform to kernel coding style.
> > 
> > I have not fixed the C99 // comments on two lines as they
> > help indicate that those are not actually comments but
> > incomplete code.
> > 
> > Before:
> >  total: 10 errors, 6 warnings, 101 lines checked
> > After:
> >  total: 2 errors, 0 warnings, 99 lines checked
> > 
> > Signed-off-by: Frans Pop <elendil@planet.nl>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>

Applied, thanks Frans.

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2009-06-23  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-22  9:08 [PATCH] trivial: cleanup hpfall example code (checkpatch) Frans Pop
2009-06-22 17:21 ` Pavel Machek
2009-06-23  9:20   ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.