summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc/dgnc_mgmt.c
AgeCommit message (Collapse)Author
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>
2017-03-14staging: dgnc: fix whitespace before returnTobin C. Harding
Checkpatch emits CHECK: Blank lines aren't necessary before a close brace '}'. Previous attempts were made to make uniform the error handling in dgnc but improvements are still possible. Undo whitespace changes that should not have been made :(. Make return statement placement uniform throughout dgnc. Fix checkpatch CHECK. Make whitespace changes only. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: dgnc: audit goto's in dgnc_mgmtTobin C. Harding
TODO file requests fix up of error handling. Audit dgnc_mgmt.c and fix all return paths to be uniform and inline with kernel coding style. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_mgmt.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-03-28staging: dgnc: fix CamelCase in dgnc_driver.cDaeseok Youn
fix checkpatch.pl warning about CamelCase. 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>
2015-10-16staging/dgnc: fix info leak in ioctlSalva Peiró
The dgnc_mgmt_ioctl() code fails to initialize the 16 _reserved bytes of struct digi_dinfo after the ->dinfo_nboards member. Add an explicit memset(0) before filling the structure to avoid the info leak. Signed-off-by: Salva Peiró <speirofr@gmail.com> 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-09-14staging: dgnc: Fixed line over 80 characters longAnjali Menon
This is a patch that fixes line over 80 characters coding style warning detected by checkpatch.pl. WARNING: line over 80 characters Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24dgnc: remove old 2.4-2.6 compat kernel definesGiedrius Statkevičius
dgnc_kcompat.h contains some old legacy defines in case the kernel doesn't have __user defined but for current kernel versions these defines don't make sense and are useless so remove them. Move the TTY_FLIPBUF_SIZE define to digi.h because it's used in the code. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24dgnc: get rid of dpacompat.h, move remaining stuff to digi.hGiedrius Statkevičius
Dpacompat.h contained a lot of unused #defines and only few things are used from it so since we've trimmed down digi.h, now we can delete dpacompat.h and move remaining stuff into digi.h. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> 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-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-12staging: dgnc: off by one in dgnc_mgmt_ioctl()Dan Carpenter
"dgnc_NumBoards" is the number of initialized elements in the dgnc_Board[] array so the comparison should be ">=" instead of ">" so we don't read invalid data. We can remove the special handling of the empty array now that we've fixed this bug. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> 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_mgmt.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 ...> Signed-off-by: Roberta Dobrescu <roberta.dobrescu@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-03-13Staging: dgnc: fix indentation in dgnc_mgmt.cIulia Manda
Align test parts in if statement on separate lines. Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10Staging:dgnc: Fixed space prohibited between function name and '('Iulia Manda
Deleted space between sizeof and open parenthethis. Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10Staging:dgnc: Use uaccess.h header from linux dir instead of asmIulia Manda
Include <linux/uaccess.h> instead of <asm/uaccess.h> Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10Stagind:dgnc: Fixed unnecessary braces for single statement blocksIulia Manda
Deleted unnecessary braces for single statement if blocks. Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10Staging:dgnc: Fixed else not following close brace errorIulia Manda
Fix checkpatch.pl warning - else should follow close brace. Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2013-10-19Staging: dgnc: removing the comparison 'board<0'Ashvini Varatharaj
Fix dgnc_mgmt_ioctl() warn: unsigned 'board' is never less than zero. Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-05staging: dgnc: changes arguments in sizeofLidza Louina
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-17staging: dgnc: removes parentheses around return statementsLidza Louina
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-08-21staging: dgnc: removes CVS code from filesLidza Louina
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: mgmt.c: removes trailing whitespaceLidza Louina
This patch removes trailing whitespace in the dgnc_mgmt.c file. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-20staging: dgnc: removes ifdef HAVE_UNLOCKED_IOCTL conditionalsLidza Louina
This patch removes the HAVE_UNLOCKED_IOCTL conditional statements from driver.c, mgmt.c and mgmt.h. This was used to support older kernels. It isn't needed now. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-15staging: dgnc: removes proc codeLidza Louina
This patch removes the dgnc_proc.c and dgnc_proc.h files and all references to proc functions in dgnc_driver.c. This also removes proc.h from the include headers in driver.c, mgmt.c and sysfs.c and proc.o from the Makefile. Drivers now use sysfs instead of proc. Signed-off-by: Lidza Louina <lidza.louina@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-03staging: dgnc: Remove version.h header inclusion in dgnc_mgmt.cSachin Kamat
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02staging: dgnc: add dgnc digi driverLidza Louina
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>