cascardo/linux.git
8 years agostaging: skein: Convert local rotl_64 to kernel's rol64
Joe Perches [Mon, 28 Mar 2016 23:51:17 +0000 (16:51 -0700)]
staging: skein: Convert local rotl_64 to kernel's rol64

Remove the local inline and use the generic kernel rol64 instead.

Miscellanea:

o Added a newline between a multiple line macro for consistency
  with the other multiple line macros

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use mutex instead of struct semaphore hSemScanReq
Chaehyun Lim [Mon, 28 Mar 2016 04:56:00 +0000 (13:56 +0900)]
staging: wilc1000: use mutex instead of struct semaphore hSemScanReq

This patch replaces struct semaphore hSemScanReq with struct mutex
scan_req_lock. It is better to use mutex than semaphore.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unused struct semaphore SemHandleUpdateStats
Chaehyun Lim [Mon, 28 Mar 2016 04:55:59 +0000 (13:55 +0900)]
staging: wilc1000: remove unused struct semaphore SemHandleUpdateStats

struct semaphore SemHandleUpdateStats is defined but never used in this
driver, so just remove it.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: change data type of wid argument in wilc_wlan_cfg_get_val
Chaehyun Lim [Mon, 28 Mar 2016 04:55:58 +0000 (13:55 +0900)]
staging: wilc1000: change data type of wid argument in wilc_wlan_cfg_get_val

This patch changes data type of wid argument in wilc_wlan_cfg_get_val
from u32 to u16. It is better to change data type of wid because wid has
one of enum WID_T that is data type of u16. And, there is no need to use
u16 type casting when calling wilc_wlan_cfg_get_wid_value function.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: change data type of wid argument in wilc_wlan_cfg_get
Chaehyun Lim [Mon, 28 Mar 2016 04:55:57 +0000 (13:55 +0900)]
staging: wilc1000: change data type of wid argument in wilc_wlan_cfg_get

This patch changes data type of wid argument in wilc_wlan_cfg_get from
u32 to u16. It is better to change data type of wid because wid has one
of enum WID_T that is data type of u16. And, there is no need to use u16
type casting when calling wilc_wlan_cfg_get_wid function.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: change data type of wid argument in wilc_wlan_cfg_set
Chaehyun Lim [Mon, 28 Mar 2016 04:55:56 +0000 (13:55 +0900)]
staging: wilc1000: change data type of wid argument in wilc_wlan_cfg_set

This patch changes data type of wid argument in wilc_wlan_cfg_set from
u32 to u16. It is better to change data type of wid because wid has one of
enum WID_T that is data type of u16. And, there is no need to use u16
type casting when calling wilc_wlan_cfg_set_wid function.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: remove cfs_workitem_t typedefs
James Simmons [Mon, 28 Mar 2016 00:26:29 +0000 (20:26 -0400)]
staging: lustre: libcfs: remove cfs_workitem_t typedefs

Convert cfs_workitem_t to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17202
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: add CFS_FAULT_CHECK()
James Simmons [Mon, 28 Mar 2016 00:26:28 +0000 (20:26 -0400)]
staging: lustre: libcfs: add CFS_FAULT_CHECK()

Add the macro CFS_FAULT_CHECK() which behaves like CFS_FAIL_CHECK()
except that any site may be matched by setting CFS_FAULT (0x02000000)
in cfs_fail_loc. Add cfs_fail_err for use as a return value with
CFS_FAULT_CHECK().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5409
Reviewed-on: http://review.whamcloud.com/11263
Reviewed-by: Robert Read <robert.read@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: replace direct HZ access with kernel APIs
Jian Yu [Mon, 28 Mar 2016 00:26:27 +0000 (20:26 -0400)]
staging: lustre: libcfs: replace direct HZ access with kernel APIs

On some customers' systems, the kernel was compiled with HZ defined
to 100, instead of 1000. This improves performance for HPC applications.
However, to use these systems with Lustre, customers have to re-build
Lustre for the kernel because Lustre directly uses the defined constant
HZ.

Since kernel 2.6.21, some non-HZ dependent timing APIs become non-
inline functions, which can be used in Lustre codes to replace the
direct HZ access.

These kernel APIs include:
  jiffies_to_msecs()
  jiffies_to_usecs()
  jiffies_to_timespec()
  msecs_to_jiffies()
  usecs_to_jiffies()
  timespec_to_jiffies()

 And here are some samples of the replacement:
  HZ            -> msecs_to_jiffies(MSEC_PER_SEC)
  n * HZ        -> msecs_to_jiffies(n * MSEC_PER_SEC)
  HZ / n        -> msecs_to_jiffies(MSEC_PER_SEC / n)
  n / HZ        -> jiffies_to_msecs(n) / MSEC_PER_SEC
  n / HZ * 1000 -> jiffies_to_msecs(n)

This patch replaces the direct HZ access in the libcfs module.

Signed-off-by: Jian Yu <jian.yu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5443
Reviewed-on: http://review.whamcloud.com/11993
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: add lock-class for cfs_percpt_lock
Liang Zhen [Mon, 28 Mar 2016 00:26:26 +0000 (20:26 -0400)]
staging: lustre: libcfs: add lock-class for cfs_percpt_lock

initialise lock-class for each sublock of cfs_percpt_lock
to eliminate false alarm ""possible recursive locking detected"

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6432
Reviewed-on: http://review.whamcloud.com/14368
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: move all cpt handling to libcfs_cpu.h
James Simmons [Mon, 28 Mar 2016 00:26:25 +0000 (20:26 -0400)]
staging: lustre: libcfs: move all cpt handling to libcfs_cpu.h

Move the CPT handling declartions out of libcfs_private.h to
libcfs_cpu.h where it belongs.

Signed-off-by: frank zago <fzago@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/15913
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: remove cfs_percpt_[current|index]
James Simmons [Mon, 28 Mar 2016 00:26:24 +0000 (20:26 -0400)]
staging: lustre: libcfs: remove cfs_percpt_[current|index]

The functions cfs_percpt_current() and cfs_percpt_index()
are not used anywhere. Remove it.

Signed-off-by: frank zago <fzago@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/15913
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: remove atomic cpt allocations
James Simmons [Mon, 28 Mar 2016 00:26:23 +0000 (20:26 -0400)]
staging: lustre: libcfs: remove atomic cpt allocations

libcfs contains functions to perform atomic memory
operations. These functions have never been used
so remove them.

Signed-off-by: frank zago <fzago@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/15913
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: remove cfs_signal_pending wrapper
James Simmons [Mon, 28 Mar 2016 00:26:22 +0000 (20:26 -0400)]
staging: lustre: libcfs: remove cfs_signal_pending wrapper

Use signal_pending() directly instead of a one line function
wrapper.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/13874
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: remove function declarations in libcfs.h
James Simmons [Mon, 28 Mar 2016 00:26:21 +0000 (20:26 -0400)]
staging: lustre: libcfs: remove function declarations in libcfs.h

A few function declarations are in libcfs.h that are not needed.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/13874
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: Copy correct amount in libcfs_ioctl_getdata
Oleg Drokin [Sun, 27 Mar 2016 16:05:03 +0000 (12:05 -0400)]
staging/lustre/libcfs: Copy correct amount in libcfs_ioctl_getdata

Commit b8ff756bc351 ("staging: lustre: libcfs: merge code from
libcfs_ioctl into libcfs_ioctl_getdata") introduced a problem
copying just a single pointer worth of data from userspace
instead of whole libcfs_ioctl_hdr structure.
Adjust the copying amount.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: calculate crypto performance using pages
Andreas Dilger [Sat, 26 Mar 2016 19:40:56 +0000 (15:40 -0400)]
staging: lustre: libcfs: calculate crypto performance using pages

Use alloc_page() and use cfs_crypto_hash_update_page()
to compute the hash instead of cfs_crypto_hash_digest(), since
tgt_checksum_bulk() computes the hash by page anyway.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5279
Reviewed-on: http://review.whamcloud.com/10982
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Alexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: improve reporting error for crypto performance
Andreas Dilger [Sat, 26 Mar 2016 19:40:55 +0000 (15:40 -0400)]
staging: lustre: libcfs: improve reporting error for crypto performance

Set cfs_crypto_hash_speeds[X] result to the actual error instead
of -1. Make the error message more clear and informative.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: print crypto performance result only on success
Andreas Dilger [Sat, 26 Mar 2016 19:40:54 +0000 (15:40 -0400)]
staging: lustre: libcfs: print crypto performance result only on success

Only print info about the crypto performance when no error
is encounter.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: allocate memory in cfs_crypto_performance_test()
Andreas Dilger [Sat, 26 Mar 2016 19:40:53 +0000 (15:40 -0400)]
staging: lustre: libcfs: allocate memory in cfs_crypto_performance_test()

Move memory allocation from cfs_crypto_test_hashes() into the
function cfs_crypto_performance_test().

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: return proper error code for cfs_crypto_hash_speed()
Andreas Dilger [Sat, 26 Mar 2016 19:40:52 +0000 (15:40 -0400)]
staging: lustre: libcfs: return proper error code for cfs_crypto_hash_speed()

Return a real error code, -ENOENT, instead of a -1.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: bug fixes for cfs_crypto_hash_final()
Andreas Dilger [Sat, 26 Mar 2016 19:40:51 +0000 (15:40 -0400)]
staging: lustre: libcfs: bug fixes for cfs_crypto_hash_final()

Change cfs_crypto_hash_final() to always clean up the hash descrptor
instead of not doing this in error cases.  All of the callers were
just calling cfs_crypto_hash_final() immediately to clean up the
descriptor anyway, and the old behaviour is unlike other init/fini
functions, and prone to memory leaks and other incorrect usage.  The
callers can call cfs_crypto_digest_size() to determine the hash size
in advance if needed, and avoid complexity in cfs_crypto_hash_final().

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: start using enum cfs_crypto_hash_alg
Andreas Dilger [Sat, 26 Mar 2016 19:40:50 +0000 (15:40 -0400)]
staging: lustre: libcfs: start using enum cfs_crypto_hash_alg

Fix the cfs_crypto_hash_* functions to take enum cfs_crypto_hash_alg
as the algorithm type, instead of an unsigned char.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: small alignment change for cfs_crypto_hash_*()
Andreas Dilger [Sat, 26 Mar 2016 19:40:49 +0000 (15:40 -0400)]
staging: lustre: libcfs: small alignment change for cfs_crypto_hash_*()

Change the aligment of some of the functions.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: add new definitions for cfs_crypto api
Andreas Dilger [Sat, 26 Mar 2016 19:40:48 +0000 (15:40 -0400)]
staging: lustre: libcfs: add new definitions for cfs_crypto api

Add CFS_HASH_ALG_UNKOWN for unknown hash names instead of
using "0xFF" directly. Define the max digestsize the cfs
crypto api can handle.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: rename some variables for crypto handling
Andreas Dilger [Sat, 26 Mar 2016 19:40:47 +0000 (15:40 -0400)]
staging: lustre: libcfs: rename some variables for crypto handling

For the crypto algorthim type use the same name hash_alg everywhere.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: add documentation for cfs_crypto_hash_*()
Andreas Dilger [Sat, 26 Mar 2016 19:40:46 +0000 (15:40 -0400)]
staging: lustre: libcfs: add documentation for cfs_crypto_hash_*()

Add comment blocks for cfs_crypto_hash_*() in linux-crypto.c and
libcfs_crypto.h. Delete obsolete comment about shash handling in
cfs_crypto_hash_alloc().

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: limit scope of libcfs_crypto.h
Andreas Dilger [Sat, 26 Mar 2016 19:40:45 +0000 (15:40 -0400)]
staging: lustre: libcfs: limit scope of libcfs_crypto.h

Remove <libcfs/libcfs_crypto.h> from <libcfs/libcfs.h> and only
include it into the places where it is actually needed.  This
works out to be the same places as <obd_cksum.h>, so put it there.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5053
Reviewed-on: http://review.whamcloud.com/9990
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: dgnc: fix Logical continuations should be on the
Daeseok Youn [Fri, 25 Mar 2016 02:44:34 +0000 (11:44 +0900)]
staging: dgnc: fix Logical continuations should be on the

fix checkpatch.pl warning about 'Logical continuations
should be on the previous line' in dgnc_neo.c file.

I think the 'force' need to check first, because if the 'force' is true,
it doesn't need to call another function call.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: dgnc: fix 'line over 80 characters'
Daeseok Youn [Fri, 25 Mar 2016 02:44:06 +0000 (11:44 +0900)]
staging: dgnc: fix 'line over 80 characters'

fix checkpatch.pl warning about 'line over 80 characters'
in dgnc_neo.c

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: dgnc: remove unused variable in dgnc_board
Daeseok Youn [Thu, 24 Mar 2016 06:11:08 +0000 (15:11 +0900)]
staging: dgnc: remove unused variable in dgnc_board

TtyRefCnt was not used anywhere in dgnc.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: dgnc: fix CamelCase in dgnc_drvier.h and
Daeseok Youn [Thu, 24 Mar 2016 06:10:43 +0000 (15:10 +0900)]
staging: dgnc: fix CamelCase in dgnc_drvier.h and

fix checkpatch.pl warning about CamelCase

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: xgifb: remove extra braces from if stmt (single branch)
Nicholas Sim [Wed, 23 Mar 2016 23:02:59 +0000 (23:02 +0000)]
staging: xgifb: remove extra braces from if stmt (single branch)

Remove braces from one branch of if statement where both branches only
have a single line of code, as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: xgifb: ensure braces on all arms of if stmt
Nicholas Sim [Wed, 23 Mar 2016 23:02:24 +0000 (23:02 +0000)]
staging: xgifb: ensure braces on all arms of if stmt

Added braces on else arm of if statement where if arm already has braces
as suggested for clarity in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8188eu: remove return at end of void function call
Nicholas Sim [Wed, 23 Mar 2016 22:35:39 +0000 (22:35 +0000)]
staging: rtl8188eu: remove return at end of void function call

Remove unnecessary return statements from last lines of void function call
(several)

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6656: Fixed multiple logical comparisions warnings in main_usb.c
Parth Sane [Wed, 23 Mar 2016 19:38:29 +0000 (01:08 +0530)]
staging: vt6656: Fixed multiple logical comparisions warnings in main_usb.c

Using comparison to false and true is error prone. Fixed multiple warnings as
per checkpatch guidelines.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: wlan-ng: wiphy_free() is not called in case wiphy_register() fails
Claudiu Beznea [Wed, 23 Mar 2016 18:37:26 +0000 (20:37 +0200)]
Staging: wlan-ng: wiphy_free() is not called in case wiphy_register() fails

This patch covers wiphy_register() failures in wlan_create_wiphy()
from cfg80211.c by calling wiphy_free() for the correspondent
struct wiphy allocated structure.

Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: dgnc: fix CamelCase in dgnc_driver.c
Daeseok Youn [Wed, 23 Mar 2016 11:54:36 +0000 (20:54 +0900)]
staging: dgnc: fix CamelCase in dgnc_driver.c

fix checkpatch.pl warning about CamelCase.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: iio: Fix sparse endian warning
Ksenija Stanojevic [Wed, 23 Mar 2016 11:06:34 +0000 (12:06 +0100)]
Staging: iio: Fix sparse endian warning

Fix following sparse warning:
warning: cast to restricted __be16

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: Remove __cplusplus check in header files
PrasannaKumar Muralidharan [Wed, 23 Mar 2016 07:28:28 +0000 (12:58 +0530)]
Staging: most: Remove __cplusplus check in header files

Remove unnecessary __cplusplus check in header files as it is not
required.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: speakup: fix type mismatch warnings
Okash Khawaja [Thu, 10 Mar 2016 20:21:35 +0000 (20:21 +0000)]
staging: speakup: fix type mismatch warnings

Compiling speakup driver with sparse produces following warning:

drivers/staging/speakup/serialio.c:22:9: warning: incorrect type in
initializer (different base types)
drivers/staging/speakup/serialio.c:22:9:    expected unsigned int
[unsigned] flags
drivers/staging/speakup/serialio.c:22:9:    got restricted upf_t

This patch fixes it.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: remove BUG() checks for ni_tio_get_clock_src()
H Hartley Sweeten [Wed, 23 Mar 2016 22:37:04 +0000 (15:37 -0700)]
staging: comedi: ni_tio: remove BUG() checks for ni_tio_get_clock_src()

This function calls some helper functions to convert the counter variant
specific clock select bits into the generic enum ni_gpct_clock_source_bits
equivelent. These helper functions currently BUG() if the clock select
bits are invalid.

It then calls ni_tio_clock_period_ps() to figure out the clock period
based on the generic clock source. This function could also BUG() if
the prescale bits are invalid.

In reality this should never happen but refactor the code to return
-EINVAL instead and remove the BUG() checks.

These functions are also called by ni_tio_set_sync_mode(). When this
function is called by ni_tio_set_clock_src() the counter select bits
have already been validated.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: remove BUG() in ni_tio_set_gate_src()
H Hartley Sweeten [Wed, 23 Mar 2016 22:37:03 +0000 (15:37 -0700)]
staging: comedi: ni_tio: remove BUG() in ni_tio_set_gate_src()

This BUG() can never happen. The previous ni_tio_has_gate2_registers()
check will have already caused the function to return -EINVAL.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: fix ni_tio_insn_config()
H Hartley Sweeten [Wed, 23 Mar 2016 22:37:02 +0000 (15:37 -0700)]
staging: comedi: ni_tio: fix ni_tio_insn_config()

The (*insn_config) functions are supposed to return an errno or the number
of 'data' values used for the instruction (insn->n). Currently this function
returns an errno or 0. Fix the function to work like the core expects.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: remove BUG() checks for ni_tio_get_gate_src()
H Hartley Sweeten [Wed, 23 Mar 2016 22:37:01 +0000 (15:37 -0700)]
staging: comedi: ni_tio: remove BUG() checks for ni_tio_get_gate_src()

This function calls some helper functions to convert the counter variant
specific gate select bits into the generic enum ni_gpct_clock_source_bits
equivelent. These helper functions currently BUG() if the gate select
bits are invalid.

This should never happen but refactor the code to return -EINVAL instead
and remove the BUG() checks.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: validate clock source
H Hartley Sweeten [Wed, 23 Mar 2016 22:37:00 +0000 (15:37 -0700)]
staging: comedi: ni_tio: validate clock source

Refactor the functions that determine the clock source bits so that they
return -EINVAL if the clock source is invalid. Pass the errno back to
ni_tio_insn_config().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tiocmd: remove BUG() which can never occur
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:59 +0000 (15:36 -0700)]
staging: comedi: ni_tiocmd: remove BUG() which can never occur

All the counter_dev->variant options are handled by the switch.
Remove the BUG() which can never occur.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tiocmd: remove unsed param from ni_tio_acknowledge_and_confirm()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:58 +0000 (15:36 -0700)]
staging: comedi: ni_tiocmd: remove unsed param from ni_tio_acknowledge_and_confirm()

The 'stale_data' pointer is always NULL. Just remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tiocmd: fix block comments
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:57 +0000 (15:36 -0700)]
staging: comedi: ni_tiocmd: fix block comments

Fix the checkpatch.pl issues:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tiocmd: Prefer 'unsigned int' to bare use of 'unsigned'
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:56 +0000 (15:36 -0700)]
staging: comedi: ni_tiocmd: Prefer 'unsigned int' to bare use of 'unsigned'

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: tidy up ni_tio_arm()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:55 +0000 (15:36 -0700)]
staging: comedi: ni_tio: tidy up ni_tio_arm()

Make this function a bit more consise by absorbing the GI_HW_ARM_SEL_MASK()
inline helper and combine the two switch (start_trigger) code paths.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: tidy up ni_tio_set_sync_mode()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:54 +0000 (15:36 -0700)]
staging: comedi: ni_tio: tidy up ni_tio_set_sync_mode()

The 'force_alt_sync' paramater is always 0. Remove it.

Absorb the GI_ALT_SYNC() inline helper and use some local variables
to clarify this function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: tidy up ni_tio_get_gate_src()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:53 +0000 (15:36 -0700)]
staging: comedi: ni_tio: tidy up ni_tio_get_gate_src()

Clarify the code a bit by handling the NI_GPCT_DISABLED_GATE_SELECT source
in the common code path.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: fix block comments
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:52 +0000 (15:36 -0700)]
staging: comedi: ni_tio: fix block comments

Fix the checkpatch.pl issues:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: Prefer kernel type 'u64' over 'uint64_t'
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:51 +0000 (15:36 -0700)]
staging: comedi: ni_tio: Prefer kernel type 'u64' over 'uint64_t'

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: Prefer 'unsigned int' to bare use of 'unsigned'
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:50 +0000 (15:36 -0700)]
staging: comedi: ni_tio: Prefer 'unsigned int' to bare use of 'unsigned'

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio.h: remove unnecessary forward declarations
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:49 +0000 (15:36 -0700)]
staging: comedi: ni_tio.h: remove unnecessary forward declarations

These struct forward declarations are not needed. Remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio.h: fix block comment
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:48 +0000 (15:36 -0700)]
staging: comedi: ni_tio.h: fix block comment

Fix the checkpatch.pl issue:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio.h: tidy up struct ni_gpct
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:47 +0000 (15:36 -0700)]
staging: comedi: ni_tio.h: tidy up struct ni_gpct

Fix the checkpatch.pl issues:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
CHECK: Prefer kernel type 'u64' over 'uint64_t'
CHECK: spinlock_t definition without comment

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio.h: tidy up struct ni_gpct_device
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:46 +0000 (15:36 -0700)]
staging: comedi: ni_tio.h: tidy up struct ni_gpct_device

Fix the checkpatch.pl issues:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
CHECK: spinlock_t definition without comment

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: tidy up struct ni_gpct_device (*{write, read}_register)
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:45 +0000 (15:36 -0700)]
staging: comedi: ni_tio: tidy up struct ni_gpct_device (*{write, read}_register)

For aesthetics, rename these callbacks to simply read/write. Change the
'unsigned' parameters to 'unsigned int'.

This fixes a number of checkpatch.pl issues:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio_internal: export {read, write)_register()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:44 +0000 (15:36 -0700)]
staging: comedi: ni_tio_internal: export {read, write)_register()

Move these inline functions out of the header and export them instead.
These functions have pretty generic names, rename them.

Fix the checkpatch.pl issues:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
CHECK: Avoid crashing the kernel - try using WARN_ON & recovery code
       rather than BUG() or BUG_ON()

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio_internal: simplify ni_tio_counting_mode_registers_present()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:43 +0000 (15:36 -0700)]
staging: comedi: ni_tio_internal: simplify ni_tio_counting_mode_registers_present()

Only the e series gpct variant does not have counting mode registers.
Simplfy this function. For aesthetics, return bool instead of int.

This fixes the checkpatch.pl issues:
CHECK: spaces preferred around that '*' (ctx:ExV)
CHECK: Avoid crashing the kernel - try using WARN_ON & recovery code
       rather than BUG() or BUG_ON()

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: export and fix ni_tio_set_bits()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:42 +0000 (15:36 -0700)]
staging: comedi: ni_tio: export and fix ni_tio_set_bits()

Move the inline function from the header and export it instead.

Fix the checkpatch.pl issue:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

The 'unsigned' vars can safely be changed to 'unsigned int'.

This allows moving ni_tio_set_bits_transient() into the driver and
making it static.

Fix the checkpatch.pl issue:
CHECK: Avoid crashing the kernel - try using WARN_ON & recovery code
       rather than BUG() or BUG_ON()

The BUG_ON() is overkill. All the drivers that call this function pass
'register_index' values that are valid. Just check the 'register_index'
before updating the software copy and writing the register.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: export and fix ni_tio_get_soft_copy()
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:41 +0000 (15:36 -0700)]
staging: comedi: ni_tio: export and fix ni_tio_get_soft_copy()

Move the inline function from the header and export it instead.

For the checkpatch.pl issues:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
CHECK: Avoid crashing the kernel - try using WARN_ON & recovery code
       rather than BUG() or BUG_ON()

The 'unsigned' vars can safely be changed to 'unsigned int'.

The BUG_ON() is overkill. All the drivers that call this function pass
'register_index' values that are valid. Just check the 'register_index'
and return 0 if it's not valid.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: fix ni_tio_arm() params/vars
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:40 +0000 (15:36 -0700)]
staging: comedi: ni_tio: fix ni_tio_arm() params/vars

As suggested by checkpatch.pl:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

The 'arm' parameter is really a true/false flag. For aesthetics,
change it to a bool.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: fix ni_tio_set_gate_src() params/vars
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:39 +0000 (15:36 -0700)]
staging: comedi: ni_tio: fix ni_tio_set_gate_src() params/vars

As suggested by checkpatch.pl:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio_internal.h: fix block comment issues
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:38 +0000 (15:36 -0700)]
staging: comedi: ni_tio_internal.h: fix block comment issues

Fix the checkpatch.pl issues:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio_internal.h: tidy up bit defines
H Hartley Sweeten [Wed, 23 Mar 2016 22:36:37 +0000 (15:36 -0700)]
staging: comedi: ni_tio_internal.h: tidy up bit defines

Fix the checkpatch.pl issues:
CHECK: Prefer using the BIT macro

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: plx9052.h: fix block comment issues
H Hartley Sweeten [Tue, 22 Mar 2016 18:51:55 +0000 (11:51 -0700)]
staging: comedi: plx9052.h: fix block comment issues

Fix the checkpatch.pl issues:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: plx9052.h: tidy up bit defines
H Hartley Sweeten [Tue, 22 Mar 2016 18:51:54 +0000 (11:51 -0700)]
staging: comedi: plx9052.h: tidy up bit defines

Fix the checkpatch.pl issues:
CHECK: Prefer using the BIT macro

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: z8536: tidy up bit defines
H Hartley Sweeten [Tue, 22 Mar 2016 18:29:27 +0000 (11:29 -0700)]
staging: comedi: z8536: tidy up bit defines

Fix the checkpatch.pl issues:
CHECK: Prefer using the BIT macro

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_mio_common: ni_gpct_device_destroy() can handle a NULL pointer
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:42 +0000 (11:10 -0700)]
staging: comedi: ni_mio_common: ni_gpct_device_destroy() can handle a NULL pointer

Remove the unnecessary NULL pointer check.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_tio: make ni_gpct_device_destroy() NULL pointer safe
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:40 +0000 (11:10 -0700)]
staging: comedi: ni_tio: make ni_gpct_device_destroy() NULL pointer safe

Modify the pointer check to make this function NULL pointer safe.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_labpc.h: fix block comment issues
H Hartley Sweeten [Tue, 22 Mar 2016 18:21:40 +0000 (11:21 -0700)]
staging: comedi: ni_labpc.h: fix block comment issues

Fix the checkpatch.pl issues:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_labpc_pci: tidy up bit define
H Hartley Sweeten [Tue, 22 Mar 2016 18:21:39 +0000 (11:21 -0700)]
staging: comedi: ni_labpc_pci: tidy up bit define

As suggested by checkpatch.pl:
CHECK: Prefer using the BIT macro

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_labpc_cs: fix block comment issues
H Hartley Sweeten [Tue, 22 Mar 2016 18:21:38 +0000 (11:21 -0700)]
staging: comedi: ni_labpc_cs: fix block comment issues

Fix the checkpatch.pl issues:
WARNING: Block comments use * on subsequent lines
WARNING: line over 80 characters

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_labpc_common: tidy up block comments
H Hartley Sweeten [Tue, 22 Mar 2016 18:21:37 +0000 (11:21 -0700)]
staging: comedi: ni_labpc_common: tidy up block comments

Fix the checkpatch.pl issues:
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_labpc_regs.h: tidy up bit defines
H Hartley Sweeten [Tue, 22 Mar 2016 18:21:36 +0000 (11:21 -0700)]
staging: comedi: ni_labpc_regs.h: tidy up bit defines

As suggested by checkpatch.pl:
CHECK: Prefer using the BIT macro

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_labpc: remove some unnecessary defines
H Hartley Sweeten [Tue, 22 Mar 2016 18:21:35 +0000 (11:21 -0700)]
staging: comedi: ni_labpc: remove some unnecessary defines

The EEPROM_SIZE and NUM_AO_CHAN defines are only used once and they
don't add any significant clarity to the driver. They are also pretty
generic symbol names. Remove them and just open code the values.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt282x: remove unnecessary comment
H Hartley Sweeten [Wed, 23 Mar 2016 19:24:31 +0000 (12:24 -0700)]
staging: comedi: dt282x: remove unnecessary comment

The "Configuration options" are documented in the comedi driver comment
block. Remove the redundant comment before the drivers (*attach) function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt282x: remove redundant comedi_check_trigger_arg_min()
H Hartley Sweeten [Wed, 23 Mar 2016 19:24:30 +0000 (12:24 -0700)]
staging: comedi: dt282x: remove redundant comedi_check_trigger_arg_min()

The 'convert_arg' sets the acquisition timing of the analog input command.
The maximum speed (the minimum timing) depends on the board 'ai_speed' which
if always >= 4000. Remove the redundant 'min' check,

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt282x: refactor dt282x_ns_to_timer()
H Hartley Sweeten [Wed, 23 Mar 2016 19:24:29 +0000 (12:24 -0700)]
staging: comedi: dt282x: refactor dt282x_ns_to_timer()

Define the pacer clock limits and remove the magic numbers. Refactor
the code to use a common path to return the actual 'ns' timing and
the timer divisor value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: update the MODULE_DESCRIPTION
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:53 +0000 (11:10 -0700)]
staging: comedi: ni_660x: update the MODULE_DESCRIPTION

Change the generic MODULE_DESCRIPTION text to something more useful.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: refactor GPCT_OFFSET
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:52 +0000 (11:10 -0700)]
staging: comedi: ni_660x: refactor GPCT_OFFSET

This driver supports boards that have 1 or 2 TIO chips with base
addresses 0x800 apart. Replace the static const array 'GPCT_OFFSET'
with a define and calculate the base address based on the chip index.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: remove spinlock 'dma_cfg_lock'
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:51 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove spinlock 'dma_cfg_lock'

This spinlock is only used to protect changes to the private data 'dma_cfg'.

Before calling any function that would change the 'dma_cfg' the spinlock
'mite_channel_lock' is also locked. That spinlock is not unlocked until
after the 'dma_cfg' change.

Remove the redundant spinlock.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: remove ni_gpct_to_660x_register[]
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:50 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove ni_gpct_to_660x_register[]

enum ni_gpct_register and enum ni_660x_register now have a 1:1
relationship for the NITIO_* registers. The static const array
is no longer necessary to find the proper NI660X_* register for
a given NITIO_*. Remove it and refactor the register read/write
functions.

Use the NITIO_* values to init the ni_660x_reg_data[] array and
remove the unnecessary NI660X_* enum values.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: sort enum ni_660x_register
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:49 +0000 (11:10 -0700)]
staging: comedi: ni_660x: sort enum ni_660x_register

Sort this enum so that it has a 1:1 relationship with the ni_tio.h
enum ni_gpct_register.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: remove inline mite_ring()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:48 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove inline mite_ring()

This fuction just returns a pointer from the private data. The name
might provide some confusion since it appears to be an exported
function from the mite driver.

Just remove it and get the pointer directly where needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: default DIO channels with subdevice init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:47 +0000 (11:10 -0700)]
staging: comedi: ni_660x: default DIO channels with subdevice init

For aesthetics, move the initialization of the default routing for the
DIO channels so it happens when the subdevice is initialized.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: initialize the counter with the subdevice init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:46 +0000 (11:10 -0700)]
staging: comedi: ni_660x: initialize the counter with the subdevice init

Remove the extra for loop and just initialize the counter as the subdevices
are created.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: allocate counters early in (*auto_attach)
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:45 +0000 (11:10 -0700)]
staging: comedi: ni_660x: allocate counters early in (*auto_attach)

The ni_gpct_device_construct() could fail allocating the memory for
device and its counters. For aesthetics, call the function before
initializing the subdevices.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: init TIO chips before subdevice init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:44 +0000 (11:10 -0700)]
staging: comedi: ni_660x: init TIO chips before subdevice init

For aesthetics, initialize the TIO chips before the subdevices are
allocated and initialized.

Refactor the function to initialize all the TIO chips and move it
to a better place in the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: disable interrupts when detaching driver
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:43 +0000 (11:10 -0700)]
staging: comedi: ni_660x: disable interrupts when detaching driver

Make sure the interrupts are disabled before freeing the irq.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: ni_gpct_device_destroy() can handle a NULL pointer
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:41 +0000 (11:10 -0700)]
staging: comedi: ni_660x: ni_gpct_device_destroy() can handle a NULL pointer

Remove the unnecessary NULL pointer check.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: tidy up the counter subdevices init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:39 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up the counter subdevices init

For aesthetics, add some whitespace to the subdevice init and use
a couple local variables to make the code easier to follow.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: tidy up the misc. constants
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:38 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up the misc. constants

Remove enum ni_660x_constants and just #define the value.

Move all the constant #defines so they are in one place and rename
them so they are more conesistent.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: fix memory barrier without comment
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:37 +0000 (11:10 -0700)]
staging: comedi: ni_660x: fix memory barrier without comment

Fix the checkpatch.pl issue. Move the memory barrier to a better place.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: add comments for the spinlock_t definitions
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:36 +0000 (11:10 -0700)]
staging: comedi: ni_660x: add comments for the spinlock_t definitions

Fix the checkpatch.pl issues:

CHECK: spinlock_t definition without comment

For aesthetics, rename the 'soft_reg_copy_lock' to clarify what it's
used for.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_660x: refactor ni_gpct_to_660x_register()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:35 +0000 (11:10 -0700)]
staging: comedi: ni_660x: refactor ni_gpct_to_660x_register()

Convert this big switch into an array and refactor ni_660x_gpct_{write,read}()
functions to use the array to find the register offset.

All the TIO (GPCT) registers are included in the array except for NITIO_G0_ABZ
and NITIO_G1_ABZ. These registers only exist on the ni_pcimio m-series boards
and this driver will never read/write them.

Just in case someone adds a new entry to the enum ni_gpct_register in ni_tio.h,
add a dev_warn() for any unhandled registers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>