summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc
AgeCommit message (Collapse)AuthorFilesLines
2015-08-14staging: dgnc: Remove unnecessary externsJoe Perches1-8/+8
Using 'extern' is not necessary for function prototypes. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31Staging: dgnc: dgnc_driver.h: remove unnecessary commentsNavy Cheng1-3/+3
The public headers is well known by others and the redundant commits make the code mess. Remove the comments of the public headers to make the code tidy. Signed-off-by: Navy Cheng <navych@126.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18staging: dgnc: free memory allocatedHari Prasath Gujulan Elango1-0/+4
The memory allocated in dgnc_tty_register() for two objects is not freed anywhere.This patch addresses this by freeing the memory in dgnc_tty_uninit. Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18staging: dgnc: fix typo in comments secionHari Prasath Gujulan Elango1-1/+1
This patch fixes a typo in the comments section as warned by checkpatch.pl Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: dgnc: remove ununsed MacroHari Prasath Gujulan Elango1-1/+0
Remove the ununsed Macro Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: dgnc: delete all references to 'flipbuf'Gujulan Elango, Hari Prasath (H.)2-12/+0
This patch deletes all references to 'flipbuf'.Memory is allocated and freed but never used anywhere in the driver.Also deleted an ununsed Macro defined in the header file. Signed-off-by: Gujulan Elango Hari Prasath <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: dgnc: fix line length over 80 chars in dgnc_sysfs.cWim de With1-36/+74
This patch fixes most of the lines over 80 characters long in dgnc_sysfs.c. I couldn't find a way to break line 202-207 in a sensible way. If there is a way, let me know. Signed-off-by: Wim de With <nauxuron@wimdewith.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31Staging: dgnc: fixed coding style issue in digi.hBuţiu Alexandru Octavian1-7/+7
Fixed coding style issue "warning line over 80 characters" detected by checkpatch.pl in digi.h Signed-off-by: Buţiu Alexandru Octavian <predator5047@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: dgnc: remove redundant checkGiedrius Statkevičius1-6/+0
count doesn't get changed in between identical checks in dgnc_tty_write() so remove the second check Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: dgnc: remove dead code in dgnc_tty_write()Giedrius Statkevičius1-44/+1
Remove the dead code protected by in_user in dgnc_tty_write() because it is set to 0 and never changed to 1 thus the code in ifs never gets executed. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: dgnc: remove redundant !ch checksGiedrius Statkevičius2-4/+2
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: dgnc: don't forget to check if ->channels[i] is NULL in ↵Giedrius Statkevičius1-2/+6
dgnc_tty_uninit() Add a check if ->channels[i] is NULL because a NULL pointer may be dereferenced in case one of the allocations failed Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: dgnc: clean up allocation of ->channels[i]Giedrius Statkevičius1-16/+15
Check if kzalloc fails in dgnc_tty_init() and if it does then free all previously allocated ->channels[i] and set them to NULL. This makes the code less error/bug prone because instead of needing programmers attention to add checks everywhere we do that in one place. Also, remove a bogus comment and check in the same loop because ->channels[i] isn't allocated anywhere else. Finally, remove a unnecessary check if ->channels[i] is NULL in the next loop because it can't be. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: dgnc: remove some dead code from dgnc_tty.cGiedrius Statkevičius1-16/+0
Remove some dead code that will never be executed or which serves no purpose 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. Garcia2-4/+4
Fixed multiple spelling errors. Signed-off-by: Carlos E. Garcia <carlos@cgarcia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err()Ioana Ciornei1-1/+1
Fix the following checkpatch warning: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24dgnc: Clean up dgnc_sysfs.hGiedrius Statkevičius1-4/+1
Remove redundant blank lines, move absolute include after relative include. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24dgnc: remove unused stuff from dgnc_cls.hGiedrius Statkevičius1-13/+0
Remove unused defines from dgnc_cls.h Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24dgnc: remove old 2.4-2.6 compat kernel definesGiedrius Statkevičius4-42/+1
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: use linux/types.h instead of dgnc_types.hGiedrius Statkevičius5-39/+7
Dgnc_types.h unnecesarily defines TRUE as 1 and FALSE as 0 because we already have a widely used linux/types.h so convert all TRUE to true, FALSE to false and edit the dgnc_board struct to make sure it uses "bool". 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čius5-112/+36
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-24dgnc: clean up digi.hGiedrius Statkevičius1-267/+0
Remove a lot of unused structs and defines from digi.h. We still have to be careful with TIOCM_LE and TIOCMSET/TIOCMBIC because termios.h and ioctls.h respectfully redefine them. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24dgnc: remove unused dgnc_ioctl_name() commandGiedrius Statkevičius2-53/+0
dgnc_ioctl_name() is never used anywhere so remove it 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 Carpenter4-7/+7
"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-18Staging: dgnc: release the lock before testing for nullityQuentin Lambert1-1/+1
The refactoring intrduced in c84a083b995b ("Staging: dgnc: Use goto for spinlock release before return") inverts the order in which the lock is released and ld is tested for nullity. This patch restores the execution flow. Fixes: c84a083b995b ("Staging: dgnc: Use goto for spinlock release before return") Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12Staging: dgnc: Use goto for spinlock release before returnQuentin Lambert1-25/+23
spin_unlock_irqrestore() is called at several different places before exiting. This patch uses a goto statement to factorize these calls. Coccinelle was used to generate this patch. Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12Staging: dgnc: Use goto for error handlingQuentin Lambert3-41/+22
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 Anand1-17/+17
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-12Staging: dgnc: dgnc_driver: Add a missing call to dgnc_tty_uninitQuentin Lambert1-0/+1
This function is called on the previous and the next failure branches. This patch adds the call on the branch where it seems to be missing. Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12dgnc: clean up comments at start of filesGiedrius Statkevičius17-163/+0
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-12dgnc: Remove unneeded dgnc_state array of stringsGiedrius Statkevičius2-9/+0
Dgnc_state array of strings is never used anywhere and it seems pretty useless anyway since the board state enum names speak for themselves. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12staging: dgnc: Use kcalloc instead of kzalloc.Navya Sri Nizamkari1-1/+1
This patch uses kcalloc instead of kzalloc function. A coccinelle script was used to make this change. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12staging: dgnc: off by one in dgnc_mgmt_ioctl()Dan Carpenter1-2/+1
"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>
2015-03-12dgnc: Make all lines under 80 characters in dgnc_driver.cGiedrius Statkevičius1-7/+8
Some of the lines are over 80 characters in dgnc_driver.c so fix them by moving the comments closer to the code, tidying the comments to make them smaller, and remove a redundant space after +. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12dgnc: Make all lines under 80 characters in dgnc_cls.hGiedrius Statkevičius1-12/+28
Some of the lines are over 80 characters so fix that by moving the comments before the struct definition and before #define's. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12dgnc: Remove redundant blank lines in dgnc_cls.cGiedrius Statkevičius1-36/+0
There are a lot double of blank lines in dgnc_cls.c thus remove them to make the file follow the CodingStyle. Also, remove one blank line at the end of dgnc_cls.c. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12dgnc: Move DG_PART definition from Makefile to dgnc_driver.hCass May2-2/+1
Avoid deprecated usage of EXTRA_CFLAGS by moving definition of DG_PART into dgnc_driver.h Signed-off-by: Cass May <cass@cassm.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-12dgnc: Remove superfluous EXTRA_CFLAGS variableCass May1-1/+1
Clean up Makefile by removing unnecessary definition of DG_NAME. Signed-off-by: Cass May <cass@cassm.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09drivers: staging: dgnc: Replace min with min_tDarshana Padmadas1-1/+1
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>
2015-03-06Staging: dgnc: Fix checking return value of register_chrdevSalah Triki1-2/+2
The failure code is negative. So check <0 instead of <=0. Return the failure code instead of -ENXIO. Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: dgnc: fix braces {} are not necessary for single statement blocksSalah Triki1-4/+0
This patch fixes the following checkpatch.pl warning: braces {} are not necessary for single statement blocks Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01Staging: dgnc: Replace printk() with dev_dbg()Cristina Opriceana1-2/+2
This patch replaces printk() with dev_dbg() in order to avoid the suggestion of using a more specific function while printing debug information. Warning found by checkpatch.pl. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01Staging: dgnc: Replace printk with dev_errCristina Opriceana1-1/+1
This patch fixes the following checkpatch.pl warning: WARNING: Prefer [subsystem eg: netdev]_err over printk(KERN_ERR, ...). Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: dgnc: Removed trailing whitespaceGamze POLAT1-3/+3
Removed trailing whitespaces to improve code readability and remove checkpatch warning. Signed-off-by: Gamze POLAT <gamzepolat94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26staging: dgnc: replace init_timer by setup_timerAya Mahfouz1-6/+2
This patch replaces init_timer and the 2 step initialization of function and data by setup_timer to make the code more concise. The issue was discovered using the following coccinelle script: @@ expression ds, e1, e2; @@ -init_timer (&ds); +setup_timer (&ds, e1, e2); ... ( -ds.function = e1; ... -ds.data = e2; | -ds.data = e2; ... -ds.function = e1; ) Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24Staging: dgnc: Fix warning of code styleVatika Harlalka1-1/+3
This patch fixes checkpatch.pl WARNING: Line longer than 80 chars. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24Staging: dgnc: Removed trailing whitespace to improve readability.Vatika Harlalka1-6/+6
Removed trailing whitespaces to improve code readability and remove checkpatch warning. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24Staging: dgnc: Indented code to increase readabilityVatika Harlalka1-2/+2
Indented code and fixed checkpatch warning to enhance readability. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-28drivers/staging: use current->state helpersDavidlohr Bueso1-1/+1
Call __set_current_state() instead of assigning the new state directly. These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments, keeping track of who changed the state. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25Staging: dgnc: fixed some coding style errorsAndrew Milkovich2-36/+36
This patch fixes the following checkpatch.pl error: ERROR: Macros with complex values should be enclosed in parentheses Outer parentheses were added to macro definitions. Signed-off-by: Andrew Milkovich <amilkovich@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>