summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc/dgnc_tty.c
AgeCommit message (Collapse)AuthorFilesLines
2014-10-02staging: dgnc: Fix do not add new typedefsEbru Akagunduz1-4/+4
This patch fixes "do not add new typedefs" checkpatch.pl warning in dgnc_types.h Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02Staging: dgnc: Add missing blank lineMahati Chamarthy1-0/+2
This fixes the following checkpatch.pl warning: WARNING: Missing a blank line after declarations Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02Staging: dgnc: Remove unnecessary bracesMahati Chamarthy1-8/+4
This fixes the following checkpatch.pl warnings: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02Staging: dgnc: Remove return in void functionMahati Chamarthy1-3/+0
This fixes the following checkpatch.pl warnings: WARNING: void function return statements are not generally useful Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28staging: dgnc: dgnc_tty.c: Replace non-standard spinlock's macrosRoberta Dobrescu1-146/+147
This patch replaces non-standard spinlock's macros. It is done using coccinelle and the following semantic patch: @@ expression x; @@ - DGNC_SPINLOCK_INIT(x) + spin_lock_init(&x) @@ expression x, y; @@ - DGNC_LOCK(x, y) + spin_lock_irqsave(&x, y) @@ expression x, y; @@ - DGNC_UNLOCK(x, y) + spin_unlock_irqrestore(&x, y) @used_by_lock exists@ typedef ulong; symbol lock_flags; position p1, p2; @@ ( ulong lock_flags@p1; | unsigned long lock_flags@p2; ) ... ( spin_lock_irqsave(..., lock_flags) | spin_unlock_irqrestore(..., lock_flags) ) @@ position used_by_lock.p1, used_by_lock.p2; @@ ( - ulong lock_flags@p1; + unsigned long flags; | - unsigned long lock_flags@p2; + unsigned long flags; ) <... - lock_flags + flags ...> Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19Staging: dgnc: Merge lines and remove unused variable for immediate returnVaishali Thakkar1-4/+1
This patch merges two lines in a single line if immediate return is found. It also removes unnecessory variable rc as it is no longer needed. This is done using Coccinelle. Semantic patch used for this is as follows: @@ type T; identifier i; identifier f; constant C; @@ - T i; ...when != i when strict ( return -C; | - i = + return f(...); - return i; ) Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Reviewed-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: dgnc: Move open brace on previous lineRoberta Dobrescu1-8/+4
This fixes the following checkpatch.pl errors: ERROR: that open brace { should be on the previous line Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: dgnc: Do not initialise statics to 0 or NULLRoberta Dobrescu1-1/+1
This fixes the following checkpatch.pl error: ERROR: do not initialise statics to 0 or NULL Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: dgnc: Replace kzalloc with kcallocRoberta Dobrescu1-4/+4
This fixes the following checkpatch.pl warnings: WARNING: Prefer kcalloc over kzalloc with multiply Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: dgnc: Fix warnings relating to printk()Roberta Dobrescu1-2/+2
This fixes the following checkpatch.pl warnings: WARNING: printk() should include KERN_ facility level It replaces printk() with dev_dbg() in order to avoid the warning that a more specific function should be used. Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02staging: dgnc: split two assignments into the two assignments on two lines.Seunghun Lee1-3/+6
split two assignments into the two assignments on two lines. CC: Lidza Louina <lidza.louina@gmail.com> CC: Mark Hounschell <markh@compro.net> Signed-off-by: Seunghun Lee <waydi1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02staging: dgnc: Fix sleeping under spinlock bugKonrad Zapalowicz1-1/+1
This commit changes the memory allocation flags to ATOMIC in order to avoid sleeping in the nowait/nolock code. Signed-off-by: Konrad Zapalowicz <bergo.torino+kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: dgnc: Fix checkpatch include warningKieron Browne1-1/+1
checkpatch.pl fix. Use #include <linux/uaccess.h> instead of <asm/uaccess.h> Signed-off-by: Kieron Browne <kieron.browne@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: dgnc: remove DPR Macros and related codes.Seunghun Lee1-230/+19
In dgnc_drivers.h, DPR macro and DPR_* macros are defined but do nothing. So remove them and related codes. CC: Lidza Louina <lidza.louina@gmail.com> CC: Mark Hounschell <markh@compro.net> Signed-off-by: Seunghun Lee <waydi1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgnc: Move utility functions out of dgnc_driver.cKonrad Zapalowicz1-0/+1
This commit moves the utility functions out of dgnc_driver.c file and puts them in the new dgnc_utils.{c,h} files. The accompanying changes adjust the existing code to work with this design. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgnc: Fix frame size is larger than 1024BKonrad Zapalowicz1-4/+12
This comit fixes the following sparse warnign: drivers/staging/dgnc/dgnc_tty.c:572:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=] This was caused by having buffer as an automatic variable. This commit moves it from the stack to the heap. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-01staging: dgnc: Remove unneeded dgnc_trace.c and dgnc_trace.hSeunghun Lee1-1/+0
Removes unneeded dgnc_trace.c and dgnc_trace.h CC: Lidza Louina <lidza.louina@gmail.com> CC: Mark Hounschell <markh@compro.net> Signed-off-by: Seunghun Lee <waydi1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-27staging: dgnc: remove commented codeSeunghun Lee1-18/+0
This patch removes commented code in dgnc driver. CC: Lidza Louina <lidza.louina@gmail.com> CC: Mark Hounschell <markh@compro.net> Signed-off-by: Seunghun Lee <waydi1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgnc: remove redundant memset callDaeseok Youn1-3/+0
The brd is allocated by kzalloc() in dgnc_found_board() so do not need to set 0 to member variable. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgnc: removes unreachable codeDaeseok Youn1-7/+0
dgnc_tty_ioctl() cannot reach the end of function. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgnc: Fix unsigned value for less than zeroDaeseok Youn1-3/+3
The "un->un_open_count" is unsigned variable, so it cannot be less than zero. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgnc: remove redundant null check for kfree()Daeseok Youn1-12/+6
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgnc: dgnc_tty: Remove a prohibited spaceMasaru Nomura1-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>
2014-05-24staging: dgnc: dgnc_tty: Add a required spaceMasaru Nomura1-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>
2014-05-18staging: dgnc: Remove extra curly bracesMasaru Nomura1-70/+40
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>
2014-05-18staging: dgnc: Put else statements on the right lineMasaru Nomura1-24/+12
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>
2014-03-17staging:dgnc: Removed assignments from if statements.Chi Pham1-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>
2014-03-17staging: dgnc: replace unnecessary while() with if()Daeseok Youn1-22/+19
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>
2013-10-11staging: dgnc: dgnc_tty: Do not use 0 for NULL pointerSachin Kamat1-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>
2013-10-05staging: dgnc: changes arguments in sizeofLidza Louina1-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>
2013-09-25staging: dgnc: removes LINUX_VERSION_CODE conditionalsLidza Louina1-59/+2
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>
2013-09-17staging: dgnc: Fix typo in staging/dgncMasanari Iida1-2/+2
Correct spelling typo in comments Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17staging: dgnc: removes parentheses around return statementsLidza Louina1-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>
2013-09-17staging: dgnc: renames board_t to dgnc_boardLidza Louina1-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>
2013-08-27staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzallocLidza Louina1-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>
2013-08-27staging: dgnc: tty.c: updates uart_struct declaration for sparseLidza Louina1-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>
2013-08-26staging: dgnc: tty.c: edits var in init func for sparseLidza Louina1-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>
2013-08-21staging: dgnc: tty.c: fixes code indent errorLidza Louina1-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>
2013-08-21staging: dgnc: tty.c: fixes pointer syntaxLidza Louina1-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>
2013-08-21staging: dgnc: removes CVS code from filesLidza Louina1-1/+0
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>
2013-08-21staging: dgnc: tty.c: removes trailing whitespaceLidza Louina1-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>
2013-08-14staging: dgnc: removes read_cnt, real_raw, rawreadok and bufLidza Louina1-112/+43
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>
2013-08-14staging: dgnc: fixes ioctl param listLidza Louina1-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>
2013-08-14staging: dgcn: removes unnecessary commands in ioctlLidza Louina1-34/+0
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>
2013-08-14staging: dgnc: dereferences ts var in dgnc_tty_close()Lidza Louina1-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>
2013-08-14staging: dgnc: fixes tty_port and tty_struct paramsLidza Louina1-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>
2013-08-14staging: dgnc: fixes termios errorLidza Louina1-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>
2013-08-02staging: dgnc: add dgnc digi driverLidza Louina1-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>