Commit graph

22 commits

Author SHA1 Message Date
Seunghun Lee f1e51745eb staging: dgnc: remove DPR Macros and related codes.
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-30 14:02:34 -07:00
Konrad Zapalowicz e9b69997e7 staging: dgnc: Remove 'volatile' modifier where it is not needed
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-16 12:23:14 -07:00
Konrad Zapalowicz 13d1773ace staging: dgnc: Fix braces {} are not necessary for single statement blocks
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-16 12:23:14 -07:00
Konrad Zapalowicz 5ef33f38cb staging: dgnc: Fix that open brace { should be on the previous line
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>
2014-08-16 12:23:14 -07:00
Konrad Zapalowicz 1eba3dba74 staging: dgnc: Fix missing blank line after declarations
This commit deals with the checkapth warnings 'missing line after
declarations' in the dgnc_neo.c file.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:14 -07:00
Konrad Zapalowicz 9dfe5670e1 staging: dgnc: Fix included header from 'asm'
This commit fixes the checkpatch warning:

drivers/staging/dgnc/dgnc_neo.c:37:
    WARNING: Use #include <linux/io.h> instead of <asm/io.h>

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:14 -07:00
Seunghun Lee dfc2b00152 staging: dgnc: Remove unneeded dgnc_trace.c and dgnc_trace.h
Removes unneeded dgnc_trace.c and dgnc_trace.h

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-01 14:50:04 -07:00
Manuel Schölling 7879be810c staging: dgnc: Use time_after_eq()
To be future-proof and for better readability the time comparisons are
modified to use time_after_eq() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25 11:53:44 -07:00
Masaru Nomura 50667c67db staging: dgnc: Remove extra curly braces
Remove unnecessary curly braces of if statements in dgnc_neo.c and
dgnc_tty.c to meet kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:11:24 -07:00
Masaru Nomura 33cfbaf5d0 staging: dgnc: dgnc_neo: Clean up if statement
Fix line over 80 characters and indenting of condition part.
Also, remove unnecessary braces to meet coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:11:24 -07:00
Masaru Nomura 2000c581d8 staging: dgnc: Put else statements on the right line
Fix indenting of if-else statement in dgnc_neo.c and dgnc_tty.c
so that following else-if or else statement meets coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:11:24 -07:00
Chi Pham f7c851d424 staging:dgnc: Removed assignments from if statements.
Coccinelle was used for this patch. The script is not complete (semantically) and might raise some checkpatch warnings in terms of indentation depending on existing code.

*** IFASSIGNMENT.COCCI START ***

/* Coccinelle script to handle assignments in if statements
 * For compound statements, can so far only handle statements with the
 * assignment on either extreme */

/* This rule is for simple cases
 * e.g. just an assignment in if, possibly with unary operator */
@simple@
expression E1, E2;
statement S1, S2;
@@

+ E1 = E2;
if (
- (E1 = E2)
+ E1
 )
S1 else S2

/* This rule is for compound statements where the assignment is on the right.*/
@right@
expression E, E1, E2;
statement S1, S2;
@@

(
/* and */
- if (E && (E1 = E2))
+ if (E) {
+ E1 = E2;
+ if (E1)
S1 else S2
+ } else S2
|
- if (E && (E1 = E2))
+ if (E) {
+ E1 = E2;
+ if (E1)
S1
+ }

/* or */
|
- if (E || (E1 = E2))
+ if (!E) {
+ E1 = E2;
+ if (E1)
S1 else S2
+ }
+ else S1
|
- if (E || (E1 = E2))
+ if (!E) {
+ E1 = E2;
+ if (E1) S1
+ } else
S1

/* not equal */
|
- if (E != (E1 = E2))
+ E1 = E2;
+ if (E != E1)
S1 else S2
|
- if (E != (E1 = E2))
+ E1 = E2;
+ if (E != E1)
S1

/* equal */
|
- if (E == (E1 = E2))
+ E1 = E2;
+ if (E == E1)
S1 else S2
|
- if (E == (E1 = E2))
+ E1 = E2;
+ if (E == E1)
S1

/* greater than */
|
- if (E > (E1 = E2))
+ E1 = E2;
+ if (E > E1)
S1 else S2
|
- if (E > (E1 = E2))
+ E1 = E2;
+ if (E > E1)
S1

/* less than */
|
- if (E < (E1 = E2))
+ E1 = E2;
+ if (E < E1)
S1 else S2
|
- if (E < (E1 = E2))
+ E1 = E2;
+ if (E < E1)
S1

/* lesser than or equal to */
|
- if (E <= (E1 = E2))
+ E1 = E2;
+ if (E <= E1)
S1 else S2
|
- if (E <= (E1 = E2))
+ E1 = E2;
+ if (E <= E1)
S1

/* greater than or equal to */
|
- if (E >= (E1 = E2))
+ E1 = E2;
+ if (E >= E1)
S1 else S2
|
- if (E >= (E1 = E2))
+ E1 = E2;
+ if (E >= E1)
S1
)

/* This rule is for compound statements where the assignment is on the left.*/
@left@
expression E, E1, E2;
statement S1, S2;
@@

(
/* and */
- if ((E1 = E2) && E)
+ E1 = E2;
+ if (E1 && E)
S1 else S2
|
- if ((E1 = E2) && E)
+ E1 = E2;
+ if (E1 && E)
S1
|

/* or */
- if ((E1 = E2) || E)
+ E1 = E2;
+ if (E1 || E)
S1
|
- if ((E1 = E2) || E)
+ E1 = E2;
+ if (E1 || E)
S1 else S2
|

/* not equal */
- if ((E1 = E2) != E)
+ E1 = E2;
+ if (E1 != E)
S1
|
- if ((E1 = E2) != E)
+ E1 = E2;
+ if (E1 != E)
S1 else S2
|

/* equal */
- if ((E1 = E2) == E)
+ E1 = E2;
+ if (E1 == E)
S1
|
- if ((E1 = E2) == E)
+ E1 = E2;
+ if (E1 == E)
S1 else S2
|
/* greater */
- if ((E1 = E2) > E)
+ E1 = E2;
+ if (E1 > E)
S1
|
- if ((E1 = E2) > E)
+ E1 = E2;
+ if (E1 > E)
S1 else S2
|

/* less */
- if ((E1 = E2) < E)
+ E1 = E2;
+ if (E1 < E)
S1
|
- if ((E1 = E2) < E)
+ E1 = E2;
+ if (E1 < E)
S1 else S2

/* lesser than or equal to */
- if ((E1 = E2) <= E)
+ E1 = E2;
+ if (E1 <= E)
S1
|
- if ((E1 = E2) <= E)
+ E1 = E2;
+ if (E1 <= E)
S1 else S2

/* greater than or equal to */
- if ((E1 = E2) >= E)
+ E1 = E2;
+ if (E1 >= E)
S1
|
- if ((E1 = E2) >= E)
+ E1 = E2;
+ if (E1 >= E)
S1 else S2
)

*** IFASSIGNMENT.COCCI END ***

Signed-off-by: Chi Pham <fempsci@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 16:42:47 -07:00
Ashvini Varatharaj f32eca7d6f Staging: dgnc: avoiding buffer overflow
drivers/staging/dgnc/dgnc_neo.c:1969 neo_vpd() error: buffer overflow 'brd->vpd' 128 <= 128
drivers/staging/dgnc/dgnc_neo.c:1970 neo_vpd() warn: buffer overflow 'brd->vpd' 128 <= 130
drivers/staging/dgnc/dgnc_neo.c:1970 neo_vpd() warn: buffer overflow 'brd->vpd' 128 <= 130

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-19 14:35:05 -07:00
Masanari Iida 79e30af21f staging: dgnc: Fix typo in staging/dgnc
Correct spelling typo in comments

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17 07:47:46 -07:00
Lidza Louina 8f90ef8049 staging: dgnc: removes parentheses around return statements
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-09-17 07:47:43 -07:00
Lidza Louina 03425f55a1 staging: dgnc: renames board_t to dgnc_board
This patch renames the struct board_t to dgnc_board. board_t
wasn't a good name for it since the _t suffix is for typedefs.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17 07:47:43 -07:00
Lidza Louina c2ac546ea4 staging: dgnc: neo.c: changes param in neo_read_eeprom function for sparse
This patch adds a marker to neo_read_eeprom function's
base parameter.

It removes these warnings found in neo.c:

warning: incorrect type in argument 1 (different address spaces)
  expected unsigned char *base
  got unsigned char [noderef] [usertype] <asn:2>*re_map_membase
warning: incorrect type in argument 2 (different address spaces)
  expected void volatile [noderef] <asn:2>*addr
  got unsigned char *

These warnings happen because this function gets
called with a board_t->re_map_base variable. A previous
patch added the __iomem marker to this variable. This
patch ensures that the changes are consistent.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26 16:26:56 -07:00
Lidza Louina 00804f773b staging: dgnc: neo.c: fixes code indent error
This patch fixes the error "code indent should use
tabs where possible" in dgnc_neo.c.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21 10:49:47 -07:00
Lidza Louina 4cfa73097f staging: dgnc: removes CVS code from files
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-21 10:48:40 -07:00
Lidza Louina 5ba5b89ab6 staging: dgnc: neo.c: removes trailing whitespace
This patch removes trailing whitespace in
the dgnc_neo.c file.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21 09:43:53 -07:00
Sachin Kamat 253085a1e5 staging: dgnc: Remove version.h header inclusion in dgnc_neo.c
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-03 11:11:46 +08:00
Lidza Louina 0b99d58902 staging: dgnc: add dgnc digi driver
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>
2013-08-02 05:42:45 +08:00