Commit Graph

126 Commits

Author SHA1 Message Date
Mark Hounschell 67d5dc8a69 staging: dgap: fix the rest of the checkpatch warnings in dgap.c
This patch fixes all the simple_strtol and simple_strtoul warnings
as reported by checkpatch. After this patch, checkpatch will report
zero errors or warnings on dgap.c.

Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:54:39 -07:00
Mark Hounschell bbfbe832ff staging: dgap: re-factor some more code for 80+ lines
This patch fixes more 80+ char lines as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 08:49:06 -07:00
Mark Hounschell c43846a91f staging: dgap: get rid of DGAP_LOCK and DGAP_UNLOCK macros
This patch replaces the DGAP_LOCK and DGAP_UNLOCK macros with
spin_lock_irqsave spin_unlock_irqrestore.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 08:49:06 -07:00
Mark Hounschell 8cdd76391e staging: dgap: re-factor some code for 80+ lines as reported by checkpatch
This patch re-factors some code to fix some 80+ lines as reported by checkpatch.
This patch was suggested and authored by Dan Carpenter. A test case for this
patch has been written and used to show the patch to be correct.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 08:49:06 -07:00
Masood Mehmood fd54889b65 staging: dgap: Fixed sparse error: same symbol redeclared with different type
sparse reported dgap_do_fep_load is redeclared with different type. while
fixing, I noticed __user attribute is used incorrectly in declaration.
There is no need to define __user for firware->data.

Replaced the __user with 'const uchar *' from function dgap_do_fep_load and
did the same for function dgap_do_bios_load

patch generated against: next-20140318

Signed-off-by: Masood Mehmood <ody.guru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 16:22:27 -07:00
Mark Hounschell c0c31b9b2a staging: dgap: Add a pr_info per board info
This patch adds a pr_info per board that indicates
board number, type, etc..

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:35:44 -07:00
Mark Hounschell bd3e43e5f0 staging: dgap: remove more unneeded brd-state states
This patch removes more unneeded brd-state states

Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:35:43 -07:00
Mark Hounschell b2e78c2440 staging: dgap: remove unused brd->state states
This patch removes unused brd->state states previously
used in the userland firmware download process.

Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:35:43 -07:00
Mark Hounschell 74f71e7175 staging: dgap: remove unneeded dgap_driver_states
The only driver states we need now is READY or !READY.
No need for a sysfs method of seeing those 2 states so
the sysfs entries for dgap_driver_state is also removed.

Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:35:43 -07:00
Mark Hounschell 211568d000 staging: dgap: Replace/remove DGAP_SPINLOCK_INIT macro
This patch gets rid of the DGAP_SPINLOCK_INIT macro

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:33:35 -07:00
Mark Hounschell 339db3a32b staging: dgap: Remove unused DGAP_TRYLOCK macro
This patch removes  the unused DGAP_TRYLOCK macro

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:33:35 -07:00
Mark Hounschell 928d70bb1e staging: dgap: Remove unneeded code from dgap.c
This patch removes more unneeded code that was
supporting the old firmware loading process

Signed-off-by: Mark Hounschell <markh@compro.net>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:33:34 -07:00
Mark Hounschell abbdd11ac3 staging: dgap: remove some unused defines in dgap.h
This patch removes some unused defines in dgap.h

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:33:34 -07:00
Mark Hounschell 93fb1e256a staging: dgap: fix a few more 80+ char lines (02/02)
This patch fixes a few more 80+ char lines as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:32:03 -07:00
Mark Hounschell 84e88287d8 staging: dgap: fix a few more 80+ char lines (01/02)
This patch fixes a few more 80+ char lines as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:32:03 -07:00
Mark Hounschell 70d97a616f staging: dgap: fix a few 80+ char lines
This patch fixes a few 80+ char lines
as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:31:47 -07:00
Himangi Saraogi e054e2a728 staging: dgap: Fix mismatch in function argument types
This patch fixes the following error reported by sparse:
drivers/staging/dgap/dgap.c:4428:13: error: symbol 'dgap_do_fep_load' redeclared with different type (originally declared at drivers/staging/dgap/dgap.c:215) - incompatible argument 2 (different address spaces)

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Pablo Neira Ayuso <pablo@gnumonks.org>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 18:26:24 -07:00
Alexey Khoroshilov 0669e5fa80 staging: dgap: implement proper error handling in dgap_start()
dgap_start() ignored errors in class_create() and device_create().
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>
2014-03-08 22:44:35 -08:00
Alexey Khoroshilov af07daa0af staging: dgap: remove unneeded status variables
dgap_driver_start and dgap_Major_Control_Registered are used
to keep status of initialization of the driver as a whole and its "Major Control".
But the code that checks them is executed once on module init/unload.
That makes no sense in these variables as far as their values are predictable
at any time.

Also "dgap_downld" device was removed, while
device_destroy(MKDEV(DIGI_DGAP_MAJOR, 1)) is still in dgap_cleanup_module().
The patch removes it by the way.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 22:44:35 -08:00
Ebru Akagunduz 3eed3d360d Staging:dgap: Fix Macros with complex values should be enclosed in dgap.h
Fix checkpatch.pl issues with macros with complex
values should be enclosed in dgap.h

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 20:19:14 -08:00
Ebru Akagunduz 421343a438 Staging:dgap: Fix "foo * bar" should be "foo *bar" in dgap.h
Fix checkpatch.pl issues with "foo *  bar" should
be "foo *bar" in dgap.h

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 15:04:20 -08:00
Ebru Akagunduz 857eef411c Staging:dgap: Fix open brace '{' following struct go on the same line in dgap.h
Fix checkpatch.pl issues with open brace '{'
following struct go on the same line in dgap.h

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 15:04:20 -08:00
Mark Hounschell 002de0ba87 staging: dgap: Simplify and cleanup dgap_init_module function
This patch simplifies and cleans up the dgap_init_module function. It also fixes
a possible double free condition as a result pci_unregister_driver possibly
being called twice.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:16:40 -08:00
Mark Hounschell 434b679bdb staging: dgap: Remove printks associated with sysfile creation
This patch removes printks associated with sysfile creation
and changes the dgap_create_driver_sysfiles function to return
an int so we can check for errors in the sysfile creation
process.

The printk's were flagged by checkpatch but then
driver_create_file was flagged by checkpatch for
not checking its return. So we remove the printk's
and check the return of driver_create_file.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:16:40 -08:00
Mark Hounschell 6126022800 staging: dgap: Remove some dead code
This patch removes more dead code and code associated
with that dead code. The from_user variable in the
dgap_tty_write function was never true. The code under
its test was never being executed. So variables and
functions supporting only that code are also dead.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:16:39 -08:00
Mark Hounschell 8fc324e4ae staging: dgap: fix a few more 80+ lines as reported by checkpatch
This patch fixes a few 80+ char lines as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:16:39 -08:00
Mark Hounschell 8a2c9c44ce staging: dgap: fix a few more 80+ lines as reported by checkpatch
This patch fixes a few 80+ char lines as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:16:39 -08:00
Mark Hounschell 6045b6af49 staging: dgap: fix a few more 80+ lines as reported by checkpatch
This patch fixes a few 80+ char lines as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:16:39 -08:00
Mark Hounschell 2f60b3336c staging: dgap: fix a few 80+ char lines as reported by checkpatch
This patch fixes a few of the many 80+ character lines
as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:14:37 -08:00
Mark Hounschell af5b80bef9 staging: dgap: fix suspect code indent for conditional statements checkpatch warning
This patch fixes a checkpatch warning for
suspect code indent for conditional statements

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:14:37 -08:00
Mark Hounschell c4875ebf2e staging: dgap: fix checkpatch warning on sscanf usage
This patch fixes a checkpatch warning for not checking
the return value of sscanf.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:14:37 -08:00
Mark Hounschell c96f565e88 staging: dgap: Remove module param and sysfs var rawreadok
This patch removes the rawreadok module param and sysfs var
previously used to enable flip buffer bypass. Code dealing
with that param was removed previously.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:14:37 -08:00
Mark Hounschell a9072fe056 staging: dgap: remove unnecessary dgap_global_lock
dgap_global_lock is no longer required. This patch
removes it.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:14:37 -08:00
Mark Hounschell 54794d196b staging: dgap: Don't remove sysfs group we failed to create
We should not remove a sysfs group we failed to create

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:14:36 -08:00
Mark Hounschell 249e7343c4 staging: dgap: fix some pr_warns with new lines in the string
This patch fixes some pr_warns that have newline
chars in the string because they mess up the
output.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:12:47 -08:00
Mark Hounschell 82ed97747d staging: dgap: Add curly braces back in for Multi-line indent block
Multi-line indent blocks get curly braces for readability.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:12:47 -08:00
Mark Hounschell 3eb141511b staging: dgap: get rid of nasty DGAP_VERIFY_BOARD macro
This patch replaces the DGAP_VERIFY_BOARD macro with
the dgap_verify_board function because of checkpatch error.

Signed-off-by: Mark Hounschell <markh@compro.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:10:58 -08:00
Mark Hounschell dc7fcc96d9 staging: dgap: Remove more degug/tracing code
This patch removes more, if not all, of the debug/tracing code

Signed-off-by: Mark Hounschell <markh@compro.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:10:58 -08:00
Mark Hounschell 9b073ac53e staging: dgap: Fix various previously missed checkpatch errors
This patch fixes various small checkpatch errors
I missed in patches 01-10.

Remove check for kfree of brd->channels as kfree is safe.
Also there is no need to set it to NULL after freeing it.

Remove a useless cast for a kzalloc return value.

Remove double negative test in a white space fix line.

Signed-off-by: Mark Hounschell <markh@compro.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 14:10:58 -08:00
Mark Hounschell 8cbb5e3f9d staging: dgap: Fix printk related errors as reported by checkpatch
This patch fixes some printk related errors report by checkpatch.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 12:05:20 -08:00
Mark Hounschell 01a8d25518 staging:dgap: Fix externs should be avoided in .c files as reported by checkpatch
This patch fixes "externs should be avoided in .c files"
in dgap.c as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 12:04:12 -08:00
Mark Hounschell d1c3c6f5de staging: dgap: fix do not use assignment in if condition as reported by checkpatch
This patch fixes "do not use assignment in if condition"
errors reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 15:03:58 -08:00
Mark Hounschell b115b024c4 staging: dgap: Fix white space errors as reported by checkpatch
This patch fixes white space errors in dgap.c
as reported by checkpatch. It also changes
unnecessary mutliple empty lines with a single
empty line

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 15:00:28 -08:00
Mark Hounschell 305ec8740d staging: dgap: Fix bracing errors reported by checkpatch
This patch fixes bracing errors in dgap.c
as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:58:00 -08:00
Mark Hounschell 3d9dc5db40 staging: dgap: Fix include errs reported by checkpatch
This patch fixes all "include" related errors in
dgap.c as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:58:00 -08:00
Mark Hounschell 5e9d817271 staging: dgap: Fix foo* bar should be foo *bar as reported by checkpatch
This patch fixes "foo* bar should be foo *bar" errors
in dgap.c as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:57:59 -08:00
Mark Hounschell 7d6069d785 staging: dgap: Fix indent errs as reported by checkpatch
This patch fixes all indent errs in dgap.c as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:50:31 -08:00
Mark Hounschell cf42c34df5 staging: dgap: Fix all return statments in err as reported by checkpatch
Fix all return staments in err as reported by checkpatch

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:50:30 -08:00
Mark Hounschell 31960c16c4 staging:dgap: remove digi debug and tracing code
The original debug and tracing code is no longer required.
This patch removes it

Signed-off-by: Mark Hounschell <markh@compro.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:34:09 -08:00
Mark Hounschell 6c8b84efe5 staging: dgap: fix kernel oops on port open
This patch addresses the follow error message followed
by a kernel oops:

dgap: driver does not set tty->port. This will crash the kernel later. Fix the driver

It also renames the main function this patch addresses because
its name is misleading.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 12:58:16 -08:00