aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc/dgnc_neo.c
AgeCommit message (Collapse)Author
2017-03-29staging: dgnc: remove dead codeTobin C. Harding
Driver contains dead code, guarded with #ifdef's. We can safely remove this, it will be in the git history if it is later needed. Remove dead code. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: dgnc: remove struct member magic numbersTobin C. Harding
Driver uses magic number members within structs, this is an antiquated method of catching data errors. We don't do things that way any more. Remove magic number struct members. Remove all checks to magic numbers. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: dgnc: remove unnecessary commentsTobin C. Harding
TODO file lists task to remove unnecessary comments. Make initial attempt at removing unnecessary comments. Choose not to be to vicious in removal. We can remove more once the driver is cleaned up/tested some more. For functions with internal linkage, reduce the function comment where possible. For functions with external linkage, migrate the function comment to kernel doc format. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_neo.c Comment style modificationsWalt Feasel
Make modifications for comment style Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02staging: dgnc: Fix lines longer than 80 charactersFernando Apesteguia
All the chunks of the patch apply to comments save the first one. Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: dgnc: Fix long line and spelling mistakeRehas Sachdeva
This patch fixes the checkpatch.pl warning: Line over 80 characters. Also, the word 'because' was spelled as 'Becuz' and has been corrected. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: dgnc: Fix lines over 80 charactersRehas Sachdeva
This patch fixes the checkpatch.pl warning: Line over 80 characters. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: dgnc: remove useless variable 'ch_intr_rx'Daeseok Youn
The 'ch_intr_rx' variable was used only for increasing. So the 'ch_intr_rx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: dgnc: remove useless variable 'ch_intr_tx'Daeseok Youn
The 'ch_intr_tx' variable was used only for increasing. So the 'ch_intr_tx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: dgnc: remove useless variable 'ch_intr_modem'Daeseok Youn
The 'ch_intr_modem' variable was used only for increasing. So the 'ch_intr_modem' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: dgnc: remove useless variable 'intr_rx'Daeseok Youn
The 'intr_rx' variable was used only for increasing. So the 'intr_rx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: dgnc: remove useless variable 'intr_tx'Daeseok Youn
The 'intr_tx' variable was used only for increasing. So the 'intr_tx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: dgnc: remove unused variable 'intr_modem'Daeseok Youn
The 'intr_modem' variable was used only for increasing. So the 'intr_modem' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: dgnc: remove useless variable 'intr_count'Daeseok Youn
The 'intr_count' variable was used only for increasing. So the 'intr_count' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging: dgnc: Need to check for NULL of chDaeseok Youn
the "ch" from brd structure could be NULL, it need to check for NULL. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging: dgnc: remove redundant condition checkDaeseok Youn
dgnc_board(brd) was already checked for NULL before calling neo_parse_isr(). And also port doesn't need to check. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: dgnc: remove blank lineDaeseok Youn
fix checkpatch.pl warning: Blank lines aren't necessary after an open brace '{' Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30staging: dgnc: fix Logical continuations.Daeseok Youn
fix checkpatch.pl warning about 'Logical continuations should be on the previous line' Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30staging: dgnc: fix 'line over 80 characters'Daeseok Youn
fix checkpatch.pl warning about 'line over 80 characters'. I just moved all line comment to above if statement. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30staging: dgnc: remove parenthesis around the CONST |Daeseok Youn
remove parenthesis around the CONST | CONST. It will be also fixed checkpatch.pl warning about "Alignment should match open parenthesis" becasue parenthesis were removed by this patch. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30staging: dgnc: replace dgnc_offset_table with bit shift.Daeseok Youn
the dgnc_offset_table has a same value with (1 << port). So I tried to replace dgnc_offset_table array with 1 << port. And also there are redundant assignments(tmp and current_port) inside while loop for checking uart port, and remove them. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: dgnc: fix Logical continuations should be on theDaeseok Youn
fix checkpatch.pl warning about 'Logical continuations should be on the previous line' in dgnc_neo.c file. I think the 'force' need to check first, because if the 'force' is true, it doesn't need to call another function call. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: dgnc: fix 'line over 80 characters'Daeseok Youn
fix checkpatch.pl warning about 'line over 80 characters' in dgnc_neo.c Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: dgnc: delete parentheses around right hand side of assignmentEva Rachel Retuya
Eliminate unneeded parentheses around the right hand side of an assignment. Coccinelle semantic patch used: @@ expression e1, e2; identifier v; @@ ( v = (e1 == e2) | v = (e1 != e2) | v = (e1 <= e2) | v = (e1 >= e2) | v = - ( e1 - ) ) Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11staging: dgnc: convert to wait_event_interruptible_timeoutHari Prasath Gujulan Elango
This patch makes use of wait_event_interruptible_timeout to achieve timeout functionality.This is a TODO mentiond in the comment which is also removed.It also aligns with what the function is supposed to do as in the comments. Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21Staging: dgnc: dgnc_neo.c Braces {} should be used on all arms of this statementNizam Haider
Fix Checlpatch warning HECK: braces {} should be used on all arms of this statement Signed-off-by: Nizam Haider <nijamh@cdac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21driver:staging:dgnc Fix spaces preferred around that ...Bogicevic Sasa
This fixes all "spaces preferred around that ..." messages from checkpatch.pl Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: dgnc: remove parenthesisSudip Mukherjee
checkpatch was warning us about extra unneeded parenthesis. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: dgnc: alignment styleSudip Mukherjee
checkpatch was warning us that the alignment should match the open parenthesis. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: dgnc: remove space after castSudip Mukherjee
Space is not necessary after typecast. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: dgnc: remove blankline after braceSudip Mukherjee
Blank lines are not needed after opening braces. checkpatch was giving us warnings about this. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: dgnc: remove blankline before braceSudip Mukherjee
Blank lines are not needed before closing braces. checkpatch was giving warning about this. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: dgnc: remove multiple blank linesSudip Mukherjee
checkpatch warns us about multiple blank lines which are not needed. Remove them. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: dgnc: remove redundant !ch checksGiedrius Statkevičius
Remove checks that are redundant since we don't have boards with partially initialized ->channels[i]. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08Staging: fixed multiple spelling errors.Carlos E. Garcia
Fixed multiple spelling errors. Signed-off-by: Carlos E. Garcia <carlos@cgarcia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24staging: dgnc: some off by one bugsDan Carpenter
"dgnc_NumBoards" is the number of filled out elements in the dgnc_Board[] array. "->nasync" and "->maxports" are the same value. They are the number of channels in the ->channels[] array so these tests should be ">=" instead of ">" so we avoid reading past the end of the arrays. I cleaned up the conditions in dgnc_mgmt_ioctl() a bit. There was a work around for the off by one bug in the case where there were no boards which is no longer needed. "channel" is unsigned so it can't be negative. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12Staging: dgnc: Use goto for error handlingQuentin Lambert
This patch introduces goto statments for error handling and in cases where a lock needs to be released. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr) @candidates exists@ identifier f, label; statement s; position p1, p2, p3; @@ f@p1(...) { ...when any if@p2(...) { ...when any s return@p3 ...; } ...when any } @good1 exists@ identifier candidates.f, candidates.label; statement candidates.s; position candidates.p1, candidates.p2; @@ f@p1(...) { ...when any if(...) { ...when any s return ...; } ...when any if@p2(...) {...} ...when any } @depends on good1@ identifier candidates.f, candidates.label; position candidates.p1, candidates.p3; @@ f@p1(...) { ...when any * return@p3 ...; } Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12Staging: dgnc: Remove redundant parenthesesSomya Anand
This patch removes the redundant parentheses inorder to make code simplified. While doing this, the precedence order of the operation is taken into consideration to keep the logic of the code intact. Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12dgnc: clean up comments at start of filesGiedrius Statkevičius
Remove FSF address because it's known in the past that it has changed. Also, remove the pointless "do not change the coding style" comments because it's one of the reasons why it's in staging and it's quite contradictory to what it says in TODO. Also, they contain wrong e-mails of people which are responsible for these drivers - see TODO or MAINTAINERS for that. We can preserve the original copyright at the top of the most files because it shows who originally made them. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09drivers: staging: dgnc: Replace min with min_tDarshana Padmadas
This patch replaces min with min_t and eliminates the following warning found by checkpatch.pl: WARNING: min() should probably be min_t(uint, n, 12) Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30staging: dgnc: Remove useless cast on void pointerTapasweni Pathak
void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Build tested it. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23Staging: dgnc: Remove unused sniff codeSomya Anand
The output written by dgnc_sniff_nowait_nolock() is never used anywhere since commit 35cf90459312f ("staging: dgnc: removes proc code") deleted the code that used to copy it to user space. dgnc_sniff_nowait_nolock() uses 'timeval' to create header timestamps for the data dump. 32-bit systems using 'struct timeval' will break in the year 2038, This patch removes dgnc_sniff_nowait_nolock() and all ch_sniff_* members of struct channel_t defined in "dgnc_driver.h". It also removes their usage from the driver files and hence y2038 issue is also resolved. Signed-off-by: Somya Anand <somyaanand214@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: dgnc: Remove non-standard APR/RAPR printing macrosRoberta Dobrescu
This patch removes non-standard macros used by dgnc driver for printing error or debugging messages. These are replaced by dev_err/dev_dbg (when possible) or pr_err. There were cases where the message is completely removed since is not adding any useful information. Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02staging: dgnc: Fix do not add new typedefsEbru Akagunduz
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-09-28staging: dgnc: dgnc_neo.c: Replace non-standard spinlock's macrosRoberta Dobrescu
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 ...> Additionally replace 'lock_flags2' with 'flags2'. This was done by hand since it had only 3 occurences and all in this file. Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02staging: dgnc: split two assignments into the two assignments on two lines.Seunghun Lee
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-08-30staging: dgnc: remove DPR Macros and related codes.Seunghun Lee
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: Remove 'volatile' modifier where it is not neededKonrad Zapalowicz
This commit fixes the checkpath warning about misused 'volatile' modifier. In this case the 'volatile' was not needed as it was used for regular automatic variable. Thos commit removes the 'volatile'. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgnc: Fix braces {} are not necessary for single statement blocksKonrad Zapalowicz
This commit fixes the following checkpath warning in dgnc_neo.c file: 'braces {} are not necessary for single statement blocks' Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgnc: Fix that open brace { should be on the previous lineKonrad Zapalowicz
This commit fixes the following checkpath error in dgnc_neo.c file: 'that open brace { should be on the previous line' Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>