0001-This-is-a-patch-to-the-gen-devlist.c-file-that-fixes.patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





This is my first patch.Do not judge me harshly, I'm just learning.
From 64d7d0cb3fe958ccdf279c45f6832f1df41239c7 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?=D0=9C=D1=83=D1=80=D0=B0=D1=88=D0=BE=D0=B2=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= <alex@alex-desktop.(none)>
Date: Fri, 28 May 2010 17:02:19 +0400
Subject: [PATCH] This is a patch to the gen-devlist.c file that fixes up a warnings with the lengths of lines and error with intended label found by the checkpatch.pl
 Signed-off-by: Alexandr Murashov <alex_mur_spb@mail.ru>

---
 drivers/zorro/gen-devlist.c |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/zorro/gen-devlist.c b/drivers/zorro/gen-devlist.c
index 16fe206..db08895 100644
--- a/drivers/zorro/gen-devlist.c
+++ b/drivers/zorro/gen-devlist.c
@@ -43,7 +43,7 @@ main(void)
 
 	while (fgets(line, sizeof(line)-1, stdin)) {
 		lino++;
-		if ((c = strchr(line, '\n')))
+		if c = strchr(line, '\n')
 			*c = 0;
 		if (!line[0] || line[0] == '#')
 			continue;
@@ -54,20 +54,26 @@ main(void)
 					c = line + 5;
 					while (*c == ' ')
 						*c++ = 0;
-					if (manuf_len + strlen(c) + 1 > MAX_NAME_SIZE) {
-						/* Too long, try cutting off long description */
+					if (manuf_len + strlen(c) + 1\
+							 > MAX_NAME_SIZE) {
 						bra = strchr(c, '[');
-						if (bra && bra > c && bra[-1] == ' ')
+						if (bra && bra > c && bra[-1]\
+									== ' ')
 							bra[-1] = 0;
-						if (manuf_len + strlen(c) + 1 > MAX_NAME_SIZE) {
-							fprintf(stderr, "Line %d: Product name too long\n", lino);
+						if (manuf_len + strlen(c) + 1\
+							> MAX_NAME_SIZE) {
+							fprintf(stderr, \
+				"Line %d: Product name too long\n", lino);
 							return 1;
 						}
 					}
-					fprintf(devf, "\tPRODUCT(%s,%s,\"", manuf, line+1);
+					fprintf(devf, "\tPRODUCT(%s,%s,\"",\
+								manuf, line+1);
 					pq(devf, c);
 					fputs("\")\n", devf);
-				} else goto err;
+				} else {
+					goto err;
+					}
 				break;
 			default:
 				goto err;
@@ -82,7 +88,8 @@ main(void)
 			strcpy(manuf, line);
 			manuf_len = strlen(c);
 			if (manuf_len + 24 > MAX_NAME_SIZE) {
-				fprintf(stderr, "Line %d: manufacturer name too long\n", lino);
+				fprintf(stderr, "Line %d: manufacturer	\
+				name too long\n", lino);
 				return 1;
 			}
 			fprintf(devf, "MANUF(%s,\"", manuf);
@@ -90,8 +97,9 @@ main(void)
 			fputs("\")\n", devf);
 			mode = 1;
 		} else {
-		err:
-			fprintf(stderr, "Line %d: Syntax error in mode %d: %s\n", lino, mode, line);
+err:
+			fprintf(stderr, "Line %d: Syntax error in mode \
+			%d: %s\n", lino, mode, line);
 			return 1;
 		}
 	}
-- 
1.6.3.3


[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux