aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc
AgeCommit message (Collapse)Author
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25dgnc: fix multiple blank lines coding style problemAliza Minkov
According to the coding-style documentation, functions in source files should be separated with one blank line. Redundant blank lines were removed from this source file, in accordance with coding-style documentation. Signed-off-by: Aliza Minkov <minkov.al@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-16drivers/staging: refactor dgnc tty registration.Haim Daniel
-remove duplicate tty allocation code for serial and printer drivers. -add missing tty c_ispeed and c_ospeed initialization to 9600. -fix sparse warning: too long initializer-string for array of char. This patch was only unit tested due to lack of the actual hardware. Signed-off-by: Haim Daniel <haimdaniel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: dgnc: remove error message taskTobin C. Harding
TODO file lists task to remove unnecessary error messages. There are no unnecessary error messages in the driver, this must have been done already. Remove task from TODO file. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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>
2017-03-29staging: dgnc: remove double underscoreTobin C. Harding
Pre-processor header guards use double underscore, typically kernel code uses single underscore when defining header guards. 'endif' statement should include what is ending as a comment string. Remove double underscore, add comment string to 'endif' Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: dgnc: clean up header commentsTobin C. Harding
TODO file has task: remove unnecessary comments. Driver uses some custom comment format. Driver would be better if it used kernel doc format. Audit header file comments. Replace struct comments with kernel doc format comments. Remove unnecessary comments. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging: dgnc: remove tracing prints in dgnc_tty.cAbhishek Bhardwaj
Remove tracing prints in dgnc_tty_send_xchar. The same functionality could be achieved by using ftrace. Signed-off-by: Abhishek Bhardwaj <abshkbh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: dgnc: preserve return codeTobin C. Harding
Return code from tty_check_change() should be being preserved. Preserve return code from call to tty_check_change(). Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14staging: dgnc: remove useless switch-case statementsDaeseok Youn
The dgnc_tty_send_break() has a switch-case condition for msec. It is no use except case -1. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14staging: dgnc: ch->ch_bd is already assigned to bd variableDaeseok Youn
The bd variables in functions are already assigned from ch->ch_bd but it is not used in those functions except checking NULL. The ch->ch_bd could be replaced with bd variable. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14staging: dgnc: remove explicit castTobin C. Harding
Function return type is 'int'. Returned variable is of type 'uint'. uint can be implicitly converted to int. Most significant bit is not set so there is no risk in implicit conversion. Remove unnecessary type cast. 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-14staging: dgnc: return error code directlyTobin C. Harding
In various functions a return code variable is defined at the top of function, for example; rc = -ENODEV; and then the variable is returned. This makes it harder to read since it separates the error code from the return site. Return the error code directly instead of using a variable. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: dgnc: remove item from TODO listTobin C. Harding
TODO file contains task to verify and correct function return sites. Need to check for and implement correct usage of goto's when there is work to be done before returning. Remove task from TODO list after already having completed audit of directory drivers/staging/dgnc. 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_ttyTobin 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>
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>
2017-03-12staging: dgnc: audit goto's in dgnc_driverTobin C. Harding
TODO file requests fix up of error handling. Audit dgnc_driver.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>
2017-03-07staging: dgnc: replace usleep_range with udelayAishwarya Pant
udelay is impelmented using a busy-wait loop and consumes CPU cycles while usleep_range is implemented using interrupts.cls_flush_uart_write() is called after a channel lock is acquired i.e. an atomic context. Hence delay in this method should use udelay instead of usleep_range. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-07staging: dgnc: Constify ktermios structureGargi Sharma
The ktermios structure is a local default termios struct. All ports are initially created with this termios. Since, the structure is never modified, it can be declared as const. Coccinelle Script: @r disable optional_qualifier@ identifier s,i; position p; @@ static struct ktermios i@p = { ... }; @ok1@ identifier r.i; expression e; position p; @@ e = i@p @bad@ position p != {r.p,ok1.p}; identifier r.i; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct ktermios i = { ... }; File Size before: text data bss dec hex filename 25469 2048 256 27773 6c7d drivers/staging/dgnc/dgnc_tty.o File Size after: text data bss dec hex filename 25636 2016 256 27908 6d04 drivers/staging/dgnc/dgnc_tty.o Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: dgnc: replace udelay with usleep_rangeAishwarya Pant
Fix checkpatch warning on dgnc_cls.c: CHECK usleep_range is preferred over udelay. udelay(t) in function cls_uart_init is within non-atomic context and can be safely replaced by usleep_range(t, t + delta) where delta is t (as t is between 10 and 20 microseconds). Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-02sched/headers: Prepare to move signal wakeup & sigpending methods from ↵Ingo Molnar
<linux/sched.h> into <linux/sched/signal.h> Fix up affected files that include this signal functionality via sched.h. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-02-12staging: dgnc: dgnc_tty.c: fix argument list alignment issue.Nathan Howard
Fix checkpatch.pl issue of the form: "CHECK: Alignment should match open parenthesis". Signed-off-by: Nathan Howard <adanhawthorn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: dgnc: update TODO fileFernando Apesteguia
Remove reference to checkpatch warnings since its output is now clean. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: fixed spelling error in TODO file for dgnc driverScott Matheina
fixed a missing letter in the TODO file 'unneeded' Signed-off-by: Scott Matheina <scott@matheina.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-07staging: dgnc: Fix lines longer than 80 charactersFernando Apesteguia
For two cases (beginning and end of the patch) I opted to create small functions instead of breaking the the lines in a weird way. The other changes are simple ones: either by breaking the line when appropriate or by turning a comment into a multi-line one. Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-07staging: dgnc: fix blank line after '{' warnings.Fernando Apesteguia
Remove blank lines between open brace and comment. Remove blank lines after comment in line with the rest of the comments of the file. Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-06staging: dgnc: fix unnamed parameterFernando Apesteguia
This patch fixes a checkpatch warning. Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-01staging: dgnc: remove sysfs filesGreg Kroah-Hartman
The dgnc driver has no business creating "custom" sysfs files just for a single tty driver. Combined with the odd way they are created, it's just a mess, so remove them entirely as I am tired of tripping over them when doing driver core changes. Cc: Lidza Louina <lidza.louina@gmail.com> Cc: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: dgnc: dgnc_tty: Remove blank linesVijai Kumar K
Fixes checkpatch warning: waitqueue_active without comment Signed-off-by: Vijai Kumar K <vijaikumar.kanagarajan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: dgnc: digi.h Spelling correctionWalt Feasel
Make spelling correction for 'regular' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: dgnc: digi.h Comment style modificationsWalt Feasel
Make modifications to comment style Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: dgnc: dgnc_tty.c Spelling correctionsWalt Feasel
Make spelling corrections for 'transitions' and 'satisfy' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: dgnc: dgnc_tty.c comment style modificationsWalt Feasel
Make modifications to comment style Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: dgnc: dgnc_tty.c Align on parenthesisWalt Feasel
Make suggested checkpatch modification for CHECK: Alignment should match open parenthesis Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: dgnc: dgnc_tty.c Space preferred aroundWalt Feasel
Make suggested checkpatch modification for CHECK: spaces preferred around that '|' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_sysfs.c Delete blank lineWalt Feasel
Make modification to remove extra blank line Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_sysfs.c Comment style modificationsWalt Feasel
Make modifications to comment style Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_neo.h Spelling correctionWalt Feasel
Make spelling correction for 'control' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_neo.h 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-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-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-11-19staging: dgnc: dgnc_driver.h Spelling correctionWalt Feasel
Make spelling correction for 'statements' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_driver.h Align columnsWalt Feasel
Make modifications to align columns Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_driver.h Comment style modificationsWalt Feasel
Make modifications to comment style Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_driver.c Blank line before }Walt Feasel
Make suggested checkpatch modification for CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_driver.c Remove blank linesWalt Feasel
Make suggested checkpatch modification for CHECK: Please don't use multiple blank lines Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-19staging: dgnc: dgnc_driver.c Comment style modificationsWalt Feasel
Make modifications to comment styles Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>