diff options
author | Mark Hounschell <markh@compro.net> | 2014-03-19 15:46:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-19 16:54:39 -0400 |
commit | 67d5dc8a69bf91720f0a8fdeaa5ef94c42d1637e (patch) | |
tree | 782c23809f08928d9946b03799115e3a13ee2559 | |
parent | 65fbed376a2d731005a5bd7f808c1bb5ac718a57 (diff) |
staging: dgap: fix the rest of the checkpatch warnings in dgap.c
This patch fixes all the simple_strtol and simple_strtoul warnings
as reported by checkpatch. After this patch, checkpatch will report
zero errors or warnings on dgap.c.
Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/dgap/dgap.c | 69 | ||||
-rw-r--r-- | drivers/staging/dgap/dgap.h | 36 |
2 files changed, 42 insertions, 63 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index ace6be7b8986..a5fc3c75ed4e 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c | |||
@@ -6462,7 +6462,7 @@ static ssize_t dgap_tty_name_show(struct device *d, | |||
6462 | if (cn != (i + ncount)) | 6462 | if (cn != (i + ncount)) |
6463 | continue; | 6463 | continue; |
6464 | 6464 | ||
6465 | return snprintf(buf, PAGE_SIZE, "%s%s%02d\n", | 6465 | return snprintf(buf, PAGE_SIZE, "%s%s%02ld\n", |
6466 | (un->un_type == DGAP_PRINT) ? | 6466 | (un->un_type == DGAP_PRINT) ? |
6467 | "pr" : "tty", | 6467 | "pr" : "tty", |
6468 | cptr->u.conc.id, | 6468 | cptr->u.conc.id, |
@@ -6479,7 +6479,7 @@ static ssize_t dgap_tty_name_show(struct device *d, | |||
6479 | if (cn != (i + ncount)) | 6479 | if (cn != (i + ncount)) |
6480 | continue; | 6480 | continue; |
6481 | 6481 | ||
6482 | return snprintf(buf, PAGE_SIZE, "%s%s%02d\n", | 6482 | return snprintf(buf, PAGE_SIZE, "%s%s%02ld\n", |
6483 | (un->un_type == DGAP_PRINT) ? | 6483 | (un->un_type == DGAP_PRINT) ? |
6484 | "pr" : "tty", | 6484 | "pr" : "tty", |
6485 | cptr->u.module.id, | 6485 | cptr->u.module.id, |
@@ -6542,7 +6542,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6542 | { | 6542 | { |
6543 | struct cnode *p, *brd, *line, *conc; | 6543 | struct cnode *p, *brd, *line, *conc; |
6544 | int rc; | 6544 | int rc; |
6545 | char *s = NULL, *s2 = NULL; | 6545 | char *s = NULL; |
6546 | int linecnt = 0; | 6546 | int linecnt = 0; |
6547 | 6547 | ||
6548 | p = &dgap_head; | 6548 | p = &dgap_head; |
@@ -6688,8 +6688,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6688 | return -1; | 6688 | return -1; |
6689 | } | 6689 | } |
6690 | p->u.board.portstr = dgap_savestring(s); | 6690 | p->u.board.portstr = dgap_savestring(s); |
6691 | p->u.board.port = (short)simple_strtol(s, &s2, 0); | 6691 | if (kstrtol(s, 0, &p->u.board.port)) { |
6692 | if ((short)strlen(s) > (short)(s2 - s)) { | ||
6693 | dgap_err("bad number for IO port"); | 6692 | dgap_err("bad number for IO port"); |
6694 | return -1; | 6693 | return -1; |
6695 | } | 6694 | } |
@@ -6707,8 +6706,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6707 | return -1; | 6706 | return -1; |
6708 | } | 6707 | } |
6709 | p->u.board.addrstr = dgap_savestring(s); | 6708 | p->u.board.addrstr = dgap_savestring(s); |
6710 | p->u.board.addr = simple_strtoul(s, &s2, 0); | 6709 | if (kstrtoul(s, 0, &p->u.board.addr)) { |
6711 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6712 | dgap_err("bad number for memory address"); | 6710 | dgap_err("bad number for memory address"); |
6713 | return -1; | 6711 | return -1; |
6714 | } | 6712 | } |
@@ -6726,8 +6724,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6726 | return -1; | 6724 | return -1; |
6727 | } | 6725 | } |
6728 | p->u.board.pcibusstr = dgap_savestring(s); | 6726 | p->u.board.pcibusstr = dgap_savestring(s); |
6729 | p->u.board.pcibus = simple_strtoul(s, &s2, 0); | 6727 | if (kstrtoul(s, 0, &p->u.board.pcibus)) { |
6730 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6731 | dgap_err("bad number for pci bus"); | 6728 | dgap_err("bad number for pci bus"); |
6732 | return -1; | 6729 | return -1; |
6733 | } | 6730 | } |
@@ -6738,8 +6735,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6738 | return -1; | 6735 | return -1; |
6739 | } | 6736 | } |
6740 | p->u.board.pcislotstr = dgap_savestring(s); | 6737 | p->u.board.pcislotstr = dgap_savestring(s); |
6741 | p->u.board.pcislot = simple_strtoul(s, &s2, 0); | 6738 | if (kstrtoul(s, 0, &p->u.board.pcislot)) { |
6742 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6743 | dgap_err("bad number for pci slot"); | 6739 | dgap_err("bad number for pci slot"); |
6744 | return -1; | 6740 | return -1; |
6745 | } | 6741 | } |
@@ -6780,8 +6776,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6780 | dgap_err("unexpected end of file"); | 6776 | dgap_err("unexpected end of file"); |
6781 | return -1; | 6777 | return -1; |
6782 | } | 6778 | } |
6783 | p->u.board.nport = (char)simple_strtol(s, &s2, 0); | 6779 | if (kstrtol(s, 0, &p->u.board.nport)) { |
6784 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6785 | dgap_err("bad number for number of ports"); | 6780 | dgap_err("bad number for number of ports"); |
6786 | return -1; | 6781 | return -1; |
6787 | } | 6782 | } |
@@ -6792,8 +6787,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6792 | dgap_err("unexpected end of file"); | 6787 | dgap_err("unexpected end of file"); |
6793 | return -1; | 6788 | return -1; |
6794 | } | 6789 | } |
6795 | p->u.conc.nport = (char)simple_strtol(s, &s2, 0); | 6790 | if (kstrtol(s, 0, &p->u.conc.nport)) { |
6796 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6797 | dgap_err("bad number for number of ports"); | 6791 | dgap_err("bad number for number of ports"); |
6798 | return -1; | 6792 | return -1; |
6799 | } | 6793 | } |
@@ -6804,8 +6798,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6804 | dgap_err("unexpected end of file"); | 6798 | dgap_err("unexpected end of file"); |
6805 | return -1; | 6799 | return -1; |
6806 | } | 6800 | } |
6807 | p->u.module.nport = (char)simple_strtol(s, &s2, 0); | 6801 | if (kstrtol(s, 0, &p->u.module.nport)) { |
6808 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6809 | dgap_err("bad number for number of ports"); | 6802 | dgap_err("bad number for number of ports"); |
6810 | return -1; | 6803 | return -1; |
6811 | } | 6804 | } |
@@ -6844,8 +6837,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6844 | dgap_err("unexpected end of file"); | 6837 | dgap_err("unexpected end of file"); |
6845 | return -1; | 6838 | return -1; |
6846 | } | 6839 | } |
6847 | p->u.board.start = simple_strtol(s, &s2, 0); | 6840 | if (kstrtol(s, 0, &p->u.board.start)) { |
6848 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6849 | dgap_err("bad number for start of tty count"); | 6841 | dgap_err("bad number for start of tty count"); |
6850 | return -1; | 6842 | return -1; |
6851 | } | 6843 | } |
@@ -6856,8 +6848,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6856 | dgap_err("unexpected end of file"); | 6848 | dgap_err("unexpected end of file"); |
6857 | return -1; | 6849 | return -1; |
6858 | } | 6850 | } |
6859 | p->u.conc.start = simple_strtol(s, &s2, 0); | 6851 | if (kstrtol(s, 0, &p->u.conc.start)) { |
6860 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6861 | dgap_err("bad number for start of tty count"); | 6852 | dgap_err("bad number for start of tty count"); |
6862 | return -1; | 6853 | return -1; |
6863 | } | 6854 | } |
@@ -6868,8 +6859,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
6868 | dgap_err("unexpected end of file"); | 6859 | dgap_err("unexpected end of file"); |
6869 | return -1; | 6860 | return -1; |
6870 | } | 6861 | } |
6871 | p->u.module.start = simple_strtol(s, &s2, 0); | 6862 | if (kstrtol(s, 0, &p->u.module.start)) { |
6872 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
6873 | dgap_err("bad number for start of tty count"); | 6863 | dgap_err("bad number for start of tty count"); |
6874 | return -1; | 6864 | return -1; |
6875 | } | 6865 | } |
@@ -7051,8 +7041,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7051 | dgap_err("unexpected end of file"); | 7041 | dgap_err("unexpected end of file"); |
7052 | return -1; | 7042 | return -1; |
7053 | } | 7043 | } |
7054 | p->u.line.speed = (char)simple_strtol(s, &s2, 0); | 7044 | if (kstrtol(s, 0, &p->u.line.speed)) { |
7055 | if ((short)strlen(s) > (short)(s2 - s)) { | ||
7056 | dgap_err("bad number for line speed"); | 7045 | dgap_err("bad number for line speed"); |
7057 | return -1; | 7046 | return -1; |
7058 | } | 7047 | } |
@@ -7063,8 +7052,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7063 | dgap_err("unexpected end of file"); | 7052 | dgap_err("unexpected end of file"); |
7064 | return -1; | 7053 | return -1; |
7065 | } | 7054 | } |
7066 | p->u.conc.speed = (char)simple_strtol(s, &s2, 0); | 7055 | if (kstrtol(s, 0, &p->u.conc.speed)) { |
7067 | if ((short)strlen(s) > (short)(s2 - s)) { | ||
7068 | dgap_err("bad number for line speed"); | 7056 | dgap_err("bad number for line speed"); |
7069 | return -1; | 7057 | return -1; |
7070 | } | 7058 | } |
@@ -7121,8 +7109,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7121 | dgap_err("unexpected end of file"); | 7109 | dgap_err("unexpected end of file"); |
7122 | return -1; | 7110 | return -1; |
7123 | } | 7111 | } |
7124 | p->u.majornumber = simple_strtol(s, &s2, 0); | 7112 | if (kstrtol(s, 0, &p->u.majornumber)) { |
7125 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7126 | dgap_err("bad number for major number"); | 7113 | dgap_err("bad number for major number"); |
7127 | return -1; | 7114 | return -1; |
7128 | } | 7115 | } |
@@ -7142,8 +7129,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7142 | dgap_err("unexpected end of file"); | 7129 | dgap_err("unexpected end of file"); |
7143 | return -1; | 7130 | return -1; |
7144 | } | 7131 | } |
7145 | p->u.altpin = simple_strtol(s, &s2, 0); | 7132 | if (kstrtol(s, 0, &p->u.altpin)) { |
7146 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7147 | dgap_err("bad number for altpin"); | 7133 | dgap_err("bad number for altpin"); |
7148 | return -1; | 7134 | return -1; |
7149 | } | 7135 | } |
@@ -7163,8 +7149,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7163 | dgap_err("unexpected end of file"); | 7149 | dgap_err("unexpected end of file"); |
7164 | return -1; | 7150 | return -1; |
7165 | } | 7151 | } |
7166 | p->u.useintr = simple_strtol(s, &s2, 0); | 7152 | if (kstrtol(s, 0, &p->u.useintr)) { |
7167 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7168 | dgap_err("bad number for useintr"); | 7153 | dgap_err("bad number for useintr"); |
7169 | return -1; | 7154 | return -1; |
7170 | } | 7155 | } |
@@ -7184,8 +7169,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7184 | dgap_err("unexpected end of file"); | 7169 | dgap_err("unexpected end of file"); |
7185 | return -1; | 7170 | return -1; |
7186 | } | 7171 | } |
7187 | p->u.ttysize = simple_strtol(s, &s2, 0); | 7172 | if (kstrtol(s, 0, &p->u.ttysize)) { |
7188 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7189 | dgap_err("bad number for ttysize"); | 7173 | dgap_err("bad number for ttysize"); |
7190 | return -1; | 7174 | return -1; |
7191 | } | 7175 | } |
@@ -7205,8 +7189,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7205 | dgap_err("unexpected end of file"); | 7189 | dgap_err("unexpected end of file"); |
7206 | return -1; | 7190 | return -1; |
7207 | } | 7191 | } |
7208 | p->u.chsize = simple_strtol(s, &s2, 0); | 7192 | if (kstrtol(s, 0, &p->u.chsize)) { |
7209 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7210 | dgap_err("bad number for chsize"); | 7193 | dgap_err("bad number for chsize"); |
7211 | return -1; | 7194 | return -1; |
7212 | } | 7195 | } |
@@ -7226,8 +7209,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7226 | dgap_err("unexpected end of file"); | 7209 | dgap_err("unexpected end of file"); |
7227 | return -1; | 7210 | return -1; |
7228 | } | 7211 | } |
7229 | p->u.bssize = simple_strtol(s, &s2, 0); | 7212 | if (kstrtol(s, 0, &p->u.bssize)) { |
7230 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7231 | dgap_err("bad number for bssize"); | 7213 | dgap_err("bad number for bssize"); |
7232 | return -1; | 7214 | return -1; |
7233 | } | 7215 | } |
@@ -7247,8 +7229,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7247 | dgap_err("unexpected end of file"); | 7229 | dgap_err("unexpected end of file"); |
7248 | return -1; | 7230 | return -1; |
7249 | } | 7231 | } |
7250 | p->u.unsize = simple_strtol(s, &s2, 0); | 7232 | if (kstrtol(s, 0, &p->u.unsize)) { |
7251 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7252 | dgap_err("bad number for schedsize"); | 7233 | dgap_err("bad number for schedsize"); |
7253 | return -1; | 7234 | return -1; |
7254 | } | 7235 | } |
@@ -7268,8 +7249,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7268 | dgap_err("unexpected end of file"); | 7249 | dgap_err("unexpected end of file"); |
7269 | return -1; | 7250 | return -1; |
7270 | } | 7251 | } |
7271 | p->u.f2size = simple_strtol(s, &s2, 0); | 7252 | if (kstrtol(s, 0, &p->u.f2size)) { |
7272 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7273 | dgap_err("bad number for f2200size"); | 7253 | dgap_err("bad number for f2200size"); |
7274 | return -1; | 7254 | return -1; |
7275 | } | 7255 | } |
@@ -7289,8 +7269,7 @@ static int dgap_parsefile(char **in, int Remove) | |||
7289 | dgap_err("unexpected end of file"); | 7269 | dgap_err("unexpected end of file"); |
7290 | return -1; | 7270 | return -1; |
7291 | } | 7271 | } |
7292 | p->u.vpixsize = simple_strtol(s, &s2, 0); | 7272 | if (kstrtol(s, 0, &p->u.vpixsize)) { |
7293 | if ((int)strlen(s) > (int)(s2 - s)) { | ||
7294 | dgap_err("bad number for vpixsize"); | 7273 | dgap_err("bad number for vpixsize"); |
7295 | return -1; | 7274 | return -1; |
7296 | } | 7275 | } |
diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h index c8f85096789b..6b8f5f858327 100644 --- a/drivers/staging/dgap/dgap.h +++ b/drivers/staging/dgap/dgap.h | |||
@@ -1226,7 +1226,7 @@ struct cnode { | |||
1226 | union { | 1226 | union { |
1227 | struct { | 1227 | struct { |
1228 | char type; /* Board Type */ | 1228 | char type; /* Board Type */ |
1229 | short port; /* I/O Address */ | 1229 | long port; /* I/O Address */ |
1230 | char *portstr; /* I/O Address in string */ | 1230 | char *portstr; /* I/O Address in string */ |
1231 | long addr; /* Memory Address */ | 1231 | long addr; /* Memory Address */ |
1232 | char *addrstr; /* Memory Address in string */ | 1232 | char *addrstr; /* Memory Address in string */ |
@@ -1234,9 +1234,9 @@ struct cnode { | |||
1234 | char *pcibusstr; /* PCI BUS in string */ | 1234 | char *pcibusstr; /* PCI BUS in string */ |
1235 | long pcislot; /* PCI SLOT */ | 1235 | long pcislot; /* PCI SLOT */ |
1236 | char *pcislotstr; /* PCI SLOT in string */ | 1236 | char *pcislotstr; /* PCI SLOT in string */ |
1237 | char nport; /* Number of Ports */ | 1237 | long nport; /* Number of Ports */ |
1238 | char *id; /* tty id */ | 1238 | char *id; /* tty id */ |
1239 | int start; /* start of tty counting */ | 1239 | long start; /* start of tty counting */ |
1240 | char *method; /* Install method */ | 1240 | char *method; /* Install method */ |
1241 | char v_type; | 1241 | char v_type; |
1242 | char v_port; | 1242 | char v_port; |
@@ -1261,18 +1261,18 @@ struct cnode { | |||
1261 | struct { | 1261 | struct { |
1262 | char *cable; | 1262 | char *cable; |
1263 | char v_cable; | 1263 | char v_cable; |
1264 | char speed; | 1264 | long speed; |
1265 | char v_speed; | 1265 | char v_speed; |
1266 | } line; | 1266 | } line; |
1267 | 1267 | ||
1268 | struct { | 1268 | struct { |
1269 | char type; | 1269 | char type; |
1270 | char *connect; | 1270 | char *connect; |
1271 | char speed; | 1271 | long speed; |
1272 | char nport; | 1272 | long nport; |
1273 | char *id; | 1273 | char *id; |
1274 | char *idstr; | 1274 | char *idstr; |
1275 | int start; | 1275 | long start; |
1276 | char v_type; | 1276 | char v_type; |
1277 | char v_connect; | 1277 | char v_connect; |
1278 | char v_speed; | 1278 | char v_speed; |
@@ -1283,10 +1283,10 @@ struct cnode { | |||
1283 | 1283 | ||
1284 | struct { | 1284 | struct { |
1285 | char type; | 1285 | char type; |
1286 | char nport; | 1286 | long nport; |
1287 | char *id; | 1287 | char *id; |
1288 | char *idstr; | 1288 | char *idstr; |
1289 | int start; | 1289 | long start; |
1290 | char v_type; | 1290 | char v_type; |
1291 | char v_nport; | 1291 | char v_nport; |
1292 | char v_id; | 1292 | char v_id; |
@@ -1299,23 +1299,23 @@ struct cnode { | |||
1299 | 1299 | ||
1300 | char *printname; | 1300 | char *printname; |
1301 | 1301 | ||
1302 | int majornumber; | 1302 | long majornumber; |
1303 | 1303 | ||
1304 | int altpin; | 1304 | long altpin; |
1305 | 1305 | ||
1306 | int ttysize; | 1306 | long ttysize; |
1307 | 1307 | ||
1308 | int chsize; | 1308 | long chsize; |
1309 | 1309 | ||
1310 | int bssize; | 1310 | long bssize; |
1311 | 1311 | ||
1312 | int unsize; | 1312 | long unsize; |
1313 | 1313 | ||
1314 | int f2size; | 1314 | long f2size; |
1315 | 1315 | ||
1316 | int vpixsize; | 1316 | long vpixsize; |
1317 | 1317 | ||
1318 | int useintr; | 1318 | long useintr; |
1319 | } u; | 1319 | } u; |
1320 | }; | 1320 | }; |
1321 | 1321 | ||