1
0
Fork 0
Commit Graph

43 Commits (c261189862c6f65117eb3b1748622a08ef49c262)

Author SHA1 Message Date
Daeseok Youn ea753f2a59 staging: dgnc: remove parenthesis around the CONST |
remove parenthesis around the CONST | CONST.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Sam Horlbeck Olsen 57d8dfed85 staging: dgnc: Add whitespace around OR'd flags ("|")
This patch fixes the checkpatch.pl message:

CHECK: spaces preferred around that '|' (ctx:VxV)
+	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
                                    ^                   ^

As per the guidelines for coding style in the kernel, I have updated the
digi international driver to include spaces around the OR'd flags; not only
is this formatting issue caught by `checkpatch.pl`, in the next `if` block
the correct formatting is used, leading to both incorrect and inconsistent
code formatting.

This patch puts the line in question at 82 characters---while this is over
the recommended limit, there are no clear locations to break the line and it
barely breaks the cutoff.

Signed-off-by: Sam Horlbeck Olsen <sam.horlsen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Eva Rachel Retuya 0b7ceaa665 staging: dgnc: delete parentheses around right hand side of assignment
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>
2016-03-11 22:09:09 -08:00
Jitendra Kumar Khasdev 6e411751f0 staging: dgnc: dgnc_cls.c: Replaced udelay by usleep_range
This patch is to file dgnc_cls.c that fixes up udelay function by
usleep_range.
It is safe to use according to the following documentation
Documentation/timers/timers-howto.txt. So that is why I have given
an appropriate time range.

Signed-off-by: Jitendra Kumar Khasdev <jkhasdev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:52:34 -08:00
Sudip Mukherjee e352d3f19e staging: dgnc: alignment style
checkpatch was warning us that the alignment should match the open
parenthesis.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:08:51 -07:00
Sudip Mukherjee 6f418259ec staging: dgnc: remove space after cast
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-12 21:08:51 -07:00
Sudip Mukherjee 205fc1fc95 staging: dgnc: remove blankline after brace
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-12 21:08:51 -07:00
Sudip Mukherjee 40215ddffc staging: dgnc: remove blankline before brace
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-12 21:08:51 -07:00
Sudip Mukherjee e24bb0ed81 staging: dgnc: remove NULL test
This NULL test is not required as iounmap will validate the argument.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:13 +01:00
Sudip Mukherjee 2d9920eca4 staging: dgnc: remove unused variables
These variables were only assigned some values but were never used.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:52:32 +01:00
Cristina Moraru c76d294f32 staging: dgnc: Fix indentation warning
Fixed 'suspect code indent for conditional statements (8, 24)' Warning

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:36:00 +02:00
Giedrius Statkevičius 071494d832 staging: dgnc: remove redundant !ch checks
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-08 09:24:00 +02:00
Dan Carpenter 4bef52f377 staging: dgnc: some off by one bugs
"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-24 15:31:24 +01:00
Quentin Lambert f6a14cf04f Staging: dgnc: Use goto for error handling
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-12 11:13:41 +01:00
Giedrius Statkevičius 1f2e089f68 dgnc: clean up comments at start of files
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-12 11:11:17 +01:00
Giedrius Statkevičius 85c748dfcb dgnc: Remove redundant blank lines in dgnc_cls.c
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-12 11:05:27 +01:00
Tapasweni Pathak fc33bd2921 staging: dgnc: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:05:46 -07:00
Somya Anand 36beff6e20 Staging: dgnc: Remove unused sniff code
The output written by dgnc_sniff_nowait_nolock() is never used
anywhere since commit 35cf904593 ("staging: dgnc: removes proc code")
deleted the code that used to copy it to user space.
dgnc_sniff_nowait_nolock() uses 'timeval' to create header timestamps for
the data dump.

32-bit systems using 'struct timeval' will break in the year 2038,
This patch removes dgnc_sniff_nowait_nolock() and all ch_sniff_* members
of struct channel_t defined in "dgnc_driver.h". It also removes their usage
from the driver files and hence y2038 issue is also resolved.

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23 08:34:25 +08:00
Roberta Dobrescu 1f26adc94a staging: dgnc: Remove non-standard APR/RAPR printing macros
This patch removes non-standard macros used by dgnc driver for printing error
or debugging messages. These are replaced by dev_err/dev_dbg (when possible)
or pr_err. There were cases where the message is completely removed since is
not adding any useful information.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:18 +08:00
Heena Sirwani ca5dd0b83d Staging: dgnc: Compress two lines of code into one.
The following patch merges two lines of code into one using coccinelle
and removes unused variables. The semantic patch used is as follows:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:18 +08:00
Ebru Akagunduz 446393e960 staging: dgnc: Fix do not add new typedefs
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-10-02 09:37:44 -07:00
Roberta Dobrescu 707505b58e staging: dgnc: Replace non-standard spinlock's macros
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-09-23 20:31:32 -07:00
Seunghun Lee 587abd7b03 staging: dgnc: split two assignments into the two assignments on two lines.
split two assignments into the two assignments on two lines.

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-09-02 10:44:33 -07:00
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 d6365fe50e staging: dgnc: Remove unnecessary 'return' statement
This commit fixes the checkpath warning 'void function return
statements are not generally useful' caused by the 'return' at the end
of 'void' function.

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 8aa5d0d825 staging: dgnc: Fix missing blank line after declarations
This commit fixes the missing blank lines after declarations checkpath
warnings found in dgnc_cls.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
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
Seunghun Lee 83f053de12 staging: dgnc: rephrase comment
Rephrase comment to explain original intention of function.

CC: Lidza Louina <lidza.louina@gmail.com>
CC: Mark Hounschell <markh@compro.net>
Suggested-by: Tobias Klauser <tklauser@distanz.ch>
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
Seunghun Lee 645b031452 staging: dgnc: remove commented code
This patch removes commented code in dgnc driver.

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-07-27 11:39:45 -07:00
Dan Carpenter c80561e96b staging: dgnc: UART_IIR_XOFF code is buggy
The UART_IIR_XOFF was supposed to be a no-op but, because there was a
missing semi-colon, the if statement is not "Empty".  I have just deleted
this code because it was supposed to be a no-op anyway.  UART_IIR_XOFF
is a standard define and not something specific to this driver.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:46:00 -07:00
Gulsah Kose d5229247c8 staging: dgnc: Fix quoted string split across lines warning
This patch fixes "quoted string split across lines warning" warning in
dgnc_cls.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 22:04:41 -07:00
stalinsrinivasan.s f0dcc9fa42 staging: dgnc: fix checkpatch.pl usage of comparison with jiffies
This is a patch to the dgnc_cls.c file that fixes up comparison with
jiffies usage warning found by the checkpatch.pl tool

Signed-off-by: S. Stalin Srinivasan <stalinsrinivasan.s@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:54:46 -08:00
stalinsrinivasan.s 9979ef7d73 staging: dgnc: fix checkpatch.pl usage of volatile.
This is a patch to the dgnc_cls.c file that fixes up volatile usage
warning found by the checkpatch.pl tool

Signed-off-by: S. Stalin Srinivasan <stalinsrinivasan.s@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:54:46 -08:00
stalinsrinivasan.s cb3714a6b0 staging: dgnc: fix 80 characters per line limitation and code indent warnings.
This is a patch to the dgnc_cls.c file that
fixes up 80 characters per line and code indent
warnings found by the checkpatch.pl tool.

Signed-off-by: S. Stalin Srinivasan <stalinsrinivasan.s@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:54:46 -08:00
Archana kumari 3d47910be4 staging: dgnc: braces {} are not necessary for single statement in dgnc_cls.c
Fix checkpatch.pl issues with braces {} are not necessary
for single statement blocks in dgnc_cls.c

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-17 09:11:08 -07:00
Archana kumari 4a75ffa8ad staging:dgnc:Fixes use of deprecated headers in dgnc_cls.c
Fixes use of deprecated header <asm/io.h> in staging:dgnc:dgnc_cls.c

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16 09:42:42 -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 68b146e894 staging: dgnc: cls.c: changes var in cls_vpd function for sparse
This patch changes cls_vpd function's re_map_vpdbase variable
type and marker.

It removes these warnings found in cls.c:

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

The variables passed to readb needs to be of type u8
with a __iomem marker. re_map_vpdbase is passed into
readb in the code.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26 16:26:55 -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 5ca46fd4c8 staging: dgnc: cls.c: removes trailing whitespace
This patch removes trailing whitespace in
the dgnc_cls.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:52 -07:00
Sachin Kamat 17cd641b9a staging: dgnc: Remove version.h header inclusion in dgnc_cls.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:43 +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