Commit Graph

389 Commits

Author SHA1 Message Date
Amitoj Kaur Chawla f4edff5208 staging: dgnc: dgnc_driver: Remove useless initialisation
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Amitoj Kaur Chawla d09c1b96a7 staging: dgnc: dgnc_tty: Remove useless initialisation
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Cristina Moraru 51c826f073 staging: dgnc: Fix lines over 80 characters
Fix 'line over 80 characters' checkpatch.pl
warnings

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:56:23 -07:00
Salva Peiró 4b6184336e staging/dgnc: fix info leak in ioctl
The dgnc_mgmt_ioctl() code fails to initialize the 16 _reserved bytes of
struct digi_dinfo after the ->dinfo_nboards member. Add an explicit
memset(0) before filling the structure to avoid the info leak.

Signed-off-by: Salva Peiró <speirofr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:51:40 -07:00
Parshuram Thombare 36e712a8a1 staging: dgnc: simplify a trivial if-return sequence
Signed-off-by: Parshuram Thombare <thombarepr@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:09:51 -07:00
Sudip Mukherjee 7df227c4ec staging: dgnc: remove parenthesis
checkpatch was warning us about extra unneeded 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 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 9753007ed7 staging: dgnc: remove multiple blank lines
checkpatch warns us about multiple blank lines which are not needed.
Remove them.

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
Salah Triki 51abf45c23 staging: dgnc: take a lock when storing value in dgnc_poll_tick
Reads of dgnc_poll_tick are protected by dgnc_poll_lock spinlock, but the write
to dgnc_poll_tick is not. It could theoretically race.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:14 +01:00
Sudip Mukherjee 6d99d6a3cf staging: dgnc: remove dgnc_init_globals function
The dgnc_init_globals() function is only initializing the timer so
initialize it directly and remove dgnc_init_globals() and change the
comment appropriately.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:14 +01:00
Sudip Mukherjee 482e191d61 staging: dgnc: remove initialization of global
globals variable will be initialied to 0 and the global pointers will be
to NULL. No need to initialize them separately.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:14 +01: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 60acb623c9 staging: dgnc: change style of NULL comparison
Change the NULL comparison style as warned by checkpatch.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:30:10 +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 851f306d6e staging: dgnc: Fix line over 80 characters warning
Fix 'line over 80 characters' checkpatch warning

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
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
Anjali Menon 4ddc2f06c8 staging: dgnc: Fixed line over 80 characters long
This is a patch that fixes line over 80 characters coding style
warning detected by checkpatch.pl.

WARNING: line over 80 characters

Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:44 -07:00
Joe Perches 35bb99bf65 staging: dgnc: Remove unnecessary externs
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-08-14 18:51:57 -07:00
Navy Cheng f3c709b8fc Staging: dgnc: dgnc_driver.h: remove unnecessary comments
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-07-31 16:14:53 -07:00
Hari Prasath Gujulan Elango 7f5ad01816 staging: dgnc: free memory allocated
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-18 21:15:17 -07:00
Hari Prasath Gujulan Elango d8a76d669a staging: dgnc: fix typo in comments secion
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-18 21:13:48 -07:00
Hari Prasath Gujulan Elango 0aae092b5e staging: dgnc: remove ununsed Macro
Remove the ununsed Macro

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:30:04 -07:00
Gujulan Elango, Hari Prasath (H.) 7960386273 staging: dgnc: delete all references to 'flipbuf'
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-31 10:26:27 +09:00
Wim de With 8ad524ffb2 staging: dgnc: fix line length over 80 chars in dgnc_sysfs.c
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-31 10:26:27 +09:00
Buţiu Alexandru Octavian b2d3977f7d Staging: dgnc: fixed coding style issue in digi.h
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-31 10:26:26 +09:00
Giedrius Statkevičius eef94f6b7b staging: dgnc: remove redundant check
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-08 09:24:01 +02:00
Giedrius Statkevičius a74d8e2167 staging: dgnc: remove dead code in dgnc_tty_write()
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-08 09:24:01 +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
Giedrius Statkevičius ce2927e9a3 staging: dgnc: don't forget to check if ->channels[i] is NULL in 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-08 09:24:00 +02:00
Giedrius Statkevičius fa52d96c3e staging: dgnc: clean up allocation of ->channels[i]
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-08 09:24:00 +02:00
Giedrius Statkevičius 86b4e7e270 staging: dgnc: remove some dead code from dgnc_tty.c
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-08 09:23:59 +02:00
Carlos E. Garcia 69e98df782 Staging: fixed multiple spelling errors.
Fixed multiple spelling errors.

Signed-off-by: Carlos E. Garcia <carlos@cgarcia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:58 +02:00
Ioana Ciornei c471c989ad staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err()
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-04-01 17:37:57 +02:00
Giedrius Statkevičius c754ff966d dgnc: Clean up dgnc_sysfs.h
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-24 15:41:00 +01:00
Giedrius Statkevičius 3b84f2d910 dgnc: remove unused stuff from dgnc_cls.h
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-24 15:41:00 +01:00
Giedrius Statkevičius 20dad75285 dgnc: remove old 2.4-2.6 compat kernel defines
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-24 15:40:59 +01:00
Giedrius Statkevičius d533a524a8 dgnc: use linux/types.h instead of dgnc_types.h
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-24 15:40:59 +01:00
Giedrius Statkevičius 850b41f7ba dgnc: get rid of dpacompat.h, move remaining stuff to digi.h
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-24 15:40:59 +01:00
Giedrius Statkevičius 944b3ad426 dgnc: clean up digi.h
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-24 15:40:59 +01:00
Giedrius Statkevičius f82d189c33 dgnc: remove unused dgnc_ioctl_name() command
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-24 15:40:59 +01: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 5ec2936508 Staging: dgnc: release the lock before testing for nullity
The refactoring intrduced in
c84a083b99 ("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: c84a083b99 ("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-18 17:34:11 +01:00
Quentin Lambert c84a083b99 Staging: dgnc: Use goto for spinlock release before return
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-12 11:13:41 +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
Somya Anand 64e784c457 Staging: dgnc: Remove redundant parentheses
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-12 11:12:28 +01:00
Quentin Lambert 9f9de64c09 Staging: dgnc: dgnc_driver: Add a missing call to dgnc_tty_uninit
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-12 11:12:28 +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 d7f355d7b0 dgnc: Remove unneeded dgnc_state array of strings
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-12 11:10:18 +01:00
Navya Sri Nizamkari 2e363be0aa staging: dgnc: Use kcalloc instead of kzalloc.
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-12 11:10:18 +01:00
Dan Carpenter cb1185a4ae staging: dgnc: off by one in dgnc_mgmt_ioctl()
"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-12 11:08:58 +01:00
Giedrius Statkevičius 65da04c1ca dgnc: Make all lines under 80 characters in dgnc_driver.c
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-12 11:05:57 +01:00
Giedrius Statkevičius e9210a0309 dgnc: Make all lines under 80 characters in dgnc_cls.h
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-12 11:05:57 +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
Cass May f11cc56875 dgnc: Move DG_PART definition from Makefile to dgnc_driver.h
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-12 11:05:27 +01:00
Cass May fd933bae14 dgnc: Remove superfluous EXTRA_CFLAGS variable
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-12 11:05:26 +01:00
Darshana Padmadas a3d81a379b drivers: staging: dgnc: Replace min with min_t
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-09 13:30:40 +01:00
Salah Triki 5f9dca1e7d Staging: dgnc: Fix checking return value of register_chrdev
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-06 16:12:22 -08:00
Salah Triki 834d86735d staging: dgnc: fix braces {} are not necessary for single statement blocks
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-06 16:12:22 -08:00
Cristina Opriceana f40e06f0b7 Staging: dgnc: Replace printk() with dev_dbg()
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-01 15:12:14 -08:00
Cristina Opriceana c28645e3ca Staging: dgnc: Replace printk with dev_err
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-03-01 15:12:14 -08:00
Gamze POLAT b0487a7c73 Staging: dgnc: Removed trailing whitespace
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-26 13:15:41 -08:00
Aya Mahfouz 38e0c9d27a staging: dgnc: replace init_timer by setup_timer
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-26 13:12:40 -08:00
Vatika Harlalka 371ec40392 Staging: dgnc: Fix warning of code style
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-24 14:14:39 -08:00
Vatika Harlalka 9e39ab27fb Staging: dgnc: Removed trailing whitespace to improve readability.
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-24 14:14:39 -08:00
Vatika Harlalka 985d251b7e Staging: dgnc: Indented code to increase readability
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-02-24 14:14:39 -08:00
Davidlohr Bueso 2be90fef97 drivers/staging: use current->state helpers
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-28 11:25:28 -08:00
Andrew Milkovich 6f6304b85f Staging: dgnc: fixed some coding style errors
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>
2015-01-25 20:04:15 +08:00
Krzysztof Adamski 60e27886fd staging: dgnc: fix long lines in PCI device table
This patch fixes coding style of PCI device table declaration.

Signed-off-by: Krzysztof Adamski <k@japko.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 20:03:23 +08:00
Alexey Khoroshilov d7312aab23 staging: dgnc: implement proper error handling in dgnc_start()
dgnc_start() ignores errors in class_create() and device_create()
and it does not deallocate resources if dgnc_tty_preinit() fails.

The patch implements proper error handling.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:04:12 -08: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
Aya Mahfouz ac611dc60f staging: dgnc: dgnc_kcompat.h: remove unused macro
This patch removes the macro PARM_INT after removing all the variables
that depended on it.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz 2a71a3c7c7 staging: dgnc: remove debug symbols
This patch removes all of the debug symbols and the variable dgnc_debug
since they are not used anywhere in the code.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz ade5b9435b staging: dgnc: remove unused variable named rawreadok
This patch removes the variable rawreadok since it is only intialized
but not used in any of the driver functions.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz 6db43a9c38 staging: dgnc: dgnc_driver: remove all occurences of trcbuf_size
This patch removes the variable trcbuf_size given there is no real
use for it anymore. All of the debug variables in this driver is
basically dead code.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Aya Mahfouz 8a43572c32 staging: dgnc: dgnc_kcompat.h: remove unused macros
This patch removes the macros PARM_STR and PARM_ULONG given that they
are not used anywhere in the driver files.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:12:39 +08:00
Jiayi Ye 308c32f9e8 staging: dgnc: delete successive assignments to the same location
Successive assignments to the same location is meaningless and can be
deleted. The Coccinelle semantic patch was used to find cases.

@@
expression e1,e2,e3;
@@

(
 (<+...e1++...+>)=e2;
|
 (<+...e1--...+>)=e2;
|
 (<+...++e1...+>)=e2;
|
 (<+...--e1...+>)=e2;
|
e1=e2;
e1 = <+...e1...+>;
|
*e1=e2;
*e1=e3;
)

Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 15:41:43 +08: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
Dilek Uzulmez feba47a74d staging: dgnc: Remove space before tabs
This patch fixes the warning of "Please, no space before tab" produced
by checkpatch.pl. The modified file: dgnc_tty.c

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:18 +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
Linus Torvalds 683a52a101 TTY/Serial driver patches for 3.18-rc1
Here's the big tty/serial driver patchset for 3.18-rc1.
 
 Lots of little things in here, some good work from Peter Hurley on the
 tty core, and in lots of drivers.  There are also lots of other driver
 updates in here as well, full details in the changelog below.
 
 All have been in the linux-next tree for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlQ0aDwACgkQMUfUDdst+ymueACeI1i2exlGaBBSVQuUK2Jmx8Uz
 nukAn3KPuvvx+MKfMMBRpK0DQCzTxv4P
 =dwv1
 -----END PGP SIGNATURE-----

Merge tag 'tty-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver updates from Greg KH:
 "Here's the big tty/serial driver patchset for 3.18-rc1.

  Lots of little things in here, some good work from Peter Hurley on the
  tty core, and in lots of drivers.  There are also lots of other driver
  updates in here as well, full details in the changelogs.

  All have been in the linux-next tree for a while"

* tag 'tty-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (99 commits)
  Revert "serial/core: Initialize the console pm state"
  tty: serial: 8250: use 32bit variable for rpm_tx_active
  tty: serial: msm: Add earlycon support
  serial/core: Initialize the console pm state
  serial: asc: Conditionally use readl_relaxed (COMPILE_TEST)
  serial: of-serial: add PM suspend/resume support
  m68k: AMIGA_BUILTIN_SERIAL should depend on TTY
  asm/uapi: Add definition of TIOC[SG]RS485
  tty/metag_da: Add console_poll module parameter
  serial: 8250_pci: remove rts_n override from Baytrail quirk
  serial: cadence: Add generic earlycon support
  serial: imx: change the wait even to interruptiable
  serial: imx: terminate the RX DMA when the UART is suspending
  serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control
  serial: 8250: Add Quark X1000 to 8250_pci.c
  tty: omap-serial: pull out calculation from baud_is_mode16
  tty: omap-serial: fix division by zero
  xen_hvc: no reason to write the type key on xenstore
  tty: serial: 8250_core: remove UART_IER_RDI in serial8250_stop_rx()
  tty: serial: 8250_core: use the ->line argument as a hint in serial8250_find_match_or_unused()
  ...
2014-10-08 06:52:11 -04: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
Yeliz Taneroglu 3fad9641ab staging: dgnc: Fix no spaces at the start of a line in dpacompat.h
The following patch the checkpatch.pl warning:

drivers/staging/dgnc/dpacompat.h:27 warning: please, no spaces at the start of a line

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy 0eaa02e66d Staging: dgnc: Add missing blank line
This fixes the following checkpatch.pl warning:
WARNING: Missing a blank line after declarations

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy 3c4019d3e0 Staging: dgnc: Remove unnecessary braces
This fixes the following checkpatch.pl warnings:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy c313fe2c34 Staging: dgnc: Remove return in void function
This fixes the following checkpatch.pl warnings:
WARNING: void function return statements are not generally useful

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:37:44 -07:00
Mahati Chamarthy ac9080029d Staging: dgnc: Remove space before parenthesis
This fixes the following checkpatch.pl error:
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:53:38 -04:00
Roberta Dobrescu b4e28a6142 staging: dgnc: dgnc_driver.h: Remove non-standard spinlock's macros
This patch removes non-standard spinlock's macros as they are no longer
used by this driver.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:52:12 -04:00
Roberta Dobrescu 66663dc103 staging: dgnc: dgnc_driver.c: 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-28 22:52:12 -04:00
Roberta Dobrescu 7be869b072 staging: dgnc: dgnc_neo.c: 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
...>

Additionally replace 'lock_flags2' with 'flags2'.
This was done by hand since it had only 3 occurences and all in this file.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:52:12 -04:00
Roberta Dobrescu a44b508a32 staging: dgnc: dgnc_tty.c: 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-28 22:52:12 -04:00
Roberta Dobrescu 9a03d7c8cf staging: dgnc: dgnc_mgmt.c: 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-28 22:50:54 -04:00
Gulsah Kose 42c4d46e38 staging: dgnc: Fixed white space warning.
This patch fixes "please, no space before tabs" checkpatch.pl warning in
digi.h

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:50:54 -04: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
Gulsah Kose 77b55d84aa staging: dgnc: Fix unnecessary braces warning.
Fixes "braces {} are not necessary for single statement blocks"
checkpatch.pl warnings in dgnc_sysfs.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 13:36:56 -07:00
Roberta Dobrescu fb33aa47a0 staging: dgnc: Check sscanf return value
This fixes the following checkpatch.pl warnings:
WARNING: unchecked sscanf return value

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-09-19 17:25:23 -07:00
Gulsah Kose f23e875fd2 staging: dgnc: Fix unnecessary space warning.
Fixed "Unnecessary space before function pointer argument" checkpatch.pl
warning in dgnc_driver.h

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:25:22 -07:00
Gulsah Kose e8756d4a51 staging: dgnc: Fix missing blank line warning.
Fixes "Missing a blank line after declarations" checkpatch.pl warning in
dgnc_sysfs.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:25:22 -07:00
Vaishali Thakkar 3dfe755780 Staging: dgnc: Merge lines and remove unused variable for immediate return
This patch merges two lines in a single line if immediate
return is found. It also removes unnecessory variable rc
as it is no longer needed.

This is done using Coccinelle. Semantic patch used for this
is as follows:

@@
type T;
identifier i;
identifier f;
constant C;
@@
- T i;
  ...when != i
     when strict
(
  return -C;
|
- i =
+ return
     f(...);
- return i;
)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:25:22 -07:00
Roberta Dobrescu 10352c2a69 staging: dgnc: Move open brace on previous line
This fixes the following checkpatch.pl errors:
ERROR: that open brace { should be on the previous line

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:25:22 -07:00
Roberta Dobrescu 05a70e1403 staging: dgnc: Do not initialise statics to 0 or NULL
This fixes the following checkpatch.pl error:
ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:21:27 -07:00
Roberta Dobrescu b051017fb4 staging: dgnc: Replace kzalloc with kcalloc
This fixes the following checkpatch.pl warnings:
WARNING: Prefer kcalloc over kzalloc with multiply

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:17:14 -07:00
Roberta Dobrescu f3dadd29f7 staging: dgnc: Fix warnings relating to printk()
This fixes the following checkpatch.pl warnings:
WARNING: printk() should include KERN_ facility level
It replaces printk() with dev_dbg() in order to avoid the warning that a more
specific function should be used.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:17:14 -07:00
Bill Pemberton 27d5775e75 staging: dgnc: remove Neo card ids from device table
The Digi Neo cards are supported by the jsm driver.  Remove support
for these cards from dgnc.

Signed-off-by: Bill Pemberton <wfp5p@worldbroken.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 13:15:49 -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
Konrad Zapalowicz 239d1346f5 staging: dgnc: Fix sleeping under spinlock bug
This commit changes the memory allocation flags to ATOMIC in order to
avoid sleeping in the nowait/nolock code.

Signed-off-by: Konrad Zapalowicz <bergo.torino+kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 10:44:33 -07:00
Seunghun Lee 79f284d29b staging: dgnc: remove some unused macros
These macros do nothing, so remove it.

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-31 13:00:16 -07:00
Kieron Browne fb33cac8dc staging: dgnc: Fix checkpatch include warning
checkpatch.pl fix. Use #include <linux/uaccess.h> instead of
<asm/uaccess.h>

Signed-off-by: Kieron Browne <kieron.browne@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 14:02:34 -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 ed7f92da59 staging: dgnc: Remove unnecessary dgnc_Major_Control_Registered variable
The dgnc_Major_Control_Registered variable purpose was to act as a flag
to indicate if the character device has been successfully registered
into the kernel. This flag was later checked in the module cleanup
function to know if the character device needs to be deregistered.

However the {device,class}_destroy and unregister_chrdev functions may
be called with 'invalid' data perfectly fine. This means that this
variable is not needed and can safely be removed which is what this
commit does.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-17 09:52:25 -07:00
Konrad Zapalowicz 0b3a07ede3 staging: dgnc: Remove not needed dgnc_driver_start variable
The dgnc_driver_start variable purpose was to indicate if the driver
'start' routine has been called. Now, because the 'start' routine can
only be called once this variable is not needed thus this commit
removes it.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-17 09:52:25 -07:00
Konrad Zapalowicz 3599abafcc staging: dgnc: Remove driver-wide polling counter variable
The polling counter variable is only exposed via sysfs and has no other
purpose.

Now, since the polling shall be implemented as a board specific feature
rather than being global in the driver this counter is obsolete.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-17 09:52:24 -07:00
Konrad Zapalowicz 1d8c5aa329 staging: dgnc: Remove driver-wide state variable
This commit removes the driver's global state variable. This is ok
because the state was changed only once at the end of init phase thus
the future usage of this variable is pointless.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-17 09:52:24 -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
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
Konrad Zapalowicz 98b3bcc05f staging: dgnc: Update the TODO file
It turned out that the TODO file contained the invalid information as
some of the work has already been done. This commit updates it with the
current status of what is left to be done.

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 92ded48cc3 staging: dgnc: Siplify the dgnc_start function
This commit slightly simplifies the sgnc_start() function by
rearranging it. As a result the indentation level is reduced.
This is not the functional change.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:13 -07:00
Konrad Zapalowicz 9a633d00d1 staging: dgnc: Move utility functions out of dgnc_driver.c
This commit moves the utility functions out of dgnc_driver.c file and
puts them in the new dgnc_utils.{c,h} files. The accompanying changes
adjust the existing code to work with this design.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:13 -07:00
Konrad Zapalowicz bbecbacbed staging: dgnc: Remove unnecessary functions from dgnc_driver.c
This commit slightly cleans up the dgnc_driver.c file. The changes
include removing one-line proxy functions as they were not needed.
Additionaly the pci 'remove' function is deleted because it was no
need for it.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:13 -07:00
Konrad Zapalowicz ea6e9dea2e staging: dgnc: Fix frame size is larger than 1024B
This comit fixes the following sparse warnign:

drivers/staging/dgnc/dgnc_tty.c:572:1:
    warning: the frame size of 1060 bytes is larger than 1024 bytes
    [-Wframe-larger-than=]

This was caused by having buffer as an automatic variable. This commit
moves it from the stack to the heap.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:13 -07:00
Konrad Zapalowicz 338fd80f9d staging: dgnc: Fix no spaces before tabs checkpath warning
This commit corrects the 'no space before tabs' checkpath warning.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:13 -07:00
Konrad Zapalowicz 1e8810026b staging: dgnc: Fix externs should be avoided in the .c files
This commit fixes the following checkpatch warnings:

WARNING: externs should be avoided in .c files
    #80: FILE: drivers/staging/dgnc/dgnc_driver.c:80:
        +int            dgnc_init_module(void);
    #81: FILE: drivers/staging/dgnc/dgnc_driver.c:81:
        +void           dgnc_cleanup_module(void);

This was caused by putting the declarations for module init and module
exit fucntions on the top of the file. The fix removes these
declarations plus it also corrects the type of the init/exit functions.

Due to the dependency between init and exit functions the
dgnc_cleanup_module had to be put first.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:13 -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 e325f661cb staging: dgnc: removes unused if defined code
DGNC_TRACER and TRC_TO_KMEM are never defined.

This patch removes if defined DGNC_TRACER and TRC_TO_KMEM code.

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-30 17:15:12 -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
Seunghun Lee fc1cfd3a54 staging: dgnc: Fix space required after that ','
This patch fixes checkpatch errors:
"space required after that ','"

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-24 15:04:22 -07:00
Seunghun Lee 5813104211 staging: dgnc: Remove all C99 comments
This patch fixes the following checkpatch error:

ERROR: do not use C99 // comments

CC: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22 16:08:13 -07:00
Jeremiah Mahler 635c4efa17 staging: dgnc: DGNC_VERIFY_BOARD macro in do while block
Enclose the body of the multi-statement DGNC_VERIFY_BOARD macro inside a
do - while block as per Documentation/CodingStyle.  Fixes 1 error found
by checkpatch.pl.

Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-13 12:08:03 -07:00
Daeseok Youn f420c6c8e8 staging: dgnc: remove redundant memset call
The brd is allocated by kzalloc() in dgnc_found_board()
so do not need to set 0 to member variable.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:07:30 -07:00
Daeseok Youn 354579c2ee staging: dgnc: removes unreachable code
dgnc_tty_ioctl() cannot reach the end of function.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:07:30 -07:00
Daeseok Youn 3098e51468 staging: dgnc: Fix unsigned value for less than zero
The "un->un_open_count" is unsigned variable, so it cannot
be less than zero.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:07:30 -07:00
Daeseok Youn 5b4af85eed staging: dgnc: remove redundant null check for kfree()
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:07:30 -07:00
Guillaume Morin 78adbb284c staging: dgnc_driver.c: code style fixes
Simple code style fixes:
 - "if(" -> "if ("
 - "switch(" -> "switch ("
 - move one open brace to the line of the declaration instead of
   its own line
 - remove trailing whitespace

Signed-off-by: Guillaume Morin <guillaume@morinfr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-29 14:37:01 -07:00
Vincent Heuken 07467e509b Staging: dgnc: fixed brace coding style issue in dgnc_driver.c
This is a patch to the dgnc_driver.c file that fixes the following
error:
ERROR: open brace '{' following function declarations go on
the next line

Signed-off-by: Vincent Heuken <me@vincentheuken.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 17:10:12 -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 9cdf838b3a staging: dgnc: dgnc_tty: Remove a prohibited space
Remove a prohibited space before a closed parenthesis of if statement
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-24 02:12:40 +09:00
Masaru Nomura a82477c3dc staging: dgnc: dgnc_tty: Add a required space
Add a required space before an open parenthesis of if statement
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-24 02:12:40 +09: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
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
Martin Kepplinger 0f33ae1ed6 staging: dgnc: use dev_err() instead of printk()
Use dev_err() insted of printk() in order to provice userspace with
more useful information and use the common kernel coding style.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:46:00 -07:00
Vitaly Osipov 36aa10aa01 staging: dgnc: redundant NULL checks before kfree()
Removed redundant NULL checks before calling kfree()

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:46:00 -07:00
Son P. Nguyen 3f2889621a Staging: dgnc: dgnc_driver: fixed incorrect braces
Fixed incorrect braces (coding style)

Signed-off-by: Son P. Nguyen <fastmutex@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:46:00 -07:00
Antoine Sirinelli 2b46be68a1 staging: dgnc: cleanup dgnc_finalize_board_init()
Trivial cleanups:
- Transform a printk() to a dev_err() call
- Fix 2 lines over 80 characters

Signed-off-by: Antoine Sirinelli <antoine@monte-stello.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:33:47 -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
Daeseok Youn 93c76c9c1d staging: dgnc: replace unnecessary while() with if()
It doesn't need to use while loop for getting newrate,
because it always breaks out the end of while loop with
"break". So just replace while with if.

And the type of newrate is "unsigned int", this type
is never less than zero. If it can be set to negative value by
user application with ioctl(), it is not zero but it
can be a unexpected value for setting custom baudrate.

Also smatch says:
drivers/staging/dgnc/dgnc_tty.c:967 dgnc_set_custom_speed() warn:
 unsigned 'newrate' is never less than zero.
drivers/staging/dgnc/dgnc_tty.c:981 dgnc_set_custom_speed() info:
 ignoring unreachable code.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:37:46 -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
Iulia Manda 0469c7471e Staging: dgnc: fix indentation in dgnc_mgmt.c
Align test parts in if statement on separate lines.

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-13 16:17:59 -07:00
Iulia Manda 3393fe9077 Staging:dgnc: Fixed space prohibited between function name and '('
Deleted space between sizeof and open parenthethis.

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10 23:01:06 -07:00
Iulia Manda 8dd64acdbd Staging:dgnc: Use uaccess.h header from linux dir instead of asm
Include <linux/uaccess.h> instead of <asm/uaccess.h>

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10 22:58:33 -07:00
Iulia Manda 969fbc860a Stagind:dgnc: Fixed unnecessary braces for single statement blocks
Deleted unnecessary braces for single statement if blocks.

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10 22:58:25 -07:00
Iulia Manda 1c1dd2a06d Staging:dgnc: Fixed else not following close brace error
Fix checkpatch.pl warning - else should follow close brace.

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-10 22:58:02 -07:00
Himangi Saraogi cf92c9cc89 staging:dgnc: Replace printk by pr_warn
This patch replaces printk with pr_warn as the printk calls are used to
display warnings to remove the checkpatch.pl warnings:
WARNING: printk() should include KERN_ facility level
and then WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev,
... then pr_warn(...  to printk(KERN_WARNING ... on adding KERN_WARNING
message designation.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 19:21:13 -08:00
Monam Agarwal 206654728b Staging: dgnc: Fix struct file_operations should normally be const
This patch fixes following checkpatch.pl warning:
WARNING:struct file_operations should normally be const

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 13:36:38 -08:00
Rashika Kheria f4ad847a9f drivers: dgnc: Include appropriate header file in dgnc_trace.c
Include appropriate header file dgnc/dgnc_trace.h in dgnc_trace.c
because function dgnc_tracer_free() has its prototype declaration in the
header file.

This eliminates the following warning in dgnc_trace.c:
drivers/staging/dgnc/dgnc_trace.c:180:6: warning: no previous prototype for ‘dgnc_tracer_free’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:47:35 -08: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
Aldo Iljazi 5ba21c464b Staging: dgnc: dgnc_trace.c: fixed coding style issues
Fixed the following coding style issues:

Lines 66-70: Replaced spaced with tabs.
Lines 75, 98, 182: Inserted space before the open parenthesis.
Line 89: Inserted spaces around that '='

Signed-off-by: Aldo Iljazi <mail@aldo.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-03 09:03:20 -08: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
Ashvini Varatharaj e15b0c4eeb Staging: dgnc: removing the comparison 'board<0'
Fix dgnc_mgmt_ioctl() warn: unsigned 'board' is never less than zero.

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
Archana kumari a27582310c staging: dgnc: braces {} are not necessary for single statement in dgnc_driver.c
Fixes "braces {} are not necessary for single statement blocks" warning
in dgnc_driver.c

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 14:35:05 -07:00
Archana kumari 4ee0925da1 staging: dgnc:Removed unecessary error messages in dgnc_driver.c
Fixed removal of unecessary error messages in staging:dgnc:dgnc_driver.c

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 14:35:05 -07: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
Sachin Kamat 968a4e9208 staging: dgnc: dgnc_tty: Do not use 0 for NULL pointer
Do not use 0 for NULL pointer.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:36:31 -07:00
Lidza Louina a07bf39a65 staging: dgnc: changes arguments in sizeof
The arguments that were passed into sizeof were
generic. This patch changes this by putting
the actual item that we need a size of instead.

For example:
-   kzalloc(sizeof(struct dgnc_board), GFP_KERNEL);
+   kzalloc(sizeof(*brd), GFP_KERNEL);

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-05 17:52:58 -07:00
Sachin Kamat d90ed81ac4 staging: dgnc: Remove KERNEL_VERSION check
This check is not required.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-30 18:47:00 -07:00
Jingoo Han 0e4f66b448 staging: dgnc: Remove casting the return value which is a void pointer
Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

CC: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 09:26:12 -07:00
Lidza Louina b74c746120 staging: dgnc: removes LINUX_VERSION_CODE conditionals
This patch removes the conditionals that make sure
the driver supports various versions of the kernel.
They aren't needed.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:07:12 -07:00
Greg Kroah-Hartman e2aad1d571 Merge 3.12-rc2 into staging-next.
This resolves the merge problem with two iio drivers that Stephen
Rothwell pointed out.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 08:59:04 -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
Kees Cook 5418ae3188 staging: dgnc: fix potential format string flaw
Make sure that format strings cannot leak into printk() calls from the
msgbuf string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17 07:39:27 -07:00
Lidza Louina c211148fb6 staging: dgnc: adds TODO
This patchs adds a TODO for the driver.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-30 11:28:58 -07:00
Lidza Louina f230586994 staging: dgnc: driver.c and .h: removes dgnc_driver_kzmalloc func
This patch removes the dgnc_driver_kzmalloc function from
driver.c and driver.h. A previous patch replaced all
dgnc_driver_kzmalloc function calls with kzalloc.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27 21:56:32 -07:00
Lidza Louina 52f9d66844 staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc
This patch replaces dgnc_driver_kzmalloc with kzalloc.
A patch that follows removes the dgnc_driver_kzmalloc
function.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27 21:55:26 -07:00
Lidza Louina a7a75386f9 staging: dgnc: tty.c: updates uart_struct declaration for sparse
This patch edits the type casts neo_uart_struct and
cls_uart_struct. A previous patch added the marker __iomem
to these structs. This patch ensures that the change to
the marker is consistent. This also removes these
sparse warnings:

warning: incorrect type in assignment (different address spaces)
  expected struct neo_uart_struct [noderef] <asn:2>*ch_neo_uart
  got struct neo_uart_struct *<noident>
warning: incorrect type in assignment (different address spaces)
  expected struct cls_uart_struct [noderef] <asn:2>*ch_cls_uart
  got struct cls_uart_struct *<noident>

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27 21:55:26 -07:00
Lidza Louina e7f1c9320e staging: dgnc: tty.c: edits var in init func for sparse
This patch edits the vaddr variable in dgnc_tty_init.
The variable gets set to board_t->re_map_membase. A
previous patch changed the re_map_membase variable's
marker and type. This patch makes sure that the
changes are consistent and that it doesn't cause
sparse warnings.

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 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 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 7915dea707 staging: dgnc: driver.h: changes a struct board_t var's type and marker for sparse
This patch changes the board_t->re_map_membase variable
type and marker.

It removes these warnings found in the neo.c,
driver.c and cls.c files:

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

The variables passed to readb and writeb need to
be of type u8 with a __iomem marker. These warnings
were popping up everytime the readb and writeb
functions were called with a
board_t->re_map_membase variable.

The change made to the driver.h file adds the marker
and changes the variable type.

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 2587771a61 staging: dgnc: neo_uart_struct: adds marker and changes vars' types for sparse
This patch fixes these warnings found in the neo.c file:

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

The variables passed to readb and writeb need to
be of type u8 with a __iomem marker. These warnings
were popping up everytime the readb and writeb
functions were called with a neo_uart_struct variable.

The change made to the driver.h file adds the marker
to the neo_uart_struct and the changes in neo.h
changes the variables' types.

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 2ea550bdfa staging: dgnc: cls_uart_struct: adds marker and changes vars' types for sparse
This patch removes these sparse warnings found in the cls.c file:

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

The variables passed to readb and writeb need to
be of type u8 with a __iomem marker. These warnings
were popping up everytime the readb and writeb
functions were called with a cls_uart_struct variable.

The change made to the driver.h file adds the marker
to the cls_uart_struct and the changes in cls.h
changes its variables' types.

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
Chen Gang b0b15cb27d staging: dgnc: Kconfig: add dependency PCI for it
DGNC is based on PCI, so need add related dependency, or when compiled
with PCI disabled, it will be fail.

The related error (randconfig for PCI disabled under s390):

  drivers/staging/dgnc/dgnc_cls.c:1394:2: error: implicit declaration of function ‘ioremap’ [-Werror=implicit-function-declaration]
  drivers/staging/dgnc/dgnc_cls.c:1407:3: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]

Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26 06:29:09 -07:00
Lidza Louina 8287ac00dd staging: dgnc: driver.c: removes dgnc_mbuf function
This patch removes the dgnc_mbuf function. This function was causing the
errors:

drivers/staging/dgnc/dgnc_driver.c: In function 'dgnc_mbuf.constprop.0':
drivers/staging/dgnc/dgnc_driver.c:945:1: warning: the frame size of 1032
bytes is larger than 1024 bytes [-Wframe-larger-than=]

drivers/staging/dgnc/dgnc_tty.c: In function 'dgnc_sniff_nowait_nolock':
drivers/staging/dgnc/dgnc_tty.c:614:1: warning: the frame size of 1056
bytes is larger than 1024 bytes [-Wframe-larger-than=]

This patch removes it so the kernel won't be making noise when its
device is found on the system.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-22 12:35:26 -07:00
Tushar Behera 68a5a5f38c staging: dgnc: driver.c: Need to include slab.h
With 'allyesconfig', we get following error without this.

drivers/staging/dgnc/dgnc_driver.c: In function ‘dgnc_cleanup_board’:
drivers/staging/dgnc/dgnc_driver.c:459:3: error: implicit declaration of function ‘kfree’ [-Werror=implicit-function-declaration]
   kfree(brd->msgbuf_head);
   ^
drivers/staging/dgnc/dgnc_driver.c: In function ‘dgnc_driver_kzmalloc’:
drivers/staging/dgnc/dgnc_driver.c:905:2: error: implicit declaration of function ‘kmalloc’ [-Werror=implicit-function-declaration]
  void *p = kmalloc(size, priority);

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-22 10:03:37 -07:00
Lidza Louina 90d2a47152 staging: dgnc: tty.c: fixes code indent error
This patch fixes the error "code indent should use
tabs where possible" in dgnc_tty.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 0a60eb3313 staging: dgnc: sysfs.c: fixes code indent error
This patch fixes the error "code indent should use
tabs where possible" in dgnc_sysfs.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