Helen Fornazier [Thu, 26 Mar 2015 17:09:15 +0000 (14:09 -0300)]
staging: sm750fb: Fix for statement style
This patch fixes the checkpatch.pl warnings:
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '>' (ctx:VxV)
ERROR: space required before the open parenthesis '('
ERROR: space required after that ';' (ctx:VxV)
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ERROR: that open brace { should be on the previous line
ERROR: else should follow close brace '}'
WARNING: braces {} are not necessary for single statement blocks
ERROR: space required before the open brace '{'
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sudip Mukherjee [Tue, 24 Mar 2015 15:17:28 +0000 (20:47 +0530)]
staging: unisys: use local variable in cleanup
the dev_t was being stored in visorchipset_platform_device.dev.devt
while initializing the module. so pass that value as an argument to
cleanup() so that it can use this local variable instead of the global
variable.
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>
Sudip Mukherjee [Tue, 24 Mar 2015 15:17:27 +0000 (20:47 +0530)]
staging: unisys: use local variable
we are getting dev_t as an argument in the function, so use the local
variable instead of the global variable "majordev".
this global variable will be removed in one of the next patch of the
series.
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>
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>
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
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
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>
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>
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>
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.
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.
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>
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.
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>
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.
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.
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.
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.
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>
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>
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:
Merge tag 'iio-for-4.1a' of git://git.kernel.org/pub/scm/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.
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.
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".
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.
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.
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>
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>
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>
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>
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.
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>
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.
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>