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 | |
