firefly-linux-kernel-4.4.55.git
9 years agostaging: unisys: remove redundant variable
Sudip Mukherjee [Tue, 24 Mar 2015 15:17:26 +0000 (20:47 +0530)]
staging: unisys: remove redundant variable

remove the variable "registered", which was used in the cleanup() to
detect if the driver has successfully initialized. the cleanup()
is called from module_exit, so its obvious that the module has
successfully initialized. if the initialization had failed, then
we will never be in the cleanup().

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macros
Joe Perches [Wed, 25 Mar 2015 19:54:26 +0000 (12:54 -0700)]
staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macros

Macros with hidden flow control are bad form as the code path
taken can be unexpected for the reader.

Expand these in-place and remove the macros.

Done with coccinelle script:

@@
expression chip;
expression arg1;
expression arg2;
expression arg3;
@@

- RTSX_WRITE_REG(chip, arg1, arg2, arg3);
+ retval = rtsx_write_register(chip, arg1, arg2, arg3);
+ if (retval) {
+ rtsx_trace(chip);
+ return retval;
+ }

@@
expression chip;
expression arg1;
expression arg2;
@@

- RTSX_READ_REG(chip, arg1, arg2);
+ retval = rtsx_read_register(chip, arg1, arg2);
+ if (retval) {
+ rtsx_trace(chip);
+ return retval;
+ }

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rts5208: Remove TRACE_RET and TRACE_GOTO macros
Joe Perches [Wed, 25 Mar 2015 19:54:25 +0000 (12:54 -0700)]
staging: rts5208: Remove TRACE_RET and TRACE_GOTO macros

Remove these flow hiding macros.

Miscellanea:

o Add a macro and function to replace a large inline
o Simplify #includes
o Add trace.c and update Makefile
o Remove static inline filename function and use kbasename instead

This reduces object size quite a lot: ~350KB (x86-64 allyesconfig)

$ size drivers/staging/rts5208/built-in.o*
   text    data     bss     dec     hex filename
 248385   36728   77888  363001   589f9 drivers/staging/rts5208/built-in.o.new
 506691   83352  115896  705939   ac593 drivers/staging/rts5208/built-in.o.old

Done via coccinelle script and some typing.

@@
expression chip;
expression ret;
@@

- TRACE_RET(chip, ret);
+ rtsx_trace(chip);
+ return ret;

@@
expression chip;
identifier label;
@@

- TRACE_GOTO(chip, label);
+ rtsx_trace(chip);
+ goto label;

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: replace kzalloc and memcpy by kmemdup
Niranjan Dighe [Tue, 24 Mar 2015 19:16:33 +0000 (00:46 +0530)]
Staging: rtl8188eu: replace kzalloc and memcpy by kmemdup

This was generated by 'make coccicheck' using scripts at
scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Niranjan Dighe <niranjan.dighe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Update RT_TRACE macro and uses
Joe Perches [Tue, 24 Mar 2015 23:06:44 +0000 (16:06 -0700)]
staging: rtl8723au: Update RT_TRACE macro and uses

Create an rt_trace function using %pV to reduce overall code size.
Update the macro uses to remove unnecessary and now harmful parentheses.

Miscellanea around these changes:

o Coalesce formats
o Realign arguments
o Remove commented-out RT_TRACE uses
o Spelling fixes in formats
o Add missing newlines to formats
o Remove multiple newlines from formats
o Neaten formats where noticed
o Use %pM in one instance

Reduces code size ~20KB

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192 Clean up function definition
Eddie Kovsky [Thu, 26 Mar 2015 04:16:11 +0000 (22:16 -0600)]
Staging: rtl8192 Clean up function definition

Change function definition to match its prototype declaration. This
fixes the following warning generated by sparse:

drivers/staging/rtl8192u/r8192U_core.c:1970:6: warning: symbol
'rtl8192_update_ratr_table' was not declared. Should it be static?

Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: Fix static decleration sparse warning.
Cihangir Akturk [Tue, 24 Mar 2015 19:53:53 +0000 (21:53 +0200)]
staging: rtl8192u: Fix static decleration sparse warning.

The function 'ieee80211_check_auth_response' is used only in this
file, so make it static. This patch fixes the following sparse
warning.

'ieee80211_check_auth_response' was not declared. Should it be static?

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ozwpan: implement error handling in ozwpan_init()
Alexey Khoroshilov [Fri, 20 Mar 2015 23:15:32 +0000 (02:15 +0300)]
staging: ozwpan: implement error handling in ozwpan_init()

Errors are correctly handled in oz_cdev_register() and oz_protocol_init(),
but then they are ignored in ozwpan_init().

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>
9 years agoStaging: rtl8188eu: remove dead code
Matteo Semenzato [Fri, 20 Mar 2015 19:41:45 +0000 (20:41 +0100)]
Staging: rtl8188eu: remove dead code

The condition pxmitpriv->hwxmit_entry == 5 is always false because
HWXMIT_ENTRY is always 4.

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove uses of MAC_FMT and MAC_ARG
Joe Perches [Tue, 24 Mar 2015 18:10:09 +0000 (11:10 -0700)]
staging: rtl8723au: Remove uses of MAC_FMT and MAC_ARG

Use the standard vsprintf kernel extension to format
mac addresses.

This reduces object code size a bit.

Miscellanea:

o Coalesce formats
o Realign arguments
o Remove the now unused MAC_FMT and MAC_ARG #defines

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Fix typo in fbtft
Masanari Iida [Sat, 21 Mar 2015 02:48:37 +0000 (11:48 +0900)]
staging: fbtft: Fix typo in fbtft

This patch fix spelling typo in comment and printk within fbtft

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: fb_pcd8544: Fix comments style
Cláudio Maia [Fri, 20 Mar 2015 16:31:46 +0000 (16:31 +0000)]
Staging: fbtft: fb_pcd8544: Fix comments style

This patch fixes the following errors by refactoring the comments'
style:

WARNING: line over 80 characters
ERROR: code indent should use tabs where possible

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: fb_pcd8544: Fix warning line over 80 characters
Cláudio Maia [Fri, 20 Mar 2015 16:31:45 +0000 (16:31 +0000)]
Staging: fbtft: fb_pcd8544: Fix warning line over 80 characters

This patch fixes the following checkpatch warning:

WARNING: line over 80 characters

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Add support for ili9163 controller
Kozhevnikov Anatoly [Fri, 20 Mar 2015 15:37:54 +0000 (18:37 +0300)]
staging: fbtft: Add support for ili9163 controller

Driver for ili9163-based displays (for example: Nokia 5110)

Signed-off-by: Kozhevnikov Anatoly <shilo.xyz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: Remove spinlock helper function
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:15 +0000 (15:22 +0000)]
staging: sm750fb: Remove spinlock helper function

This patch removes the unnecessary spinlock helper function and instead
calls spin_lock and spin_unlock directly.

This does *not* resolve sparse warnings about context imbalances but these are
spurious.

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: Fix __iomem pointer types
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:14 +0000 (15:22 +0000)]
staging: sm750fb: Fix __iomem pointer types

This patch annotates pointers as referring to I/O mapped memory where they ought
to be, removes now unnecessary ugly casts, eliminates an incorrect deref on I/O
mapped memory by using iowrite16 instead, and updates the pointer arithmetic
accordingly to take into account that the pointers are now byte-sized. This
fixes the following sparse warnings:-

drivers/staging/sm750fb/sm750_cursor.c:113:19: warning: cast removes address space of expression
drivers/staging/sm750fb/sm750_cursor.c:204:19: warning: cast removes address space of expression

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: Remove unused function
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:13 +0000 (15:22 +0000)]
staging: sm750fb: Remove unused function

This patch removes the unused hw712_fillrect function. This patch fixes
the following sparse warning:-

drivers/staging/sm750fb/sm750_accel.c:95:5: warning: symbol 'hw712_fillrect' was not declared. Should it be static?

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: Make internal functions static
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:12 +0000 (15:22 +0000)]
staging: sm750fb: Make internal functions static

This patch declares externally unavailable functions static. This fixes
the following sparse warnings:-

drivers/staging/sm750fb/ddk750_hwi2c.c:63:6: warning: symbol 'hwI2CWaitTXDone' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_hwi2c.c:93:14: warning: symbol 'hwI2CWriteData' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_hwi2c.c:160:14: warning: symbol 'hwI2CReadData' was not declared. Should it be static?

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: Use memset_io instead of memset
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:11 +0000 (15:22 +0000)]
staging: sm750fb: Use memset_io instead of memset

This patch takes into account that cursor->vstart, crtc->vScreen and
share->pvMem are pointers to memory-mapped I/O and thus we should use memset_io
to make this explicit. In addition, some architectures require special treatment
of memory-mapped I/O so the previous code could actually break without this
change.

This fixes the following sparse warnings:-

drivers/staging/sm750fb/sm750.c:489:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:490:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:501:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:502:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:833:5: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:1154:9: warning: incorrect type in argument 1 (different address spaces)

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm7xxfb: add MODULE_DEVICE_TABLE
Sudip Mukherjee [Tue, 24 Mar 2015 10:52:24 +0000 (16:22 +0530)]
staging: sm7xxfb: add MODULE_DEVICE_TABLE

add MODULE_DEVICE_TABLE to support hot-plugging.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/xattr: xattr data may be gone with lock held
Lai Siyao [Thu, 26 Mar 2015 01:53:26 +0000 (21:53 -0400)]
staging/lustre/xattr: xattr data may be gone with lock held

Xattr cached data may be gone, but lock still held, in this case,
refetch xattr from server, otherwise client will return error.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-on: http://review.whamcloud.com/12952
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3544
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: update timestamps after buiding rpc
Niu Yawei [Thu, 26 Mar 2015 01:53:25 +0000 (21:53 -0400)]
staging/lustre: update timestamps after buiding rpc

The mtime/atime/ctime in the write RPC has to be updated after
the RPC is built (where xid is generated), otherwise, it could
race with the setattr and updating wrong timestamps on OST side.

Seems this regression was introduced when landing clio code.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-on: http://review.whamcloud.com/13261
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5951
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: glimpse the inode before doing fiemap
Li Dongyang [Thu, 26 Mar 2015 01:53:24 +0000 (21:53 -0400)]
staging/lustre/llite: glimpse the inode before doing fiemap

For a new inode, the i_size is 0 until a stat, which will yield
an empty fiemap result.
Fix the issue by glimpsing the size before doing fiemap.

Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/13439
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6091
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/ptlrpc: fix import state during replay
Andriy Skulysh [Thu, 26 Mar 2015 02:07:07 +0000 (22:07 -0400)]
staging/lustre/ptlrpc: fix import state during replay

Client doesn't restore import state correctly
on reconnect during replay. It resends lock replay
when final ping was queued by server.
Server fails with "target_queue_recovery_request())
ASSERTION( req->rq_export->exp_lock_replay_needed ) failed"

Add imp_replay_state to store last replay state.
imp_state is restored from imp_replay_state
during reconnect.

Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Xyratex-bug-id: MRP-2022
Reviewed-on: http://review.whamcloud.com/12163
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5651
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/lov: don't crash accessing LOV object with FID{0, 0}
Yang Sheng [Thu, 26 Mar 2015 01:53:22 +0000 (21:53 -0400)]
staging/lustre/lov: don't crash accessing LOV object with FID{0, 0}

Some object maybe has a corrupted LOV EA or a hole in
LOV EA. We should not crash client in such case.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-on: http://review.whamcloud.com/12740
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4958
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/mgc: detach MGC dev on error
Bobi Jam [Thu, 26 Mar 2015 01:53:21 +0000 (21:53 -0400)]
staging/lustre/mgc: detach MGC dev on error

lustre_start_mgc() creates MGC device, if error happens later on
ll_fill_super(), this device is still attached, and later mount
fails by keep complaining that the MGC device's already in the
client node.

It turns out that the device was referenced by mgc config llog data
which is arranged in the mgc lock requeue thread re-trying to get its
mgc lock, and in normal case, this llog reference only released in
mgc_blocking_ast() when the system is umount.

This patch make mgc_precleanup() to wake up requeue thread to handle
the config llog data.

This patch also makes mgc_setup() wait for mgc_requeue_thread() start
before moving on.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Reviewed-on: http://review.whamcloud.com/11765
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4943
Reviewed-by: Ryan Haasken <haasken@cray.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/mgc: check the import stat for lprocfs
Hongchao Zhang [Thu, 26 Mar 2015 01:53:20 +0000 (21:53 -0400)]
staging/lustre/mgc: check the import stat for lprocfs

in lprocfs_mgc_rd_ir_state, the import state should be checked
the validity before doing further work.

Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/12896
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5650
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/ptlrpc: false alarm in AT network latency measuring
Liang Zhen [Thu, 26 Mar 2015 01:53:19 +0000 (21:53 -0400)]
staging/lustre/ptlrpc: false alarm in AT network latency measuring

If early reply of client RPC is lost and client RPC is expired and
resent, server will drop the resent RPC because it's already in
processing, server may also send reply or early reply to client,
which can still match reply buffer of the original request.
In this case, client is measuring time from resent time, but server
is reporting service time of original RPC, which is longer than
the time measured by client.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-on: http://review.whamcloud.com/12855
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5545
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/mdc: Handle empty but non-zero acl xattr
Christopher J. Morrone [Thu, 26 Mar 2015 01:53:18 +0000 (21:53 -0400)]
staging/lustre/mdc: Handle empty but non-zero acl xattr

We have found that posix_acl_access can have a value
of \002\000\000\000.  In that case body->aclsize is
non-zero, but the there are no actuall acls stored
in the xattr.

In mdc_unpack_acl(), it only checks IS_ERR() on the
pointer returned by posix_acl_from_xattr(), it does not
check for NULL.  Because of the above situation, the
xattr aclsize can be non-zero, but posic_acl_from_xattr()
still returns NULL.  Passing NULL to posix_acl_valid()
crashes the kernel.

We add a check to properly handle the NULL return value.

Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/11989
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5150
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/osc: shorten IO calling path
Bobi Jam [Thu, 26 Mar 2015 02:04:53 +0000 (22:04 -0400)]
staging/lustre/osc: shorten IO calling path

By using osc_io_unplug_aync() for osc_queue_sync_pages() to shorten
the IO calling path, to reduce the chance of stack overflow.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-on: http://review.whamcloud.com/11612
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3188
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoft1000-pcmcia: ft1000_hw.c: code refactoring: add ft1000_read_dsp_timer()
Daniele Alessandrelli [Mon, 16 Mar 2015 22:53:38 +0000 (23:53 +0100)]
ft1000-pcmcia: ft1000_hw.c: code refactoring: add ft1000_read_dsp_timer()

Add new function ft1000_read_dsp_timer() replacing recurring code block for
reading DSP timer. Such code refactoring solves all remaining "line over 80
characters" warnings reported by checkpatch.pl.

Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoft1000-pcmcia: ft1000_hw.c: fix style issues not requiring code refactoring
Daniele Alessandrelli [Mon, 16 Mar 2015 22:53:37 +0000 (23:53 +0100)]
ft1000-pcmcia: ft1000_hw.c: fix style issues not requiring code refactoring

Fix all the trivial style issues (as reported by checkpatch.pl) not requiring
code refactoring. A following patch is expected to fix the remaining issues by
performing some code refactoring.

Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: panel: fix lcd type
Sudip Mukherjee [Tue, 24 Mar 2015 10:59:32 +0000 (16:29 +0530)]
staging: panel: fix lcd type

the lcd type as defined in the Kconfig is not matching in the code.
as a result the rs, rw and en pins were getting interchanged.
Kconfig defines the value of PANEL_LCD to be 1 if we select custom
configuration but in the code LCD_TYPE_CUSTOM is defined as 5.

my hardware is LCD_TYPE_CUSTOM, but the pins were assigned to it
as pins of LCD_TYPE_OLD, and it was not working.
Now values are corrected with referenece to the values defined in
Kconfig and it is working.
checked on JHD204A lcd with LCD_TYPE_CUSTOM configuration.

Cc: <stable@vger.kernel.org> # 2.6.32+
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: android: sync: Fix memory corruption in sync_timeline_signal().
Alistair Strachan [Tue, 24 Mar 2015 21:51:31 +0000 (14:51 -0700)]
staging: android: sync: Fix memory corruption in sync_timeline_signal().

The android_fence_release() function checks for active sync points
by calling list_empty() on the list head embedded on the sync
point. However, it is only valid to use list_empty() on nodes that
have been initialized with INIT_LIST_HEAD() or list_del_init().

Because the list entry has likely been removed from the active list
by sync_timeline_signal(), there is a good chance that this
WARN_ON_ONCE() will be hit due to dangling pointers pointing at
freed memory (even though the sync drivers did nothing wrong)
and memory corruption will ensue as the list entry is removed for
a second time, corrupting the active list.

This problem can be reproduced quite easily with CONFIG_DEBUG_LIST=y
and fences with more than one sync point.

Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Colin Cross <ccross@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: octeon: Remove extern from .c file
Helen Fornazier [Thu, 26 Mar 2015 00:11:44 +0000 (21:11 -0300)]
Staging: octeon: Remove extern from .c file

This patch fixes the checkpatch.pl warning:

WARNING: externs should be avoided in .c files
+extern void octeon_mdiobus_force_mod_depencency(void);

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: i2o: Remove indentation of labels
Helen Fornazier [Thu, 26 Mar 2015 00:02:42 +0000 (21:02 -0300)]
Staging: i2o: Remove indentation of labels

This patch fixes the checkpatche.pl warnings:

WARNING: labels should not be indented
+      context_remove:

WARNING: labels should not be indented
+      nop_msg:

WARNING: labels should not be indented
+      exit:

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Remove do {} while(0) in single statement macro
Helen Fornazier [Wed, 25 Mar 2015 23:56:43 +0000 (20:56 -0300)]
staging: fbtft: Remove do {} while(0) in single statement macro

This patch fixes the checkpatch.pl warning:

WARNING: Single statement macros should not use a do {} while (0) loop
+#define write_reg(par, ...)                                              \
+do {                                                                     \
+       par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__); \
+} while (0)

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Add space around '='
Helen Fornazier [Wed, 25 Mar 2015 23:54:33 +0000 (20:54 -0300)]
staging: fbtft: Add space around '='

This patch fixes the checkpatch.pl error:

ERROR: spaces required around that '=' (ctx:VxV)
+                       sdev->bits_per_word=9;
                                           ^

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: use the BIT macro in adc
Haneen Mohammed [Wed, 25 Mar 2015 23:23:29 +0000 (02:23 +0300)]
Staging: iio: use the BIT macro in adc

This patch replaces bit shifting on:
0,1,2, and 3 with the BIT(x) macro.
Issue addressed by checkpatcg.pl.
This was done with the help of Coccinelle:

@r1@
identifier x;
constant int g;
@@

(
0<<\(x\|g\)
|
1<<\(x\|g\)
|
2<<\(x\|g\)
|
3<<\(x\|g\)
)

@script:python b@
g2 <<r1.g;
y;
@@
coccinelle.y = int(g2) + 1

@c@
constant int r1.g;
identifier b.y;
@@
(
-(1 << g)
+BIT(g)
|
-(0 << g)
+ 0
|
-(2 << g)
+BIT(y)
|
-(3 << g)
+(BIT(y)| BIT(g))
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Add braces on all arms of if statement
Haneen Mohammed [Wed, 25 Mar 2015 07:55:06 +0000 (10:55 +0300)]
Staging: iio: Add braces on all arms of if statement

The following patch adds braces on all arms of if statement.
Issue addressed by checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: add blank line after function declaration
Haneen Mohammed [Wed, 25 Mar 2015 07:54:32 +0000 (10:54 +0300)]
Staging: iio: add blank line after function declaration

This patch adds blank line after function declaration.
Issue addressed by checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: remove multible blank lines
Haneen Mohammed [Wed, 25 Mar 2015 07:52:51 +0000 (10:52 +0300)]
Staging: iio: remove multible blank lines

This patch removes extra blank lines to address checkpatch.pl warnings
regarding that.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Adjust alignment for function parameters
Haneen Mohammed [Wed, 25 Mar 2015 07:51:55 +0000 (10:51 +0300)]
Staging: iio: Adjust alignment for function parameters

This patch adjust parameters alignment in functions to match
open parenthesis. Issue addressed by checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Fix space issues before '(' and after ')'
Haneen Mohammed [Wed, 25 Mar 2015 05:09:59 +0000 (08:09 +0300)]
Staging: rtl8192u: Fix space issues before '(' and after ')'

Space is required before the open and after the close parenthesis.
This patch adds space after 'if' and before '{'.

This was done with the help of the following Coccinelle script:

@r@
expression E;
position p1,p2,p3;
@@

if@p1 (E) @p3{@p2
        ...
}

@script:python@
p1 << r.p1;
p2 << r.p2;
p3 << r.p3;
@@

l1 = int (p1[0].line)
l2 = int (p2[0].line)
l3 = int (p3[0].line)
c1 = int (p1[0].column_end)
c2 = int (p2[0].column)
c3 = int (p3[0].column)
if (l1 != l2):
  cocci.include_match(False)
if (l2 == l3 and c3 + 2 == c2):
  cocci.include_match(False)

@@
position r.p1,r.p2,r.p3;
expression r.E;
@@

-if@p1 (E) @p3{@p2
+if (E) {
...
}

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Add space before open parenthesis
Haneen Mohammed [Wed, 25 Mar 2015 05:07:06 +0000 (08:07 +0300)]
Staging: rtl8192u: Add space before open parenthesis

Space is required before the open parenthesis.
This patch adds space after if to address that issue.
This was done with the help of the following Coccinelle script:

@r@
position p1,p2;
@@
if@p1 (@p2 ...) {
        ...
}
@script:python@
p1 << r.p1;
p2 << r.p2;
@@

l1 = int (p1[0].line)
l2 = int (p2[0].line)
c1 = int (p1[0].column)
c2 = int (p2[0].column)
if (l2 == l1 and c1 + 2 != c2):
  cocci.include_match(False)

@@
position r.p1,r.p2;
@@
- if@p1 (
+ if (
...) {
        ...
}

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Remove extern from function declaration
Vatika Harlalka [Wed, 25 Mar 2015 16:04:48 +0000 (21:34 +0530)]
Staging: lustre: Remove extern from function declaration

Functions have the extern storage class specifier by default,
so this keyword can be removed.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Add new variable to make code compact
Vatika Harlalka [Wed, 25 Mar 2015 13:13:11 +0000 (18:43 +0530)]
Staging: rtl8188eu: Add new variable to make code compact

Introducing this variable leads to overall more code
compactness and increases readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Refactor repititive code to loop to increase compactness
Vatika Harlalka [Wed, 25 Mar 2015 13:05:47 +0000 (18:35 +0530)]
Staging: rtl8188eu: Refactor repititive code to loop to increase compactness

Refactor repetitive code to loop so as to increase
compactness and introduce newlines for readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Reduce line size to increase readability
Vatika Harlalka [Wed, 25 Mar 2015 13:05:46 +0000 (18:35 +0530)]
Staging: rtl8188eu: Reduce line size to increase readability

Reduce line size to increase readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Do not use binary constants
Geert Uytterhoeven [Fri, 20 Mar 2015 15:21:58 +0000 (16:21 +0100)]
staging: fbtft: Do not use binary constants

Gcc < 4.3 doesn't understand binary constants (0b*):

drivers/staging/fbtft/fbtft-sysfs.c:156:19: error: invalid suffix "b111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:3: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:11: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:19: error: invalid suffix "b11111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:28: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:36: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:44: error: invalid suffix "b1111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:159:52: error: invalid suffix "b11111" on integer constant
drivers/staging/fbtft/fb_hx8340bn.c:160:3: error: invalid suffix "b111" on integer constant
...

Hence use hexadecimal constants (0x*) instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoMerge tag 'iio-for-4.1a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio...
Greg Kroah-Hartman [Tue, 24 Mar 2015 21:53:52 +0000 (22:53 +0100)]
Merge tag 'iio-for-4.1a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle.

New drivers
* CM3323 color sensor.
* MS5611 pressure and temperature sensor.

New functionality
* mup6050 - create mux clients for devices described via ACPI. The reasoning
     and approach taken in this patch are complex.  Basically there is no
     otherway of finding out what is there than by some esoteric look ups in
     the ACPI data.
* cm3232 - PM support
* itg3200 - suspend/resume support
* mcp320x - add more ADCs to the kconfig to reflect what the driver supports
     (this patch and the bindings got left behind when the support was added
      a while back).

Docs / utils
* ti-adc128s052 - DT bindings.
* mcp3422 - DT bindings.
* mcp320x - DT bindings
* ABI docs for event threshold scale attributes, in_magn_offset, proximity
  scan_element and thresh falling/rising values for accelerometers.  All
  elements long in use that have slipped by being explicitly documented.
* Tidy up the tools previously in drivers/staging/iio/Documentation and move
  them out to /tools/iio. Yet another move that should have happened long ago.
  This time Roberta Dobrescu did the leg work.  Thanks!

Core Cleanups
* Export userspace IIO headers.  We should have done the appropriate header
  splitting a long time ago. Thanks to Daniel for sorting this out.

* Refactor the registring of attributes for buffers to move all non-custom
  ones to a vector allowing easier additions to the current set in the future.

Driver Cleanups
* gpiod related cleanups.  Make use of the additional parameter to specify
   initial direciton to avoid extra code.
* bmc150 - Various refactorings to reduce code repitition and prepare for
           hardware buffer support.  Some of these cleanups are good even
   without the new functionality.
* kmx61 - direct use of index to an array avoiding a structure element which
          was always the index to an element in an array of that structure.
* vf610 - avoid incorrect type for return from wait_for_completion_timeout.
* gp2ap020a00f - use put_unaligned_le32 for slight code simplification.
ade7754 - improve error handling including suppressing some build warnings.
ade7759 - improve error handling including suppressing some build warnings.
* hmc5843 - Long line and indentation fixes. Also some constifying of various
      constant data.
ade7854 - 80+ character line splitting.
* ad2s1210 - fix wrong printf format string.
* mxs-lradc - fix wrong printf format string.
ade7954-i2c - code alignment fixes and other trivial but worthwhile bits.
* periodic rtc trigger - make the frequency type an unsigned int as it
  is always treated as such.
* jsa1212 - constify struct regmap_config as it is constant.
* ad7793 - typo in the MODULE_DESCRIPTION
* mma9551 - check gpiod_to_irq errors.  Note that this doesn't actually cause
    any trouble but is worth tidying up as obviously incorrect.
* mlx90614 - refactor the register symbols to make it clear which reads are to
    RAM not PROM.

9 years agodgnc: Clean up dgnc_sysfs.h
Giedrius Statkevičius [Fri, 13 Mar 2015 13:56:35 +0000 (15:56 +0200)]
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>
9 years agodgnc: remove unused stuff from dgnc_cls.h
Giedrius Statkevičius [Fri, 13 Mar 2015 13:56:34 +0000 (15:56 +0200)]
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>
9 years agodgnc: remove old 2.4-2.6 compat kernel defines
Giedrius Statkevičius [Fri, 13 Mar 2015 13:56:33 +0000 (15:56 +0200)]
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>
9 years agodgnc: use linux/types.h instead of dgnc_types.h
Giedrius Statkevičius [Fri, 13 Mar 2015 13:56:32 +0000 (15:56 +0200)]
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>
9 years agodgnc: get rid of dpacompat.h, move remaining stuff to digi.h
Giedrius Statkevičius [Fri, 13 Mar 2015 13:56:31 +0000 (15:56 +0200)]
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>
9 years agodgnc: clean up digi.h
Giedrius Statkevičius [Fri, 13 Mar 2015 13:56:30 +0000 (15:56 +0200)]
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>
9 years agodgnc: remove unused dgnc_ioctl_name() command
Giedrius Statkevičius [Fri, 13 Mar 2015 13:56:29 +0000 (15:56 +0200)]
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>
9 years agostaging: dgnc: some off by one bugs
Dan Carpenter [Thu, 12 Mar 2015 17:24:31 +0000 (20:24 +0300)]
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>
9 years agostating: octeon-usb: cvmx_usb_initialize(): eliminate extra indentation
Aaro Koskinen [Sun, 22 Mar 2015 15:38:02 +0000 (17:38 +0200)]
stating: octeon-usb: cvmx_usb_initialize(): eliminate extra indentation

Eliminate extra indentation by putting all the code into the same block.
Also delete a bogus comment.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: try to recover from failed hardware reset
Aaro Koskinen [Sun, 22 Mar 2015 15:38:01 +0000 (17:38 +0200)]
staging: octeon-usb: try to recover from failed hardware reset

On some hardware the USB fails to initialize to sane state after
cold boot. We can detect this based on some unexpected interrupt bits,
and recover by re-initializing.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: fail and warn if DMA counters are wrong
Aaro Koskinen [Sun, 22 Mar 2015 15:38:00 +0000 (17:38 +0200)]
staging: octeon-usb: fail and warn if DMA counters are wrong

Fail and WARN if DMA counters are wrong.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: move cvmx_usb_shutdown()
Aaro Koskinen [Sun, 22 Mar 2015 15:37:59 +0000 (17:37 +0200)]
staging: octeon-usb: move cvmx_usb_shutdown()

Move cvmx_usb_shutdown() to allow its use from some other functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: rewrite port reset
Aaro Koskinen [Sun, 22 Mar 2015 15:37:58 +0000 (17:37 +0200)]
staging: octeon-usb: rewrite port reset

Don't disable port before resetting. Also perform reset unconditionally
when requested.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: move fifo setup to controller reset from port reset
Aaro Koskinen [Sun, 22 Mar 2015 15:37:57 +0000 (17:37 +0200)]
staging: octeon-usb: move fifo setup to controller reset from port reset

Move FIFO setup to controller reset from port reset.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: move fifo setup into a separate routine
Aaro Koskinen [Sun, 22 Mar 2015 15:37:56 +0000 (17:37 +0200)]
staging: octeon-usb: move fifo setup into a separate routine

Move FIFO setup into a separate routine.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: use USB stack to turn on power
Aaro Koskinen [Sun, 22 Mar 2015 15:37:55 +0000 (17:37 +0200)]
staging: octeon-usb: use USB stack to turn on power

Use USB stack to turn on the power bit. It will also do
the necessary delays.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: don't poll interrupts early
Aaro Koskinen [Sun, 22 Mar 2015 15:37:54 +0000 (17:37 +0200)]
staging: octeon-usb: don't poll interrupts early

Don't poll interrupts before we have registered the HCD.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: refactor usbn block init
Aaro Koskinen [Sun, 22 Mar 2015 15:37:53 +0000 (17:37 +0200)]
staging: octeon-usb: refactor usbn block init

Move one-time state data structure initialization out of
cvmx_usb_initialize().

This enables to re-initialize USBN HW block without messing
up data structures.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: never retry after xacterr
Aaro Koskinen [Sun, 22 Mar 2015 15:37:52 +0000 (17:37 +0200)]
staging: octeon-usb: never retry after xacterr

Never retry after xacterr. The DMA engine cannot handle that properly
and may result in wrong transfer count and hang.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: program DMA engine based on transfer direction
Aaro Koskinen [Sun, 22 Mar 2015 15:37:51 +0000 (17:37 +0200)]
staging: octeon-usb: program DMA engine based on transfer direction

Program DMA engine based on transfer direction. We are only transferring
to one direction at a time.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: use __BITFIELD_FIELD
Aaro Koskinen [Sun, 22 Mar 2015 15:37:50 +0000 (17:37 +0200)]
staging: octeon-usb: use __BITFIELD_FIELD

Use __BITFIELD_FIELD to define bitfields. OCTEON can at least in theory
run also in little-endian mode, so the bitfield definitions should not
assume big-endian byte order.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: delete redundant field from octeon_temp_buffer
Aaro Koskinen [Sun, 22 Mar 2015 15:37:49 +0000 (17:37 +0200)]
staging: octeon-usb: delete redundant field from octeon_temp_buffer

Since we are not moving/realigning the original pointer returned
by kmalloc, we don't need to store the value in a separate field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: remove useless prefix from pipe flags
Aaro Koskinen [Sun, 22 Mar 2015 15:37:48 +0000 (17:37 +0200)]
staging: octeon-usb: remove useless prefix from pipe flags

Remove useless prefix from pipe flags and adjust comments.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: remove useless prefix from internal routines
Aaro Koskinen [Sun, 22 Mar 2015 15:37:47 +0000 (17:37 +0200)]
staging: octeon-usb: remove useless prefix from internal routines

Original CVMX code used "__" to distinguis internal USB functions
from public ones. But in Linux all cvmx_usb routines are internal
to this driver, so such separation is useless.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: eliminate 64-bit register access wrappers
Aaro Koskinen [Sun, 22 Mar 2015 15:37:46 +0000 (17:37 +0200)]
staging: octeon-usb: eliminate 64-bit register access wrappers

Eliminate 64-bit register access wrappers. Since we don't implement
register-level debugging outputs, these are useless.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-usb: remove internal function parameter sanity checks
Aaro Koskinen [Sun, 22 Mar 2015 15:37:45 +0000 (17:37 +0200)]
staging: octeon-usb: remove internal function parameter sanity checks

Remove some function parameter sanity checks from internal functions
where we can rely them being called with sane parameters.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Remove function prototype from .c file
Cristina Opriceana [Sun, 22 Mar 2015 18:49:51 +0000 (20:49 +0200)]
Staging: rtl8192u: Remove function prototype from .c file

Remove function prototype from r8192U_core.c since it is
declared in the r8192U.h header and this is included in r8192U_core.c

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Make function prototypes static
Cristina Opriceana [Sun, 22 Mar 2015 18:49:28 +0000 (20:49 +0200)]
Staging: rtl8192u: Make function prototypes static

Make functions static since they are used locally and no other files
refer them.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: media: remove useless dev_info to avoid null ptr dereference
Haneen Mohammed [Sun, 22 Mar 2015 00:02:02 +0000 (03:02 +0300)]
Staging: media: remove useless dev_info to avoid null ptr dereference

Context is used in dev_info after it has been freed.
This patch fix that issue by removing the dev_info itself,
for msg doesn't look much necessary.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8723au: Remove unused function rtw_atimdone_event_callback23a
Somya Anand [Sun, 22 Mar 2015 09:19:29 +0000 (14:49 +0530)]
Staging: rtl8723au: Remove unused function rtw_atimdone_event_callback23a

This patch fixes the following sparse warning:

warning: symbol 'rtw_atimdone_event_callback23a' was not declared.
Should it be static?
rtw_atimdone_event_callback23a is local to the file rtw_mlme.c but
it isn't exposed in a header file anywhere. Moreover it is never called
from anywhere as well.

So, this patch removes this function completely.

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wlan-ng: Remove typedef prism2sta_accesslist_t
Vatika Harlalka [Sat, 21 Mar 2015 06:57:34 +0000 (12:27 +0530)]
Staging: wlan-ng: Remove typedef prism2sta_accesslist_t

Remove typedef prism2sta_accesslist_t and replace its uses
in the code.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Do not byteswap timeout twice
Jes Sorensen [Sun, 22 Mar 2015 23:09:44 +0000 (19:09 -0400)]
staging: rtl8723au: Do not byteswap timeout twice

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: update_txdesc(): bagg_pkt is always false
Jes Sorensen [Sun, 22 Mar 2015 23:09:43 +0000 (19:09 -0400)]
staging: rtl8723au: update_txdesc(): bagg_pkt is always false

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Fix trailing whitespace
Jes Sorensen [Sun, 22 Mar 2015 23:09:42 +0000 (19:09 -0400)]
staging: rtl8723au: Fix trailing whitespace

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Fix mis-placed break
Jes Sorensen [Mon, 23 Mar 2015 20:54:08 +0000 (16:54 -0400)]
staging: rtl8723au: Fix mis-placed break

In 7c3a8f2a5ec95e2b13704562f36321e20ddfc190 I made a mistake and moved
a break below a bracket, causing a situation where the for loop would
always exit when it shouldn't.

This patch corrects that mistake.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wlan-ng: Remove typedef prism2sta_authlist_t
Vatika Harlalka [Sat, 21 Mar 2015 06:57:24 +0000 (12:27 +0530)]
Staging: wlan-ng: Remove typedef prism2sta_authlist_t

Remove typdef prism2sta_authlist_t and replace its uses
in the code.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Delete space
Hatice ERTÜRK [Fri, 20 Mar 2015 19:25:20 +0000 (21:25 +0200)]
Staging: rtl8188eu: Delete space

Deleted spaces before ','.Because it is prohibited by the kernel coding style.
Error found with checkpatch.pl

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Fix indentation style by space
Helen Fornazier [Sat, 21 Mar 2015 02:18:10 +0000 (23:18 -0300)]
staging: fbtft: Fix indentation style by space

This patch fixes the checkpatch.pl warning and error:

WARNING: please, no spaces at the start of a line

ERROR: code indent should use tabs where possible

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: remove trailing white space
Helen Fornazier [Sat, 21 Mar 2015 16:50:05 +0000 (13:50 -0300)]
staging: fbtft: remove trailing white space

Clean useless trailing white spaces

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: use the BIT macro in .h files
Haneen Mohammed [Sun, 22 Mar 2015 18:23:23 +0000 (21:23 +0300)]
Staging: iio: use the BIT macro in .h files

This patch replace bit shifting on 1, 2, and 3 with the BIT(x) macro.
Issue addressed by checkpatch.pl with --strict flag.

This was done with the help of Coccninelle:

@r1@
constant int g;
@@
(
0<<g
|
1<<g
|
2<<g
|
3<<g
)

@script:python b@
g2 <<r1.g;
y;
@@
coccinelle.y = int(g2) + 1

@c@
constant int r1.g;
identifier b.y;
@@
(
-(1 << g)
+BIT(g)
|
-(0 << g)
+ 0
|
-(2 << g)
+BIT(y)
|
-(3 << g)
+(BIT(y)| BIT(g))
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Fix file header to match standards
Cristina Opriceana [Sun, 22 Mar 2015 18:43:16 +0000 (20:43 +0200)]
Staging: iio: Fix file header to match standards

Fix file header to match Linux Kernel style. Remove Free Software
Foundation reference to silence the checkpatch.pl warning.
Add driver description and correct spelling mistakes.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Place driver in sleep mode on error
Cristina Opriceana [Sun, 22 Mar 2015 18:42:42 +0000 (20:42 +0200)]
Staging: iio: Place driver in sleep mode on error

Put device in sleep mode if an error is encountered after
initialization in order to avoid wasting power.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Add kernel-doc for struct hmc5843
Cristina Opriceana [Fri, 20 Mar 2015 16:09:43 +0000 (18:09 +0200)]
Staging: iio: Add kernel-doc for struct hmc5843

This patch documents the struct hmc5843 specific data following
this warning:
"CHECK: struct mutex definition without comment".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Fix Sparse warnings for static declarations
Haneen Mohammed [Sat, 21 Mar 2015 07:51:42 +0000 (10:51 +0300)]
Staging: lustre: Fix Sparse warnings for static declarations

The following patch fixes Sparse warnings in genops.c regrding:
"Symbol * was not declared. Should it be static?"

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStagin: lustre: Fix externs should be avoided in .c
Haneen Mohammed [Sat, 21 Mar 2015 07:48:30 +0000 (10:48 +0300)]
Stagin: lustre: Fix externs should be avoided in .c

This patch moves extern declaration from genops.c to obd_class.h,
addressing checkpatch.pl warning: externs should be avoided in .c

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Fix externs should be avoided in .c
Haneen Mohammed [Sat, 21 Mar 2015 07:47:56 +0000 (10:47 +0300)]
Staging: lustre: Fix externs should be avoided in .c

Thi patch moves extern declaration to "obd_class.h".
Remove prototype from "class_obd.c".
Issue addressed by checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: remove extern in .c file
Haneen Mohammed [Sat, 21 Mar 2015 05:51:35 +0000 (08:51 +0300)]
Staging: lustre: remove extern in .c file

This patch removes extern from .c file; for the variable is not used
anywhere else in the file.
In addition, it mark it static in the one file it is in
"ldlm_resource.c".

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Convert macro class_export_rpc_dec into static inline function
Somya Anand [Sat, 21 Mar 2015 12:50:25 +0000 (18:20 +0530)]
Staging: lustre: Convert macro class_export_rpc_dec into static inline function

This patch converts the macro class_export_rpc_dec into static inline
function. This is possible because the types of arguments at all the call
sites are same. So, the type of parameter is compatible with the types of
the arguments at all of the call sites.

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Convert macro class_export_rpc_inc into static inline function
Somya Anand [Sat, 21 Mar 2015 12:50:24 +0000 (18:20 +0530)]
Staging: lustre: Convert macro class_export_rpc_inc into static inline function

This patch converts the macro class_export_rpc_inc into static inline
function. This is possible because the types of arguments at all the call
sites are same. So, the type of parameter is compatible with the types of
the arguments at all of the call sites.

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>