summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc/dgnc_tty.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: dgnc: dgnc_tty: Remove a prohibited spaceMasaru Nomura2014-05-231-3/+3
| | | | | | | | Remove a prohibited space before a closed parenthesis of if statement to meet kernel coding style. Signed-off-by: Masaru Nomura <massa.nomura@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: dgnc_tty: Add a required spaceMasaru Nomura2014-05-231-3/+3
| | | | | | | | Add a required space before an open parenthesis of if statement to meet kernel coding style. Signed-off-by: Masaru Nomura <massa.nomura@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Remove extra curly bracesMasaru Nomura2014-05-181-70/+40Star
| | | | | | | | Remove unnecessary curly braces of if statements in dgnc_neo.c and dgnc_tty.c to meet kernel coding style. Signed-off-by: Masaru Nomura <massa.nomura@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Put else statements on the right lineMasaru Nomura2014-05-181-24/+12Star
| | | | | | | | Fix indenting of if-else statement in dgnc_neo.c and dgnc_tty.c so that following else-if or else statement meets coding style. Signed-off-by: Masaru Nomura <massa.nomura@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:dgnc: Removed assignments from if statements.Chi Pham2014-03-181-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coccinelle was used for this patch. The script is not complete (semantically) and might raise some checkpatch warnings in terms of indentation depending on existing code. *** IFASSIGNMENT.COCCI START *** /* Coccinelle script to handle assignments in if statements * For compound statements, can so far only handle statements with the * assignment on either extreme */ /* This rule is for simple cases * e.g. just an assignment in if, possibly with unary operator */ @simple@ expression E1, E2; statement S1, S2; @@ + E1 = E2; if ( - (E1 = E2) + E1 ) S1 else S2 /* This rule is for compound statements where the assignment is on the right.*/ @right@ expression E, E1, E2; statement S1, S2; @@ ( /* and */ - if (E && (E1 = E2)) + if (E) { + E1 = E2; + if (E1) S1 else S2 + } else S2 | - if (E && (E1 = E2)) + if (E) { + E1 = E2; + if (E1) S1 + } /* or */ | - if (E || (E1 = E2)) + if (!E) { + E1 = E2; + if (E1) S1 else S2 + } + else S1 | - if (E || (E1 = E2)) + if (!E) { + E1 = E2; + if (E1) S1 + } else S1 /* not equal */ | - if (E != (E1 = E2)) + E1 = E2; + if (E != E1) S1 else S2 | - if (E != (E1 = E2)) + E1 = E2; + if (E != E1) S1 /* equal */ | - if (E == (E1 = E2)) + E1 = E2; + if (E == E1) S1 else S2 | - if (E == (E1 = E2)) + E1 = E2; + if (E == E1) S1 /* greater than */ | - if (E > (E1 = E2)) + E1 = E2; + if (E > E1) S1 else S2 | - if (E > (E1 = E2)) + E1 = E2; + if (E > E1) S1 /* less than */ | - if (E < (E1 = E2)) + E1 = E2; + if (E < E1) S1 else S2 | - if (E < (E1 = E2)) + E1 = E2; + if (E < E1) S1 /* lesser than or equal to */ | - if (E <= (E1 = E2)) + E1 = E2; + if (E <= E1) S1 else S2 | - if (E <= (E1 = E2)) + E1 = E2; + if (E <= E1) S1 /* greater than or equal to */ | - if (E >= (E1 = E2)) + E1 = E2; + if (E >= E1) S1 else S2 | - if (E >= (E1 = E2)) + E1 = E2; + if (E >= E1) S1 ) /* This rule is for compound statements where the assignment is on the left.*/ @left@ expression E, E1, E2; statement S1, S2; @@ ( /* and */ - if ((E1 = E2) && E) + E1 = E2; + if (E1 && E) S1 else S2 | - if ((E1 = E2) && E) + E1 = E2; + if (E1 && E) S1 | /* or */ - if ((E1 = E2) || E) + E1 = E2; + if (E1 || E) S1 | - if ((E1 = E2) || E) + E1 = E2; + if (E1 || E) S1 else S2 | /* not equal */ - if ((E1 = E2) != E) + E1 = E2; + if (E1 != E) S1 | - if ((E1 = E2) != E) + E1 = E2; + if (E1 != E) S1 else S2 | /* equal */ - if ((E1 = E2) == E) + E1 = E2; + if (E1 == E) S1 | - if ((E1 = E2) == E) + E1 = E2; + if (E1 == E) S1 else S2 | /* greater */ - if ((E1 = E2) > E) + E1 = E2; + if (E1 > E) S1 | - if ((E1 = E2) > E) + E1 = E2; + if (E1 > E) S1 else S2 | /* less */ - if ((E1 = E2) < E) + E1 = E2; + if (E1 < E) S1 | - if ((E1 = E2) < E) + E1 = E2; + if (E1 < E) S1 else S2 /* lesser than or equal to */ - if ((E1 = E2) <= E) + E1 = E2; + if (E1 <= E) S1 | - if ((E1 = E2) <= E) + E1 = E2; + if (E1 <= E) S1 else S2 /* greater than or equal to */ - if ((E1 = E2) >= E) + E1 = E2; + if (E1 >= E) S1 | - if ((E1 = E2) >= E) + E1 = E2; + if (E1 >= E) S1 else S2 ) *** IFASSIGNMENT.COCCI END *** Signed-off-by: Chi Pham <fempsci@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: replace unnecessary while() with if()Daeseok Youn2014-03-171-22/+19Star
| | | | | | | | | | | | | | | | | | | | It doesn't need to use while loop for getting newrate, because it always breaks out the end of while loop with "break". So just replace while with if. And the type of newrate is "unsigned int", this type is never less than zero. If it can be set to negative value by user application with ioctl(), it is not zero but it can be a unexpected value for setting custom baudrate. Also smatch says: drivers/staging/dgnc/dgnc_tty.c:967 dgnc_set_custom_speed() warn: unsigned 'newrate' is never less than zero. drivers/staging/dgnc/dgnc_tty.c:981 dgnc_set_custom_speed() info: ignoring unreachable code. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: dgnc_tty: Do not use 0 for NULL pointerSachin Kamat2013-10-121-1/+1
| | | | | | | | Do not use 0 for NULL pointer. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: changes arguments in sizeofLidza Louina2013-10-061-12/+12
| | | | | | | | | | | | | The arguments that were passed into sizeof were generic. This patch changes this by putting the actual item that we need a size of instead. For example: - kzalloc(sizeof(struct dgnc_board), GFP_KERNEL); + kzalloc(sizeof(*brd), GFP_KERNEL); Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: removes LINUX_VERSION_CODE conditionalsLidza Louina2013-09-261-59/+2Star
| | | | | | | | | This patch removes the conditionals that make sure the driver supports various versions of the kernel. They aren't needed. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Fix typo in staging/dgncMasanari Iida2013-09-171-2/+2
| | | | | | | Correct spelling typo in comments Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: removes parentheses around return statementsLidza Louina2013-09-171-106/+106
| | | | | | | | This patch removes parentheses around return statements. They aren't needed. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: renames board_t to dgnc_boardLidza Louina2013-09-171-19/+19
| | | | | | | | This patch renames the struct board_t to dgnc_board. board_t wasn't a good name for it since the _t suffix is for typedefs. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzallocLidza Louina2013-08-281-10/+10
| | | | | | | | | This patch replaces dgnc_driver_kzmalloc with kzalloc. A patch that follows removes the dgnc_driver_kzmalloc function. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: tty.c: updates uart_struct declaration for sparseLidza Louina2013-08-281-3/+3
| | | | | | | | | | | | | | | | | | This patch edits the type casts neo_uart_struct and cls_uart_struct. A previous patch added the marker __iomem to these structs. This patch ensures that the change to the marker is consistent. This also removes these sparse warnings: warning: incorrect type in assignment (different address spaces) expected struct neo_uart_struct [noderef] <asn:2>*ch_neo_uart got struct neo_uart_struct *<noident> warning: incorrect type in assignment (different address spaces) expected struct cls_uart_struct [noderef] <asn:2>*ch_cls_uart got struct cls_uart_struct *<noident> Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: tty.c: edits var in init func for sparseLidza Louina2013-08-271-1/+1
| | | | | | | | | | | | This patch edits the vaddr variable in dgnc_tty_init. The variable gets set to board_t->re_map_membase. A previous patch changed the re_map_membase variable's marker and type. This patch makes sure that the changes are consistent and that it doesn't cause sparse warnings. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: tty.c: fixes code indent errorLidza Louina2013-08-211-78/+78
| | | | | | | | This patch fixes the error "code indent should use tabs where possible" in dgnc_tty.c. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: tty.c: fixes pointer syntaxLidza Louina2013-08-211-2/+2
| | | | | | | This patch fixes the error: "foo* bar" should be "foo *bar". Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: removes CVS code from filesLidza Louina2013-08-211-1/+0Star
| | | | | | | | This patch removes the code supporting CVS from its files. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: tty.c: removes trailing whitespaceLidza Louina2013-08-211-89/+89
| | | | | | | | This patch removes trailing whitespace in the dgnc_tty.c file. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: removes read_cnt, real_raw, rawreadok and bufLidza Louina2013-08-141-112/+43Star
| | | | | | | | | | This patch removes the use of read_cnt, real_raw, buf and rawreadok. The variable buf is never used in the code. The variables rawreadok read_cnt and real_raw don't exist in the new API. Reading the data raw is no longer supported by the tty layer. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: fixes ioctl param listLidza Louina2013-08-141-2/+2
| | | | | | | | | The declaration for the ioctl function has changed. The previous version of this declaration took struct file *file as a parameter and the new one does not. This patch removes that parameter. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgcn: removes unnecessary commands in ioctlLidza Louina2013-08-141-34/+0Star
| | | | | | | | The commands TIOCGETP, TCGETS, and TCGETA are not supposed to be seen by the ioctl. This patch removes the switch cases for these commands. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: dereferences ts var in dgnc_tty_close()Lidza Louina2013-08-141-1/+1
| | | | | | | | The value tty->termios needed to be dereferenced to be assigned to the variable ts. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: fixes tty_port and tty_struct paramsLidza Louina2013-08-141-7/+7
| | | | | | | | | | The functions tty_flip_buffer_push, tty_insert_flip_string, tty_insert_flip_char and tty_buffer_request_room now require a struct of type tty_port instead of struct tty_struct. This patch makes those changes. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: fixes termios errorLidza Louina2013-08-141-14/+14
| | | | | | | | | This patch fixes this error: invalid type argument of ‘->’ (have ‘struct ktermios’). There were changes in the tty layer's API. Access to the termios flags changed from tty->termios->*flag* to tty->termios.*flag*. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: add dgnc digi driverLidza Louina2013-08-011-0/+3648
This patch adds the DGNC driver. This is a TTY Serial Port Driver for the Digi International Neo and Classic PCI based product line by Digi International <http://www.digi.com>. This driver isn't hooked up to the build system because it doesn't build, it merely adds the driver written by Digi to the kernel tree so that it can be cleaned up and fixed up properly over time. Cc: Mark Hounschell <markh@compro.net> Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>