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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove tracing prints in dgnc_tty_send_xchar. The same functionality
could be achieved by using ftrace.
Signed-off-by: Abhishek Bhardwaj <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The dgnc_tty_send_break() has a switch-case condition for msec.
It is no use except case -1.
Signed-off-by: Daeseok Youn <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix checkpatch.pl issue of the form:
"CHECK: Alignment should match open parenthesis".
Signed-off-by: Nathan Howard <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
fixed a missing letter in the TODO file 'unneeded'
Signed-off-by: Scott Matheina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Cc: Mark Hounschell <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make spelling corrections for 'transitions' and 'satisfy'
Signed-off-by: Walt Feasel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make suggested checkpatch modification for
CHECK: Alignment should match open parenthesis
Signed-off-by: Walt Feasel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make suggested checkpatch modification for
CHECK: spaces preferred around that '|'
Signed-off-by: Walt Feasel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make suggested checkpatch modification for
CHECK: Blank lines aren't necessary before
a close brace '}'
Signed-off-by: Walt Feasel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>