GitHub/moto-9609/android_kernel_motorola_exynos9610.git
7 years agostaging: fsl-mc/dpio: add cpu <--> LE conversion for dpaa2_fd
Horia Geantă [Fri, 28 Apr 2017 14:38:58 +0000 (17:38 +0300)]
staging: fsl-mc/dpio: add cpu <--> LE conversion for dpaa2_fd

While dpaa2_fd.simple structure fields are marked __leXX,
corresponding cpu_to_leXX / leXX_to_cpu conversions are missing.

While here, fix dpaa2_fd_{get,set}_bpid such that BMT, IVP bits
sharing the 16-bit field with BPID are not affected.

Fixes: d3269bdc7ebc ("bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: remove line continuations in quoted strings
Ilia Sergachev [Fri, 28 Apr 2017 15:30:55 +0000 (17:30 +0200)]
staging: ks7010: remove line continuations in quoted strings

Checkpatch emits WARNING: Avoid line continuations in quoted strings.

Remove line continuations - split strings using quotes.

Signed-off-by: Ilia Sergachev <ilia.sergachev@unibas.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vt6656: use tabs instead of spaces
Juan Antonio Pedreira Martos [Fri, 28 Apr 2017 11:25:37 +0000 (13:25 +0200)]
staging: vt6656: use tabs instead of spaces

Fix a checkpatch error: CODE_INDENT (code indent should use tabs where
possible).

Signed-off-by: Juan Antonio Pedreira Martos <juanpm1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Fix unnecessary initialization of static variable
Fabrizio Perria [Fri, 28 Apr 2017 12:05:30 +0000 (08:05 -0400)]
staging: android: ion: Fix unnecessary initialization of static variable

Fix checkpatch warning: removed unnecessary initialization of
static variable "heap_id" to 0 in source file "ioc.c".

Signed-off-by: Fabrizio Perria <fabrizio.perria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: media: atomisp: fix range checking on clk_num
Colin Ian King [Fri, 14 Apr 2017 14:25:40 +0000 (15:25 +0100)]
staging: media: atomisp: fix range checking on clk_num

The range checking on clk_num is incorrect; fix these so that invalid
clk_num values are detected correctly.

Detected by static analysis with by PVS-Studio

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: media: atomisp: fix misspelled word in comment
Luis Oliveira [Wed, 19 Apr 2017 12:44:28 +0000 (13:44 +0100)]
staging: media: atomisp: fix misspelled word in comment

This fix "overrided", the correct past tense form of "override" is
"overridden".

Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: media: atomisp: kmap() can't fail
Fabian Frederick [Fri, 28 Apr 2017 12:10:39 +0000 (13:10 +0100)]
staging: media: atomisp: kmap() can't fail

There's no need to check kmap() return value because it won't fail.
If it's highmem mapping, it will receive virtual address
or a new one; if it's lowmem, all kernel pages are already being mapped.

(Thanks to Jan Kara for explanations)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: atomisp: remove #ifdef for runtime PM functions
Arnd Bergmann [Fri, 28 Apr 2017 12:10:31 +0000 (13:10 +0100)]
staging: atomisp: remove #ifdef for runtime PM functions

The runtime power management functions are called from the reset handler even
if CONFIG_PM is disabled, leading to a link error:

drivers/staging/built-in.o: In function `atomisp_reset':
(.text+0x4cd1c): undefined reference to `atomisp_runtime_suspend'
drivers/staging/built-in.o: In function `atomisp_reset':
(.text+0x4cd3a): undefined reference to `atomisp_mrfld_power_down'
drivers/staging/built-in.o: In function `atomisp_reset':
(.text+0x4cd58): undefined reference to `atomisp_mrfld_power_up'
drivers/staging/built-in.o: In function `atomisp_reset':
(.text+0x4cd77): undefined reference to `atomisp_runtime_resume'

Removing the #ifdef around the PM functions avoids the problem, and
lets us simplify it further. The __maybe_unused annotation is needed
to ensure the compiler can silently drop the unused callbacks.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: atomisp: satm include directory is gone
Arnd Bergmann [Fri, 28 Apr 2017 12:10:23 +0000 (13:10 +0100)]
staging: atomisp: satm include directory is gone

After the satm kernel was removed, we should no longer add the directory
to the search path. This was found with a 'make W=1' warning:

cc1: error: drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/: No such file or directory [-Werror=missing-include-dirs]

Fixes: 184f8e0981ef ("atomisp: remove satm kernel")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoatomisp: remove some more unused files
Alan Cox [Fri, 28 Apr 2017 12:10:13 +0000 (13:10 +0100)]
atomisp: remove some more unused files

The extra list contains some which are used and some which are not. At this
point I think we can safely remove those that are simply not used.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoatomisp: remove hmm_load/store/clear indirections
Alan Cox [Fri, 28 Apr 2017 12:10:01 +0000 (13:10 +0100)]
atomisp: remove hmm_load/store/clear indirections

We have a layer of un-needed wrapping here that can go. In addition there are
some functions that don't exist and one that isn't used which can also go.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoatomisp: kill off mmgr_free
Alan Cox [Fri, 28 Apr 2017 12:09:46 +0000 (13:09 +0100)]
atomisp: kill off mmgr_free

This is just another wrapper layer around hmm_free that servers no purpose
in this driver.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoatomisp: clean up the hmm init/cleanup indirections
Alan Cox [Fri, 28 Apr 2017 12:09:33 +0000 (13:09 +0100)]
atomisp: clean up the hmm init/cleanup indirections

We don't need any of these indirections as we only support one MMU type. Start
by getting rid of the init/clear/free ones. The init ordering check we already
pushed down in a previous patch.

The allocation side is more complicated so leave it for now.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoatomisp: handle allocation calls before init in the hmm layer
Alan Cox [Fri, 28 Apr 2017 12:09:23 +0000 (13:09 +0100)]
atomisp: handle allocation calls before init in the hmm layer

Currently the code handles this in the abstraction above. We want to remove
that abstraction so begin by pushing down the sanity check. Unfortunately
at this point we can't simply fix the init order.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add maintainer for Ethernet driver
Ioana Radulescu [Fri, 28 Apr 2017 09:50:34 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add maintainer for Ethernet driver

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add TODO file
Ioana Radulescu [Fri, 28 Apr 2017 09:50:33 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add TODO file

Add a list of TODO items for the Ethernet driver

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add trace points
Ioana Radulescu [Fri, 28 Apr 2017 09:50:32 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add trace points

Add trace events in significant places of the data path.
Useful for debuggging.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add driver specific stats
Ioana Radulescu [Fri, 28 Apr 2017 09:50:31 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add driver specific stats

Add custom statistics to be reported via ethtool -S. These include
driver specific per-cpu statistics as well as queue and channel
counters.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add ethtool support
Ioana Radulescu [Fri, 28 Apr 2017 09:50:30 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add ethtool support

Add support for several ethtool operations: show hardware statistics,
get/set link settings, get hash configuration.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver
Ioana Radulescu [Fri, 28 Apr 2017 09:50:29 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver

Introduce the DPAA2 Ethernet driver, which manages Datapath
Network Interface (DPNI) objects discovered on the MC bus.

In addition to DPNIs, the Ethernet driver uses several other
MC objects to build a network interface abstraction: buffer
pools (DPBPs), I/O Portals (DPIOs) and concentrators (DPCONs).

A more detailed description of the driver can be found in the
associated README file.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add APIs for DPNI objects
Ioana Radulescu [Fri, 28 Apr 2017 09:50:28 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add APIs for DPNI objects

Add the command build/parse APIs for operating on DPNI objects through
the DPAA2 Management Complex.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-dpaa2/eth: Add Ethernet driver overview document
Ioana Radulescu [Fri, 28 Apr 2017 09:50:27 +0000 (04:50 -0500)]
staging: fsl-dpaa2/eth: Add Ethernet driver overview document

Add a README file describing the driver architecture, components
and I/O interface.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: bus: add DPCON object APIs
Ioana Radulescu [Fri, 28 Apr 2017 09:50:26 +0000 (04:50 -0500)]
staging: fsl-mc: bus: add DPCON object APIs

This patch adds the command building/parsing wrapper functions
for the DPCON object. The binary interface version is v3.2.

A DPCON (DataPath Concentrator) is an aggregator object that
allows ingress frames from multiple hardware queues to be seen
as coming from a single source, from the CPU point of view.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: bus: dpio: fix alter FQ state command
Horia Geantă [Sat, 22 Apr 2017 06:44:49 +0000 (09:44 +0300)]
staging: fsl-mc: bus: dpio: fix alter FQ state command

When checking the response verb, the valid bit should be masked out,
since its value flips depending on what Response Register
(RR0 /RR1) it's been read from.

Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8723bs: declare private function as static
Kenneth Hsu [Sun, 23 Apr 2017 17:37:02 +0000 (10:37 -0700)]
staging: rtl8723bs: declare private function as static

This fixes a sparse warning regarding an undeclared symbol.  Since the
function is private to rtw_recv.c, it should be declared as static.

Signed-off-by: Kenneth Hsu <kennethhsu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gdm724x: gdm_mux: fix use-after-free on module unload
Johan Hovold [Wed, 26 Apr 2017 10:23:04 +0000 (12:23 +0200)]
staging: gdm724x: gdm_mux: fix use-after-free on module unload

Make sure to deregister the USB driver before releasing the tty driver
to avoid use-after-free in the USB disconnect callback where the tty
devices are deregistered.

Fixes: 61e121047645 ("staging: gdm7240: adding LTE USB driver")
Cc: stable <stable@vger.kernel.org> # 3.12
Cc: Won Kang <wkang77@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8723bs: Fix assignment in if condition in os_dep/sdio_intf.c
Bingyu Zhou [Wed, 19 Apr 2017 11:47:41 +0000 (19:47 +0800)]
staging: rtl8723bs: Fix assignment in if condition in os_dep/sdio_intf.c

ERROR: do not use assignment in if condition
Detected by scripts/checkpatch.pl -f

Signed-off-by: Bingyu Zhou <rain.by.zhou@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: embedded function name style fixes
Ian Chard [Fri, 28 Apr 2017 09:04:58 +0000 (10:04 +0100)]
staging: rtl8188eu: embedded function name style fixes

Replace a couple of function names embedded in trace messages
with __func__.  One of them had a typo anyway.

Signed-off-by: Ian Chard <ian@chard.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()
Dan Carpenter [Sat, 22 Apr 2017 10:47:23 +0000 (13:47 +0300)]
staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()

The "len" could be as low as -14 so we should check for negatives.

Fixes: 9a7fe54ddc3a ("staging: r8188eu: Add source files for new driver - part 1")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: fix spelling mistake in variable name *attentuation
Colin Ian King [Fri, 21 Apr 2017 16:19:31 +0000 (17:19 +0100)]
staging: rtl8192u: fix spelling mistake in variable name *attentuation

Fix the spelling of a bunch of variables, from *attentuation to
*attenuation.  No functional change.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: fix incorrect assignments
Jakub Jedelsky [Tue, 11 Apr 2017 08:19:08 +0000 (10:19 +0200)]
staging: rtl8192u: fix incorrect assignments

Fixing warnings found by sparse on rtl8192u/ieee80211.

drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1318:45: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1318:45:    expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1318:45:    got restricted __be16 [usertype] <noident>

drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1481:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1481:40:    expected restricted __le16 <noident>
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1481:40:    got int

drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1483:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1483:40:    expected restricted __le16 <noident>
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1483:40:    got int

drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1487:45: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1487:45:    expected restricted __le16 <noident>
drivers/staging/rtl8192u/ieee80211//ieee80211_rx.c:1487:45:    gotunsigned short [unsigned] [usertype] <noident>

Signed-off-by: Jakub Jedelsky <jakub.jedelsky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: fix ifnullfree.cocci warnings
kbuild test robot [Sun, 23 Apr 2017 09:26:23 +0000 (12:26 +0300)]
staging: ccree: fix ifnullfree.cocci warnings

drivers/staging/ccree/ssi_hash.c:317:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:320:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:323:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:373:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:375:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:377:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:379:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:381:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/staging/ccree/ssi_hash.c:383:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: fix ifnullfree.cocci warnings
kbuild test robot [Sun, 23 Apr 2017 09:26:22 +0000 (12:26 +0300)]
staging: ccree: fix ifnullfree.cocci warnings

drivers/staging/ccree/ssi_buffer_mgr.c:530:3-19: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: fix array_size.cocci warnings
kbuild test robot [Sun, 23 Apr 2017 09:26:21 +0000 (12:26 +0300)]
staging: ccree: fix array_size.cocci warnings

drivers/staging/ccree/ssi_sysfs.c:319:34-35: WARNING: Use ARRAY_SIZE
drivers/staging/ccree/ssi_sysfs.c:429:34-35: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

Generated by: scripts/coccinelle/misc/array_size.cocci

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: fix semicolon.cocci warnings
kbuild test robot [Sun, 23 Apr 2017 09:26:20 +0000 (12:26 +0300)]
staging: ccree: fix semicolon.cocci warnings

drivers/staging/ccree/ssi_request_mgr.c:623:3-4: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: fix platform_no_drv_owner.cocci warnings
kbuild test robot [Sun, 23 Apr 2017 09:26:19 +0000 (12:26 +0300)]
staging: ccree: fix platform_no_drv_owner.cocci warnings

drivers/staging/ccree/ssi_driver.c:484:6-11: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: remove useless NULL test of field
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:18 +0000 (12:26 +0300)]
staging: ccree: remove useless NULL test of field

Remove kbuild test robot reported NULL check for a struct field address.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: add DT bindings for Arm CryptoCell
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:16 +0000 (12:26 +0300)]
staging: ccree: add DT bindings for Arm CryptoCell

This adds DT bindings for the Arm TrustZone CryptoCell cryptographic
accelerator IP.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: add TODO list
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:15 +0000 (12:26 +0300)]
staging: ccree: add TODO list

Add TODO list for moving out of staging tree for ccree crypto driver

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: add FIPS support
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:14 +0000 (12:26 +0300)]
staging: ccree: add FIPS support

Add FIPS mode support to CryptoCell driver

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: add AEAD support
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:13 +0000 (12:26 +0300)]
staging: ccree: add AEAD support

Add CryptoCell AEAD support

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: add IV generation support
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:12 +0000 (12:26 +0300)]
staging: ccree: add IV generation support

Add CryptoCell IV hardware generation support.

This patch adds the needed support to drive the HW but does not expose
the ability via the kernel crypto API yet.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: add skcipher support
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:11 +0000 (12:26 +0300)]
staging: ccree: add skcipher support

Add CryptoCell skcipher support

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: add ahash support
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:10 +0000 (12:26 +0300)]
staging: ccree: add ahash support

Add CryptoCell async. hash and HMAC support.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: introduce CryptoCell HW driver
Gilad Ben-Yossef [Sun, 23 Apr 2017 09:26:09 +0000 (12:26 +0300)]
staging: ccree: introduce CryptoCell HW driver

Introduce basic low level Arm TrustZone CryptoCell HW support.
This first patch doesn't actually register any Crypto API
transformations, these will follow up in the next patch.

This first revision supports the CC 712 REE component.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8723bs: rework debug configuration handling
Arnd Bergmann [Fri, 21 Apr 2017 20:59:16 +0000 (22:59 +0200)]
staging: rtl8723bs: rework debug configuration handling

I ran into this warning during randconfig testing:

drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_deinit':
drivers/staging/rtl8723bs/os_dep/rtw_proc.c:738:25: error: unused variable 'drv_proc' [-Werror=unused-variable]
drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_replace':
drivers/staging/rtl8723bs/os_dep/rtw_proc.c:762:25: error: unused variable 'drv_proc' [-Werror=unused-variable]

The problem is that the code procfs code gets built even when CONFIG_PROC_FS
is disabled, but some functions are turned into empty stubs then. This
is easily addressed by adding an #ifdef around the definition of the
CONFIG_PROC_DEBUG macro.

However, I could not bear looking at the macro name that clashes with the
Kconfig name space, so I also renamed it to simply PROC_DEBUG, along with
the other rtl8723bs specific CONFIG_DEBUG_* macros that I renamed the same
way. This is consistent with how we handle the same checks in the non-staging
rtlwifi driver.

As the code path for !CONFIG_PROC_DEBUG had not been tested properly, it
turned out to be incorrect and requires adding 'static inline' annotations
for the stub handlers, and moving some variables around.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8723bs: fix empty-body warning
Arnd Bergmann [Wed, 19 Apr 2017 17:16:26 +0000 (19:16 +0200)]
staging: rtl8723bs: fix empty-body warning

The newly added driver causes lots of warnings like

drivers/staging/rtl8723bs/core/rtw_recv.c: In function 'validate_recv_frame':
drivers/staging/rtl8723bs/core/rtw_recv.c:1602:4: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
    DBG_COUNTER(adapter->rx_logs.core_rx_pre_data_handled);
drivers/staging/rtl8723bs/core/rtw_xmit.c: In function 'update_attrib':
drivers/staging/rtl8723bs/core/rtw_xmit.c:726:3: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
   DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_unknown);
drivers/staging/rtl8723bs/hal/HalPhyRf.c: In function 'ODM_TXPowerTrackingCallback_ThermalMeter':
drivers/staging/rtl8723bs/hal/HalPhyRf.c:146:4: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
drivers/staging/rtl8723bs/hal/HalPhyRf.c:529:6: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
drivers/staging/rtl8723bs/hal/HalPhyRf.c:559:6: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

When DBG_COUNTER() etc is defined as a non-empty macro, we get the intended
behavior and no warning. Using no_printk() for printing helper functions
as the added advantage of compile-time checking format strings

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: fix open parentheses alignment
Christophe Colin [Sun, 23 Apr 2017 19:55:25 +0000 (21:55 +0200)]
staging: fbtft: fix open parentheses alignment

Modify the code indentations to fix the checkpatch issues.

Signed-off-by: Christophe Colin <popscolin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: olpc_dcon: style fixes
Dhananjay Balan [Mon, 24 Apr 2017 13:15:53 +0000 (15:15 +0200)]
staging: olpc_dcon: style fixes

 removes hardcoded function name and uses __func__ to print info.

Signed-off-by: Dhananjay Balan <mail@dbalan.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: wlan-ng: break long line in p80211req.c
Ian Chard [Thu, 27 Apr 2017 08:28:06 +0000 (09:28 +0100)]
staging: wlan-ng: break long line in p80211req.c

Fix a style warning for a line over 80 characters long.

Signed-off-by: Ian Chard <ian@chard.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vt6656: use off stack for in buffer USB transfers.
Malcolm Priestley [Sat, 22 Apr 2017 10:14:58 +0000 (11:14 +0100)]
staging: vt6656: use off stack for in buffer USB transfers.

Since 4.9 mandated USB buffers to be heap allocated. This causes
the driver to fail.

Create buffer for USB transfers.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vt6656: use off stack for out buffer USB transfers.
Malcolm Priestley [Sat, 22 Apr 2017 10:14:57 +0000 (11:14 +0100)]
staging: vt6656: use off stack for out buffer USB transfers.

Since 4.9 mandated USB buffers be heap allocated this causes the driver
to fail.

Since there is a wide range of buffer sizes use kmemdup to create
allocated buffer.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrivers:staging:vt6656: remove usb_device_reset in main_usb.c:
Chewie Lin [Wed, 19 Apr 2017 07:58:35 +0000 (00:58 -0700)]
drivers:staging:vt6656: remove usb_device_reset in main_usb.c:

Removed the usb_device_reset(), replace with call to usb_reset_device()
directly. Plus it removes the confusing function name and addressed
the checkpatch warning. This change also swaps string in the dev_warn() call
with __func__ argument to "vt6656_probe" instead of literal string
"usb_reset_device".

        WARNING: Prefer using "%s", __func__ to embedded function names
        #417: FILE: main_usb.c:417:
        +                        "usb_device_reset fail status=%d\n", status);

        total: 0 errors, 1 warnings, 1058 lines checked

And after fix:

         main_usb.c has no obvious style problems and is ready for submission.

Signed-off-by: Chewie Lin <linsh@oregonstate.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: wilc1000: fix unchecked return value
Pan Bian [Sun, 23 Apr 2017 11:53:58 +0000 (19:53 +0800)]
staging: wilc1000: fix unchecked return value

Function dev_alloc_skb() will return a NULL pointer if there is no
enough memory. However, in function WILC_WFI_mon_xmit(), its return
value is used without validation. This may result in a bad memory access
bug. This patch fixes the bug.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorhba: fix s-Par to boot with option CONFIG_VMAP_STACK set to y
Sameer Wadgaonkar [Tue, 18 Apr 2017 20:55:25 +0000 (16:55 -0400)]
staging: unisys: visorhba: fix s-Par to boot with option CONFIG_VMAP_STACK set to y

The root issue is that we are not allowed to have items on the
stack being passed to "DMA" like operations. In this case we have
a vmcall and an inline completion of scsi command.

This patch fixes the issue by moving the variables on stack in
do_scsi_nolinuxstat() to heap memory.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: fix s-Par to boot with option CONFIG_VMAP_STACK set to y
Sameer Wadgaonkar [Tue, 18 Apr 2017 20:55:24 +0000 (16:55 -0400)]
staging: unisys: visorbus: fix s-Par to boot with option CONFIG_VMAP_STACK set to y

The root issue is that we are not allowed to have items on the
stack being passed to "DMA" like operations. In this case we have
vmcall operation that was using parameters from the stack.

This patch fixes the issue by moving the variables on stack in
issue_vmcall_io_controlvm_addr() to vmcall_controlvm_addr struct.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove POSTCODE from visorchipset_init
David Kershner [Tue, 18 Apr 2017 20:55:23 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove POSTCODE from visorchipset_init

Remove POSTCODEs from visorchipset_init and replace them with dev_err when
needed.

Since there are no more POSTCODEs in the code, we can get rid of the data
in the header file as well.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove postcodes in setup_crash_devices_work_queue
David Kershner [Tue, 18 Apr 2017 20:55:22 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove postcodes in setup_crash_devices_work_queue

Replace postcodes with dev_err in the function
setup_crash_device_work_queue.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: refactor setup_crash_devices_work_queue
David Kershner [Tue, 18 Apr 2017 20:55:21 +0000 (16:55 -0400)]
staging: unisys: visorbus: refactor setup_crash_devices_work_queue

The if statement was sending us down the happy path with the error path
in the else. This can be simplified by having the if be the error and
just falling through with the good path.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of POSTCODES in my_device_changestate
David Kershner [Tue, 18 Apr 2017 20:55:20 +0000 (16:55 -0400)]
staging: unisys: visorbus: get rid of POSTCODES in my_device_changestate

Replace POSTCODEs with dev_err in the function my_device_changestate.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove POSTCODE from my_device_create
David Kershner [Tue, 18 Apr 2017 20:55:19 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove POSTCODE from my_device_create

Replace the POSTCODEs with dev_err in my_device_create.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove POSTCODE from bus_configure
David Kershner [Tue, 18 Apr 2017 20:55:18 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove POSTCODE from bus_configure

Remove the POSTCODE logging from bus_configure, replace it with an
error message if we fail dumping the errno.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove POSTCODEs from bus_create
David Kershner [Tue, 18 Apr 2017 20:55:17 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove POSTCODEs from bus_create

Removed the POSTCODEs from the function bus_create.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: get rid of POSTCODEs in save_crash_msg
David Kershner [Tue, 18 Apr 2017 20:55:16 +0000 (16:55 -0400)]
staging: unisys: visorbus: get rid of POSTCODEs in save_crash_msg

Replace POSTCODES in save_crash_msg with dev_err handling.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove postcodes in visorbus_init
David Kershner [Tue, 18 Apr 2017 20:55:15 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove postcodes in visorbus_init

Remove the POSTCODES in visorbus_init. Since there are no more POSTCODES
in visorbus_main.c we can remove the reference to the vmcallinterface
header file.

No need for vmcallinterface in visorbus_main.c

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove noisy postcode from visorchipset_exit
David Kershner [Tue, 18 Apr 2017 20:55:14 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove noisy postcode from visorchipset_exit

The postcodes in visorchipset_exit were not displaying errors, they can
just be removed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove noisy postcode in bus_destroy
David Kershner [Tue, 18 Apr 2017 20:55:13 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove noisy postcode in bus_destroy

Since kzalloc will display error the postcode becomes redundant, it
can be removed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove noisy postcodes
David Kershner [Tue, 18 Apr 2017 20:55:12 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove noisy postcodes

Get rid of postcodes from visorbus_main.c that are just informational.

They were not logging errors, we don't need to replace them with
anything.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove POSTCODE in create_bus_instance
David Kershner [Tue, 18 Apr 2017 20:55:11 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove POSTCODE in create_bus_instance

Remove postcodes from create_bus_instance. If there is an error log
it with dev_err.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove POSTCODE from chispet_init
David Kershner [Tue, 18 Apr 2017 20:55:10 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove POSTCODE from chispet_init

Get rid of the postcodes from the function chipset_init. They were
being noisy, so don't replace them with errors.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove POSTCODE from create_visor_device
David Kershner [Tue, 18 Apr 2017 20:55:09 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove POSTCODE from create_visor_device

Remove POSTCODES from create_visor_device, when we fail log an error
with dev_err.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove NORETRY
David Kershner [Tue, 18 Apr 2017 20:55:08 +0000 (16:55 -0400)]
staging: unisys: visorbus: remove NORETRY

Allow retry when allocating memory.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: handle visorchannel_write errors in code
David Kershner [Tue, 18 Apr 2017 20:55:07 +0000 (16:55 -0400)]
staging: unisys: visorbus: handle visorchannel_write errors in code

Catch and report back errors when visorchannel_write fails.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: add timeout to controlvm_periodic_work
David Kershner [Tue, 18 Apr 2017 20:55:06 +0000 (16:55 -0400)]
staging: unisys: visorbus: add timeout to controlvm_periodic_work

Limit the amount that gets pulled from the queue on each try so we don't
get stuck in an infinite loop if something has gone wrong with the s-Par
firmware.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: update comment
David Kershner [Tue, 18 Apr 2017 20:55:05 +0000 (16:55 -0400)]
staging: unisys: visorbus: update comment

Comment was outdated and did not reflect what was actually happening.
Update the comment to reflect reality.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: fixed indentation
David Kershner [Tue, 18 Apr 2017 20:55:04 +0000 (16:55 -0400)]
staging: unisys: visorbus: fixed indentation

Moved the brace to the left to fix the indentation issue.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging; unisys: visorbus: replace uint32 with int
David Kershner [Tue, 18 Apr 2017 20:55:03 +0000 (16:55 -0400)]
staging; unisys: visorbus: replace uint32 with int

Shouldn't use uint32 in the kernel, it can be replaced with int here.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visornic: remove keyword inline from function
David Kershner [Tue, 18 Apr 2017 20:55:02 +0000 (16:55 -0400)]
staging: unisys: visornic: remove keyword inline from function

Functions in c files don't need to be inlined, get rid of the keyword.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: combine response functions into a single one
David Kershner [Tue, 18 Apr 2017 20:55:01 +0000 (16:55 -0400)]
staging: unisys: visorbus: combine response functions into a single one

There are several different controlvm response functions, consolidate them
to one so we can simplify error handling.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: fix enumeration tags
Tobin C. Harding [Thu, 27 Apr 2017 01:25:27 +0000 (11:25 +1000)]
staging: ks7010: fix enumeration tags

Driver header declares enumeration types without tags. Using
informative tags makes the code easier to understand and
eliminates the need to comment the enum.

Add tags to enumeration types.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: add enum multicast_filter_type
Tobin C. Harding [Thu, 27 Apr 2017 01:25:26 +0000 (11:25 +1000)]
staging: ks7010: add enum multicast_filter_type

Driver uses preprocessor directives to define multicast filter
constants. These can be defined using an enumeration type. Doing so
adds to the readability and gives the assists the compiler.

Add enumeration type multicast_filter_type to replace preprocessor
defined constants.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: clean up macro ps_confirm_wait_inc
Tobin C. Harding [Thu, 27 Apr 2017 01:25:25 +0000 (11:25 +1000)]
staging: ks7010: clean up macro ps_confirm_wait_inc

Macro includes commented out code. Removing dead code line enables
braces to be removed. Macro is easier to read if the code is clean.

Clean up macro ps_confirm_wait_inc.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: continue from loop on unmatched mac
Tobin C. Harding [Thu, 27 Apr 2017 01:25:24 +0000 (11:25 +1000)]
staging: ks7010: continue from loop on unmatched mac

Inside loop, code block is guarded with an 'if' statement. Instead of
guarding the block we can invert the 'if' statement conditional and
continue the loop. Doing so allows subsequent code indentation to be
reduced and aids the readability of the code.

Invert 'if' statement conditional, continue loop if new conditional
evaluates to true. Reduce subsequent code indentation level. Do not
change program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: remove cast from netdev_priv()
Tobin C. Harding [Thu, 27 Apr 2017 01:25:23 +0000 (11:25 +1000)]
staging: ks7010: remove cast from netdev_priv()

The returned pointer from netdev_priv() (void *) does not need to be
cast.

Remove unnecessary cast of void * returned by netdev_priv().

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: make abbreviation mgmt uniform
Tobin C. Harding [Thu, 27 Apr 2017 01:25:22 +0000 (11:25 +1000)]
staging: ks7010: make abbreviation mgmt uniform

Driver currently uses abbreviations 'mgt' and 'mngmt' for
'management'. Also 'power' is sometimes abbreviated to 'pow' and other
times not. It makes the code easier to read and easier to modify if
one abbreviation is used throughout the driver. 'mgmt' is widely
accepted as an abbreviation of 'management'. 'power' can be spelled
out in full, the extra two characters aids readability without an
excessive cost.

Make abbreviation of 'management' uniform across the driver, function
names, preprocessor defined constants, and enumeration types.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: fix checkpatch LINE_SPACING
Tobin C. Harding [Thu, 27 Apr 2017 01:25:21 +0000 (11:25 +1000)]
staging: ks7010: fix checkpatch LINE_SPACING

Checkpatch emits CHECK: Please don't use multiple blank lines.

Remove multiple blank lines.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: add enum sleep_mode_type
Tobin C. Harding [Thu, 27 Apr 2017 01:25:20 +0000 (11:25 +1000)]
staging: ks7010: add enum sleep_mode_type

Driver uses preprocessor directives to define SLP_ASLEEP and
SLP_ACTIVE. These can be defined using an enumeration type. Doing so
adds to the readability and gives the usual compiler benefits of
having an enum. Functions that currently accept integer types can now
use the new enumeration type, further aiding readability.

Add enumeration type sleep_mode_type. Update code that handles sleep
mode to use the new enumeration type.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: abstract connection status
Tobin C. Harding [Thu, 27 Apr 2017 01:25:19 +0000 (11:25 +1000)]
staging: ks7010: abstract connection status

Host interface connection status is handled using a 32 bit type. Top
byte is used as for FORCE_DISCONNECT status, low bits are used for
connect/disconnect status. Driver masks and checks integers to
ascertain status. If functions are defined to do the masking and
equality check then the details of how the status integer is used are
abstracted away. This makes the code easier to read. Also future
updates to the status handling will be easier because the code is in
one place.

Driver currently uses the CONNECT_STATUS and DISCONNECT_STATUS as
values, as apposed to opaque values. Because of this driver code
checks for equality with CONNECT_STATUS and DISCONNECT_STATUS as
apposed to negating a single check (ie 'foo != CONNECT_STATUS). In
order to maintain the current functionality we define two separate
functions is_connect_status() and is_disconnect_status().

Add functions to abstract the status integer check. Update all sites
that do the check manually to use the newly defined functions.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: add hostif_generic_request()
Tobin C. Harding [Thu, 27 Apr 2017 01:25:18 +0000 (11:25 +1000)]
staging: ks7010: add hostif_generic_request()

Driver contains duplicate code. Host interface has numerous request
functions which allocate memory for a request header. Each request
header is different but all contain, as the first member, a hostif_hdr
structure. This structure has size and event members which need to be
set. By defining a helper function to allocate the memory and set the
initial hostif_hdr members code duplication is reduced.

Add function to allocate  memory for a host interface request. Set
'size' and 'event' members. Remove duplicate code using newly defined
function.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: clean memory allocation
Tobin C. Harding [Thu, 27 Apr 2017 01:25:17 +0000 (11:25 +1000)]
staging: ks7010: clean memory allocation

Memory allocation code contains unneeded debug statements, failed
kmalloc() calls typically do not require a debug message. Introduction
of a local 'size' variable allows kmalloc() call to be marginally
cleaner, still uses magic numbers but these require a more substantial
fix. Moving the magic numbers onto a single line opens the way for
further refactoring.

Clean memory allocation code, remove debug statements.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: remove duplicate code
Tobin C. Harding [Thu, 27 Apr 2017 01:25:16 +0000 (11:25 +1000)]
staging: ks7010: remove duplicate code

Current switch statement has duplicate code in branches. This code can
be put after the switch statement so as to remove the duplication.

Move code to after switch statement, remove duplicate code. Make error
branch return so as not to execute the moved code block. Do not change
the program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: remove magic numbers
Tobin C. Harding [Thu, 27 Apr 2017 01:25:15 +0000 (11:25 +1000)]
staging: ks7010: remove magic numbers

Driver includes magic numbers. Defining constants or using existing
constants aids the readability of the code.

Magic number '12' is used for two ethernet addresses (6 bytes
each). ETH_ALEN is already defined within the kernel to 6. We can us
the expression '2 * ETH_ALEN' to make this code explicit.

Magic number '20' refers to the data size, in bytes, of a struct
ether_hdr (described in eap_packet.h). We can define a constant for
this purpose, making the code explicit and easier to read.

Define constant. Remove magic numbers, using newly defined constant
and/or expression using existing kernel constant.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: move skb null check near allocation
Tobin C. Harding [Thu, 27 Apr 2017 01:25:14 +0000 (11:25 +1000)]
staging: ks7010: move skb null check near allocation

Currently, after allocating an sk_buff, driver fills the sk_buff
within code block guarded by a NULL check on the sk_buff. If a NULL
check is done immediately after the allocation, and code returns on
error, then the subsequent code need not be guarded and the level of
indentation may be reduced. This aids the readability of the code and
makes explicit the error path.

Check for NULL directly after allocating the sk_buff, return if
allocation fails. Reduce indentation of subsequent code. Do not change
the program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: remove unused local variable eap_key
Tobin C. Harding [Thu, 27 Apr 2017 01:25:13 +0000 (11:25 +1000)]
staging: ks7010: remove unused local variable eap_key

Code declares and assigns to a local variable that is never used, it
can be safely removed.

Remove unused local variable.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: remove unnecessary address check
Tobin C. Harding [Thu, 27 Apr 2017 01:25:12 +0000 (11:25 +1000)]
staging: ks7010: remove unnecessary address check

Currently source and destination ethernet addresses are checked twice,
once in hostif_data_indication() and then again in
hostif_data_indication_wpa(). The second of these functions is called
from the first right after the address check is done. This check is a
duplicate and is unnecessary.

Remove unnecessary duplicate address check.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: remove void function return
Valentin Vidic [Wed, 26 Apr 2017 10:48:31 +0000 (12:48 +0200)]
staging: lustre: remove void function return

All statements removed from the end of void functions
as reported by checkpatch.

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Remove whitespace before quoted newline
Paolo Cretaro [Tue, 25 Apr 2017 20:14:29 +0000 (22:14 +0200)]
staging: android: ion: Remove whitespace before quoted newline

Fix checkpatch.pl warning about unnecessary whitespace before a
quoted newline.

Signed-off-by: Paolo Cretaro <melko@frugalware.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: aim-sound style fixess
Dhananjay Balan [Mon, 24 Apr 2017 13:54:05 +0000 (15:54 +0200)]
staging: most: aim-sound style fixess

Replace hardcoded function name with __func__

Signed-off-by: Dhananjay Balan <mail@dbalan.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: Replace spaces with tabs for indentation
Paolo Cretaro [Fri, 21 Apr 2017 22:47:59 +0000 (00:47 +0200)]
staging: android: ion: Replace spaces with tabs for indentation

Fix checkpatch ERRORs: code indent should use tabs where possible.

Signed-off-by: Paolo Cretaro <melko@frugalware.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: add send_xchar and tiocmset methods
Okash Khawaja [Sat, 22 Apr 2017 08:00:28 +0000 (09:00 +0100)]
staging: speakup: add send_xchar and tiocmset methods

This adds two methods to spk_synth struct: send_xchar and tiocmset, and
creates serial implementation for each of them. It takes existing code
in apollo, audptr and spkout which already fits the behaviour of
send_xchar and tiocmset. In follow-up patches there will be TTY-based
implementations of these methods. Then migrating the synths to TTY will
include repointing these methods to their TTY implementations

Rest of the changes simply make use of serial implementation of these two
functions.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>