platform/kernel/linux-rpi.git
6 years agostaging: rtl8188eu: use is_multicast_ether_addr
Michael Straube [Wed, 1 Aug 2018 19:10:50 +0000 (21:10 +0200)]
staging: rtl8188eu: use is_multicast_ether_addr

Use is_multicast_ether_addr instead of custom IS_MCAST.
The variable for the result of IS_MCAST was only used in the
if conditional. So remove the extra variable and move the call
to is_multicast_ether_addr into the conditional.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Merge header files
Ioana Radulescu [Wed, 1 Aug 2018 16:09:51 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Merge header files

File net.h contains definitions that are exclusively used by
the key generator/classification API. Merge its contents with
dpkg.h in order to reduce the number of private headers.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Use BIT() macro
Ioana Radulescu [Wed, 1 Aug 2018 16:09:50 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Use BIT() macro

File net.h has several bitmask defines that could be implemented
more clearly using the BIT() macro.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Remove dead code
Ioana Radulescu [Wed, 1 Aug 2018 16:09:49 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Remove dead code

File net.h contains unused defines, so remove them.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Cleanup comments
Ioana Radulescu [Wed, 1 Aug 2018 16:09:48 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Cleanup comments

Comments in file net.h are too fancy for their own good,
so convert them to the regular format.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: add SPDX license identifiers
Ioana Ciornei [Tue, 31 Jul 2018 17:02:47 +0000 (12:02 -0500)]
staging: fsl-dpaa2/eth: add SPDX license identifiers

The DPAA2 Ethernet driver files use a GPL-2.0+ OR BSD-3-Clause
license. Add SPDX tags and delete the full license text,
keeping the existing licenses for each file.
Add a GPL-2.0 tag for the Makefile.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: convert documentation to .rst format
Ioana Ciornei [Tue, 31 Jul 2018 17:02:46 +0000 (12:02 -0500)]
staging: fsl-dpaa2/eth: convert documentation to .rst format

Convert the DPAA2 Ethernet driver documentation to .rst format
and rename the file accordingly.
Also add a SPDX tag to the new rst file.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix endianness warnings reported by sparse
Ajay Singh [Wed, 1 Aug 2018 11:11:00 +0000 (16:41 +0530)]
staging: wilc1000: fix endianness warnings reported by sparse

This patch fixes the sparse warnings by making use of le32_to_cpus() &
cpu_to_le32s() conversion API's.
Remove the unnecessary byte-order conversion in
wilc_wlan_parse_response_frame() as the data is copied using individual
byte operation.

Also added the byte-order conversion for 'header' in
wilc_wfi_monitor_rx() & wilc_wfi_p2p_rx() as received in LE byte-order.

The link [1] contains the details of discussion related to this patch.

[1]. https://patchwork.kernel.org/patch/10436791/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use 'u16' data type for config id parameter
Ajay Singh [Wed, 1 Aug 2018 11:10:59 +0000 (16:40 +0530)]
staging: wilc1000: use 'u16' data type for config id parameter

Cleanup patch to use the correct data type 'u16' for keeping the WID
value in 'wilc_cfg_word' & 'wilc_cfg_str' structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor wilc_wlan_handle_isr_ext to avoid goto statement
Ajay Singh [Wed, 1 Aug 2018 05:03:41 +0000 (10:33 +0530)]
staging: wilc1000: refactor wilc_wlan_handle_isr_ext to avoid goto statement

Refactor wilc_wlan_handle_isr_ext() to avoid the use of the goto label.
Also avoid the unnecessary NULL check for 'wilc->rx_buffer' and
calling wilc_wlan_handle_rxq() only after wilc_wlan_rxq_add() call.
The link [1] contains details for discussion related to this changes.

[1]. https://patchwork.kernel.org/patch/10533601/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename 'rcvd_ch_cnt' element in 'user_scan_req' struct
Ajay Singh [Sun, 29 Jul 2018 06:06:55 +0000 (11:36 +0530)]
staging: wilc1000: rename 'rcvd_ch_cnt' element in 'user_scan_req' struct

Cleanup patch to use shorter name for 'rcvd_ch_cnt' to 'ch_cnt' to avoid
line over 80 character issue reported by checkpatch.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: added comments for 'hif_cs' mutex lock
Ajay Singh [Sun, 29 Jul 2018 06:06:54 +0000 (11:36 +0530)]
staging: wilc1000: added comments for 'hif_cs' mutex lock

Added comments for 'hif_cs' mutex to avoid checkpatch.pl reported
issues.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: modified debug log messages description
Ajay Singh [Sun, 29 Jul 2018 06:06:53 +0000 (11:36 +0530)]
staging: wilc1000: modified debug log messages description

Cleanup patch to update the debug logs message to provide correct
information. Also added the function name tag for same description log
to help identify the place from where log was captured.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unnecessary comments and comments description
Ajay Singh [Sun, 29 Jul 2018 06:06:51 +0000 (11:36 +0530)]
staging: wilc1000: remove unnecessary comments and comments description

Cleanup patch to remove the unnecessary comments and commented code.
Also updated description for few of comments.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix TODO to compile spi and sdio components in single module
Ajay Singh [Sun, 29 Jul 2018 06:06:50 +0000 (11:36 +0530)]
staging: wilc1000: fix TODO to compile spi and sdio components in single module

Changes to compile module component along with SPI and SDIO module.
Previously 'wilc1000.ko' used to generate along with wilc-spi.ko or
wilc1000-sdio.ko module. After these changes only wilc1000-spi.ko or
wilc1000-sdio.ko modules are required for SPI and SDIO respectively.
These changes are done to address below TODO item.

- make SPI and SDIO components coexist in one build

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Add page-flip support
Steve Longerbeam [Fri, 20 Jul 2018 17:17:31 +0000 (10:17 -0700)]
staging: vboxvideo: Add page-flip support

Adds crtc page-flip support by passing the new requested framebuffer
to vbox_crtc_do_set_base().

Note there is no attempt to support vblank interrupts, it's not
not known how to do this in VBOX or if it is even possible. Since
this page-flip implementation does not try to sync the page-flip
to vertical blanking, tearing effects are possible.

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Pass a new framebuffer to vbox_crtc_do_set_base
Steve Longerbeam [Fri, 20 Jul 2018 17:17:30 +0000 (10:17 -0700)]
staging: vboxvideo: Pass a new framebuffer to vbox_crtc_do_set_base

This modifies vbox_crtc_do_set_base() to take a new framebuffer to
be activated, instead of the existing framebuffer attached to the crtc.
This change allows the function to be given the new framebuffer from
a page-flip request.

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: sysfs: fix potential null dereference
Ivan Bornyakov [Wed, 1 Aug 2018 18:37:44 +0000 (21:37 +0300)]
staging: gasket: sysfs: fix potential null dereference

Add handling of possible allocation failure.

Reported by smatch:

  drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null)

Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'iio-for-4.19c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Thu, 2 Aug 2018 06:07:54 +0000 (08:07 +0200)]
Merge tag 'iio-for-4.19c' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of IIO new device support, cleanups and features for the 4.19 cycle.

This is a somewhat sneaky late pull request given Linus has announced
a likely 1 week delay.  If it is too late I'll resend after the merge
window.  I merged in the fixes branch as those are primarily around
things queued for the merge window.

Particulary good to see the output of our Himanshu Jha, a GSOC student
who developed the bme680 driver.

New device support:
* bme680 gas sensor (with temperature, humidity and pressure)
  - new driver to support this device
* vcn4000
  - support vcnl4200 (lots of rework to allow this)
  - ids added for VCNL4010 and VCNL4020 sensors

New features:
* ad9523
  - support the various external signal options via gpios.

Cleanups and fixes
* ad_sigma_delta
  - unsigned long for a timeout.
* ad9523
  - fix a wrong return value that was indicating successful write failed
    and might lead to an infinite loop.
* si1133
  - fix an impossible test.
  - fix an uninitialsed variable by reading from the device in all paths.
* xilinx xadc
  - check for return values in clk related functions
  - limit the pcap clock frequency to supported ranges.
  - stash the irq to avoid calling platform_get_irq from the remove path.
  - ensure the irq is actually requested before we enable the hardware to
    output it.

6 years agostaging: gasket: page table: fix header file include guard symbol
Todd Poynor [Tue, 31 Jul 2018 20:24:48 +0000 (13:24 -0700)]
staging: gasket: page table: fix header file include guard symbol

The include guard symbol for gasket_page_table.h is out-of-date.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoRevert "staging: gasket: page table: hold references to device and pci_dev"
Todd Poynor [Tue, 31 Jul 2018 20:24:47 +0000 (13:24 -0700)]
Revert "staging: gasket: page table: hold references to device and pci_dev"

gasket_free_dev() is called only from driver PCI probe and remove
function. It is guaranteed that that pci_dev structure is not going
anywhere during that time; there is no need to take this additional
reference.

This reverts commit dd9d1502feea3c23d412f289aad79e1d4e86d45d.

Reported-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: core: use bool type for ns_capable result
Todd Poynor [Tue, 31 Jul 2018 20:24:46 +0000 (13:24 -0700)]
staging: gasket: core: use bool type for ns_capable result

When gasket core was converted from using capable() to use ns_capable()
instead, the type of the variable holding the result should have been
converted from int to bool.

Reported-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: apex: move driver-private defines out of apex.h
Todd Poynor [Tue, 31 Jul 2018 20:24:45 +0000 (13:24 -0700)]
staging: gasket: apex: move driver-private defines out of apex.h

apex.h is supposed to contain kernel-userspace interface definitions,
but has a number of defines that are only used by apex_driver.c or are
not used at all.  Move driver implementation defines not shared with
userspace to the driver source.  Remove unused defines.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: TODO: remove entry for multi-line alignment style
Todd Poynor [Tue, 31 Jul 2018 20:24:44 +0000 (13:24 -0700)]
staging: gasket: TODO: remove entry for multi-line alignment style

Multi-line alignment formatting issues fixed, remove the TODO entry for
this.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: interrupt: fix function param line continuation style
Todd Poynor [Tue, 31 Jul 2018 20:24:43 +0000 (13:24 -0700)]
staging: gasket: interrupt: fix function param line continuation style

Fix multi-line alignment formatting to look like:
      int ret = long_function_name(device, VARIABLE1, VARIABLE2,
                                   VARIABLE3, VARIABLE4);

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: sysfs: fix function param line continuation style
Todd Poynor [Tue, 31 Jul 2018 20:24:42 +0000 (13:24 -0700)]
staging: gasket: sysfs: fix function param line continuation style

Fix multi-line alignment formatting to look like:
      int ret = long_function_name(device, VARIABLE1, VARIABLE2,
                                   VARIABLE3, VARIABLE4);

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: page table: fix function param line continuation style
Todd Poynor [Tue, 31 Jul 2018 20:24:41 +0000 (13:24 -0700)]
staging: gasket: page table: fix function param line continuation style

Fix multi-line alignment formatting to look like:
      int ret = long_function_name(device, VARIABLE1, VARIABLE2,
                                   VARIABLE3, VARIABLE4);

Many of these TODO items were previously cleaned up during the conversion
to standard logging functions.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: ioctl: fix function param line continuation style
Todd Poynor [Tue, 31 Jul 2018 20:24:40 +0000 (13:24 -0700)]
staging: gasket: ioctl: fix function param line continuation style

Fix multi-line alignment formatting to look like:
      int ret = long_function_name(device, VARIABLE1, VARIABLE2,
                                   VARIABLE3, VARIABLE4);

Many of these TODO items were previously cleaned up during the conversion
to standard logging functions.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: core: fix function param line continuation style
Todd Poynor [Tue, 31 Jul 2018 20:24:39 +0000 (13:24 -0700)]
staging: gasket: core: fix function param line continuation style

Fix multi-line alignment formatting to look like:
      int ret = long_function_name(device, VARIABLE1, VARIABLE2,
                                   VARIABLE3, VARIABLE4);

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: TODO: remove entry for static function declarations
Todd Poynor [Tue, 31 Jul 2018 20:24:38 +0000 (13:24 -0700)]
staging: gasket: TODO: remove entry for static function declarations

The static function declarations are removed, remove the TODO file entry
for this.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: pg tbl: remove static function forward declarations
Todd Poynor [Tue, 31 Jul 2018 20:24:37 +0000 (13:24 -0700)]
staging: gasket: pg tbl: remove static function forward declarations

Remove forward declarations of static functions, move code to avoid
forward references, for kernel style.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: interrupt: remove static function forward declarations
Todd Poynor [Tue, 31 Jul 2018 20:24:36 +0000 (13:24 -0700)]
staging: gasket: interrupt: remove static function forward declarations

Remove forward declarations of static functions, move code to avoid
forward references, for kernel style.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: ioctl: remove static function forward declarations
Todd Poynor [Tue, 31 Jul 2018 20:24:35 +0000 (13:24 -0700)]
staging: gasket: ioctl: remove static function forward declarations

Remove forward declarations of static functions, move code to avoid
forward references, for kernel style.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: core: remove static function forward declarations
Todd Poynor [Tue, 31 Jul 2018 20:24:34 +0000 (13:24 -0700)]
staging: gasket: core: remove static function forward declarations

Remove forward declarations of static functions, move code to avoid
forward references, for kernel style.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoiio: light: si1133: fix uninitialized resp variable
Maxime Roussin-Bélanger [Tue, 31 Jul 2018 20:13:21 +0000 (16:13 -0400)]
iio: light: si1133: fix uninitialized resp variable

Read response register to detect any error.

Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agodrivers/staging/mt7621-eth: Use dma_zalloc_coherent to replace dma_alloc_coherent...
zhong jiang [Wed, 1 Aug 2018 14:10:15 +0000 (22:10 +0800)]
drivers/staging/mt7621-eth: Use dma_zalloc_coherent to replace dma_alloc_coherent+memset

we prefer to use dma_zalloc_coherent rather than dam_alloc_coherent+memset

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge branch 'fixes-togreg' into togreg
Jonathan Cameron [Wed, 1 Aug 2018 17:56:17 +0000 (18:56 +0100)]
Merge branch 'fixes-togreg' into togreg

6 years agostaging: comedi: drop serial2002 driver
Greg Kroah-Hartman [Wed, 1 Aug 2018 17:56:17 +0000 (19:56 +0200)]
staging: comedi: drop serial2002 driver

There's not been any work on this driver since it was originally merged,
and it really needs to be rewritten to use the serdev layer instead if
people really need/want it.

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: remove a redundant marco in xattr
Gao Xiang [Wed, 1 Aug 2018 06:38:31 +0000 (14:38 +0800)]
staging: erofs: remove a redundant marco in xattr

There is no need to '#if CONFIG_EROFS_FS_XATTR' in xattr.c,
let's remove it.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: add the missing break in z_erofs_map_blocks_iter
Gao Xiang [Wed, 1 Aug 2018 09:36:54 +0000 (17:36 +0800)]
staging: erofs: add the missing break in z_erofs_map_blocks_iter

This patch adds a missing break after adding the default case.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoiio: light: si1133 fix test for val being not zero or not one.
Colin Ian King [Mon, 30 Jul 2018 12:59:18 +0000 (13:59 +0100)]
iio: light: si1133 fix test for val being not zero or not one.

The current check on val always results in true and so the
call to sii1133_update_adcsens never gets called. Fix this check
so it returns with -EINVAL only when val is not zero and not one.

Detected by CoverityScan, CID#1472099 ("Logically dead code")

Fixes: e01e7eaf37d8 ("iio: light: introduce si1133")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging:rtl8192u: Refactor enum DM_CCK_Rx_Path_Method - Style
John Whitmore [Sun, 29 Jul 2018 21:07:47 +0000 (22:07 +0100)]
staging:rtl8192u: Refactor enum DM_CCK_Rx_Path_Method - Style

The enumerated type DM_CCK_Rx_Path_Method is used as a container for
constant definitions, rather then an enumerated type enabling compiler
type checking. To correct this, the variable which uses the constants,
defined by the enumeration, has had its type changed from a u8 to the
enumeration.

Additionally the type has been moved above the structure where the type
is used, to avoid compiler error. The typedef has been removed from the
enumerated type to clear the checkpatch issue with defining new types.
The name of the type has been changed to cck_rx_path_method to clear
the checkpatch issue with CamelCase naming. And the enumerated constant
CCK_Rx_Version_MAX has been removed, since it is never used in code.

The changes are all coding style in nature and so should have no
impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Refactor enum dm_dig_cs_ratio_e - Style
John Whitmore [Sun, 29 Jul 2018 21:07:46 +0000 (22:07 +0100)]
staging:rtl8192u: Refactor enum dm_dig_cs_ratio_e - Style

The enumerated type dm_dig_cs_ratio_e is never actually used as a type,
but only as a collection of related constants. This is because the
variables, which use the defined constant values, are defined as being
of type u8 rather then tne enumerated type. This omission negates the
possibility of taking advantage of compiler type checking.

To enable the use of compiler type checking of the enumeration the two
variables, (curcs_ratio_state & precs_ratio_state), which use the type's
constants have their types changed from u8 to enum dig_cck_cs_ratio_state.

Additionally the types declaration has been moved above the dig
structure, where the type is used. The 'typedef' keyword has been
removed from the type to clear the checkpatch issue with defining new
types. And the constant DIG_CS_MAX has been removed since this is never
used in the code.

These changes are purely coding style changes and should not impact
on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Refactor enum dm_dig_pd_th_e - Style
John Whitmore [Sun, 29 Jul 2018 21:07:45 +0000 (22:07 +0100)]
staging:rtl8192u: Refactor enum dm_dig_pd_th_e - Style

The enumerated type dm_dig_pd_th_e is never actually used as
the type for the two variables which use the constants, which the
enumeration defines. This omission removes the possibility of taking
advantage of compiler type checking.

To correct this the two member variables, (curpd_thstate & prepd_thstate)
have been changed to use the type enum dig_pkt_detection_threshold rather
then u8.

Additionally the enum's declaration has been moved above the dig
structure, where the type is used, the 'typedef' has been removed to
clear the checkpatch issue with defining new types, and the value
'DIG_PD_MAX' has been removed from the enumeration, since it is never
used in code.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Refactor dm_dig_connect_e - Style
John Whitmore [Sun, 29 Jul 2018 21:07:44 +0000 (22:07 +0100)]
staging:rtl8192u: Refactor dm_dig_connect_e - Style

The enumerated type dm_dig_connect_e is only used to group constant
values, as the actual type is never used as the type for the variables
which use the defined constants (cur_connect_state and pre_connect_state).

These two member variables have had there defined types changed to
properly reflect there usage and to permit compiler type checks to be
performed.

In addition the definition of the enumerated type has been moved above
the structure which uses the type. The typedef of the enumerated type
has been removed to clear the checkpatch issue with defining new types
and the enumerated value DIG_CONNECT_MAX has been removed since it is
never used in code.

The resulting changes are all coding style in nature and should not
impact runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove unused enum dm_dig_dbg_e - Style
John Whitmore [Sun, 29 Jul 2018 21:07:43 +0000 (22:07 +0100)]
staging:rtl8192u: Remove unused enum dm_dig_dbg_e - Style

The enumerated type dm_dig_dbg_e is never used in code so has simply
been removed from the source code.

this is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Refactor enum dm_dig_alg_e - Style
John Whitmore [Sun, 29 Jul 2018 21:07:42 +0000 (22:07 +0100)]
staging:rtl8192u: Refactor enum dm_dig_alg_e - Style

The enumerated type dm_dig_alg_e is only used by one variable in the
code, 'dig_algorithm', a member variable of the structure dig. That
member variable was defined to be of type 'u8' thus negating any
advantage of the use of an enumerated type, (compiler type-checking).

The type of the variable 'dig_algorithm' has been change to reflect
its use of the enumeration and the enumerated type moved in the file
so that it appears before it is used in the file.

Additionally the 'typedef' has been removed to clear the checkpatch
issue with defining new types, and the type renamed to
enum dig_algorithm.

The enumerated constant DIG_ALGO_MAX has been removed from the type
since it is never used in the code.

These changes are all coding style in nature and as such should have
no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove enum dm_dig_op_e - Style
John Whitmore [Sun, 29 Jul 2018 21:07:41 +0000 (22:07 +0100)]
staging:rtl8192u: Remove enum dm_dig_op_e - Style

Remove the enumerated type dm_dig_op_e. The type is only used as a
parameter to the function dm_change_dynamic_initgain_thresh(), but
that function is never referenced in the code at all.

I would consider this to be a coding style change as the function is
never referenced and as a result the enumeration is never used. In
any case there should be no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Refactor enum dm_ratr_sta_e usage - Style
John Whitmore [Sun, 29 Jul 2018 21:07:40 +0000 (22:07 +0100)]
staging:rtl8192u: Refactor enum dm_ratr_sta_e usage - Style

The enumerated type dm_ratr_sta_e was defined in the file
drivers/staging/rtl8192u/r8192U_dm.h but never actually used in that
file. The only variable which uses this enumerated type is 'ratr_state',
a member variable of the _rate_adaptive structure defined in the file
drivers/staging/rtl8192u/r8192U.h.

To clarify and place the enumerated type close to where it is used the
type was moved to the drivers/staging/rtl8192u/r8192U.h file.

In addition the member variable 'ratr_state' which uses the enumerated
constants was declared as being of type 'u8'. This negates any advantage
of the enumerated type, compiler type-checking, so that member variable's
type has been changed to being of the enumerated type.

The typedef from the enumerated type has been removed to clear the
checkpatch issue with defining new types. Additionally the name of the
type has been left as enum dynamic_ratr_state

This is a coding style change and should have no impact on runtime code
execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Refactor use of enum dm_dig_sta_e - Style
John Whitmore [Sun, 29 Jul 2018 21:07:39 +0000 (22:07 +0100)]
staging:rtl8192u: Refactor use of enum dm_dig_sta_e - Style

Refactor the use of the enumerated type dm_dig_sta_e, which is not
actually used for type checking by the compiler.

The typedef of dm_dig_sta_e is removed to clear the checkpatch issue
with defining new types, and the enumerated type is left with the name
enum dynamic_init_gain_state

The enumerated type defines values for the enumeration, which are used
by both dig_state and dig_highpwr_state, (members of the struct dig).
Both of those variables were defined as being of type u8. This negates
any usefulness of the use of the enumeration, (compiler type checking).

To make use of the compiler's type-checking the two member variables,
dig_state and dig_highpwr_state have been changed to being of type
enum dynamic_init_gain_state. The enumerated type has been moved above
the struct dig definition so that the enumeration is already defined
when the compiler reaches the two types using the enumerated type.

These changes, whilst convoluted, are purely coding style in nature and
should not impact runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove typedef of cmpk_set_cfg_t - Style
John Whitmore [Sun, 29 Jul 2018 21:07:38 +0000 (22:07 +0100)]
staging:rtl8192u: Remove typedef of cmpk_set_cfg_t - Style

Remove the typedef from cmpk_set_cfg_t, leaving the structure as
struct cmd_pkt_set_configuration. This change clears the checkpatch
issue with defining new types. The change is purely a coding
style change which should have no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove typedef of cmpk_intr_sta_t - Style
John Whitmore [Sun, 29 Jul 2018 21:07:37 +0000 (22:07 +0100)]
staging:rtl8192u: Remove typedef of cmpk_intr_sta_t - Style

Remove the typedef of struct cmpk_intr_sta_t, the name of the structure
has been left as cmd_pkt_interrupt_status. This clears the checkpatch
issue with creating new types in code. The change is purely a coding
style change and should have no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Correct spelling in comments - style
John Whitmore [Sun, 29 Jul 2018 21:07:36 +0000 (22:07 +0100)]
staging:rtl8192u: Correct spelling in comments - style

Correct the spelling of a number of comments, which cause a checkpatch
issue. This is purely a coding style change which should have no impact
on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Removed unused CMPK_RX_DBG_MSG_SIZE - Style
John Whitmore [Sun, 29 Jul 2018 21:07:35 +0000 (22:07 +0100)]
staging:rtl8192u: Removed unused CMPK_RX_DBG_MSG_SIZE - Style

Remove the unused macro definition CMPK_RX_DBG_MSG_SIZE. This is a
coding style change which should have no impact on runtime code
execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove unused CMPK_TX_SET_CONFIG_SIZE - Style
John Whitmore [Sun, 29 Jul 2018 21:07:34 +0000 (22:07 +0100)]
staging:rtl8192u: Remove unused CMPK_TX_SET_CONFIG_SIZE - Style

Remove the unused macro CMPK_TX_SET_CONFIG_SIZE. This is a coding style
change which should not impact runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove typedef of struct cmpk_txfb_t - Style
John Whitmore [Sun, 29 Jul 2018 21:07:33 +0000 (22:07 +0100)]
staging:rtl8192u: Remove typedef of struct cmpk_txfb_t - Style

Remove the typedef of the structure cmpk_txfb_t. This clears the
checkpatch issue with defining new types.

Additionally the type is renamed from cmpk_txfb_t to cmd_pkt_tx_feedback
removing the '_t' as the typedef has been removed.

These changes are purely coding style in nature and should have no
impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove unused constants - Style
John Whitmore [Sat, 28 Jul 2018 23:14:52 +0000 (00:14 +0100)]
staging:rtl8192u: Remove unused constants - Style

Remove defined constants from code, since they are never actually
used in code. This is a simple coding style change which should have
no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Rename union QOS_TSINFO - Style
John Whitmore [Sat, 28 Jul 2018 23:14:51 +0000 (00:14 +0100)]
staging:rtl8192u: Rename union QOS_TSINFO - Style

The union QOS_TSINFO, as a type, should have a lowercase name. The
union has therefore been renamed to qos_tsinfo. Additionally the
'typedef' directive has been removed to clear the checkpatch issue
with defining new types.

These are coding style changes which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Rename enum DIRECTION_VALUE - Style
John Whitmore [Sat, 28 Jul 2018 23:14:50 +0000 (00:14 +0100)]
staging:rtl8192u: Rename enum DIRECTION_VALUE - Style

The enumerated type DIRECTION_VALUE should be named in lowercase to
comply with coding standard so is renamed to direction_value. In
addition the 'typedef' directive has been removed to clear the
checkpatch issue with defining new types.

These changes are coding style changes which should have no impact on
runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove unused union ECW -Style
John Whitmore [Sat, 28 Jul 2018 23:14:49 +0000 (00:14 +0100)]
staging:rtl8192u: Remove unused union ECW -Style

The union ECW is never used in code so has simply been removed.
This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Remove unused union AC_PARAM - Style
John Whitmore [Sat, 28 Jul 2018 23:14:48 +0000 (00:14 +0100)]
staging:rtl8192u: Remove unused union AC_PARAM - Style

The union ACM_PARAM is never actually used in code so removed. This
is a coding style change which should have no impact on runtime code
execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Rename member variables - Style
John Whitmore [Sat, 28 Jul 2018 23:14:47 +0000 (00:14 +0100)]
staging:rtl8192u: Rename member variables - Style

Rename the member variables of union aci_aifsn, which should be named
in lowercase. The only member variable, of this union, which is
actually used is 'acm'.

This are coding style changes which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Rename ACI_AIFSN - Style
John Whitmore [Sat, 28 Jul 2018 23:14:46 +0000 (00:14 +0100)]
staging:rtl8192u: Rename ACI_AIFSN - Style

Rename the union ACI_AIFSN to aci_aifsn and remove the typedef directive.

The removal of the typedef clears the checkpatch issue with defining
new types. The renaming is to adhere to the coding style where types
are name in lower case.

These changes are coding style changes which should have no impact on
runtime execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8192u: Add spaces around operators - Style
John Whitmore [Sat, 28 Jul 2018 23:14:45 +0000 (00:14 +0100)]
staging:rtl8192u: Add spaces around operators - Style

Add the required spaces around '+' and '*' operators. This is a
coding style change to clear the checkpatch issue. There should be
no impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove unnecessary parentheses
Michael Straube [Sun, 29 Jul 2018 18:54:47 +0000 (20:54 +0200)]
staging: rtl8188eu: remove unnecessary parentheses

Remove unnecessary parentheses, also clears checkpatch issues about
missing spaces around '-'.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: fix comparsion to true
Michael Straube [Sun, 29 Jul 2018 18:54:46 +0000 (20:54 +0200)]
staging: rtl8188eu: fix comparsion to true

Use if(x) instead of if(x == true).

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: replace tabs with spaces
Michael Straube [Sun, 29 Jul 2018 18:54:45 +0000 (20:54 +0200)]
staging: rtl8188eu: replace tabs with spaces

Replace tabs with spaces in function definition and variable
declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove redundant includes
Michael Straube [Sun, 29 Jul 2018 18:54:44 +0000 (20:54 +0200)]
staging: rtl8188eu: remove redundant includes

Both osdep_service.h and drv_types.h are included from hal_intf.h,
so remove the redundant includes from hal_intf.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove unused should_forbid_n_rate()
Michael Straube [Sun, 29 Jul 2018 18:54:42 +0000 (20:54 +0200)]
staging: rtl8188eu: remove unused should_forbid_n_rate()

The function should_forbid_n_rate() is never used, so remove it.
Discovered by cppcheck.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove unused dump_txrpt_ccx_88e()
Michael Straube [Sun, 29 Jul 2018 18:54:41 +0000 (20:54 +0200)]
staging: rtl8188eu: remove unused dump_txrpt_ccx_88e()

The function dump_txrpt_ccx_88e() is nerver used, so remove it.
Discovered by cppcheck.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: apex: fix function param line continuation style
Todd Poynor [Sun, 29 Jul 2018 19:36:46 +0000 (12:36 -0700)]
staging: gasket: apex: fix function param line continuation style

Fix multi-line alignment formatting to look like:
      int ret = long_function_name(device, VARIABLE1, VARIABLE2,
                                   VARIABLE3, VARIABLE4);

Many of these TODO items were previously cleaned up during the conversion
to standard logging functions.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: apex: remove static function forward declarations
Todd Poynor [Sun, 29 Jul 2018 19:36:45 +0000 (12:36 -0700)]
staging: gasket: apex: remove static function forward declarations

Remove forward declarations of static functions, move code to avoid
forward references, for kernel style.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: TODO: remove entry for static function kernel docs
Todd Poynor [Sun, 29 Jul 2018 19:36:44 +0000 (12:36 -0700)]
staging: gasket: TODO: remove entry for static function kernel docs

Remove the TODO entry for simplifying kernel doc style comments for
static functions, now that this has been addressed.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: sysfs: simplify comments for static functions
Todd Poynor [Sun, 29 Jul 2018 19:36:43 +0000 (12:36 -0700)]
staging: gasket: sysfs: simplify comments for static functions

Static functions don't need kernel doc formatting, can be simplified.
Reformat comments that can be single-line.  Remove extraneous text.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: interrupt: simplify comments for static functions
Todd Poynor [Sun, 29 Jul 2018 19:36:42 +0000 (12:36 -0700)]
staging: gasket: interrupt: simplify comments for static functions

Static functions don't need kernel doc formatting, can be simplified.
Reformat comments that can be single-line.  Remove extraneous text.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: page table: simplify comments for static functions
Todd Poynor [Sun, 29 Jul 2018 19:36:41 +0000 (12:36 -0700)]
staging: gasket: page table: simplify comments for static functions

Static functions don't need kernel doc formatting, can be simplified.
Reformat comments that can be single-line.  Remove extraneous text.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: ioctl: simplify comments for static functions
Todd Poynor [Sun, 29 Jul 2018 19:36:40 +0000 (12:36 -0700)]
staging: gasket: ioctl: simplify comments for static functions

Static functions don't need kernel doc formatting, can be simplified.
Reformat comments that can be single-line.  Remove extraneous text.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: core: simplify comments for static functions
Todd Poynor [Sun, 29 Jul 2018 19:36:39 +0000 (12:36 -0700)]
staging: gasket: core: simplify comments for static functions

Static functions don't need kernel doc formatting, can be simplified.
Reformat comments that can be single-line.  Remove extraneous text.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: apex: simplify comments for static functions
Todd Poynor [Sun, 29 Jul 2018 19:36:38 +0000 (12:36 -0700)]
staging: gasket: apex: simplify comments for static functions

Static functions don't need kernel doc formatting, can be simplified.
Reformat comments that can be single-line.  Remove extraneous text.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: core: allow root access based on user namespace
Todd Poynor [Sun, 29 Jul 2018 19:36:37 +0000 (12:36 -0700)]
staging: gasket: core: allow root access based on user namespace

Use user namespace to determine whether gasket device file opener is
root, allowing root access to containers, if necessary.

Reported-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: page table: hold references to device and pci_dev
Todd Poynor [Sun, 29 Jul 2018 19:36:36 +0000 (12:36 -0700)]
staging: gasket: page table: hold references to device and pci_dev

Hold references to the struct device and the pci_dev for the page table
while the data structures contian pointers to these.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: sysfs: hold reference to device while in use
Todd Poynor [Sun, 29 Jul 2018 19:36:35 +0000 (12:36 -0700)]
staging: gasket: sysfs: hold reference to device while in use

Hold a reference to the struct device while a gasket sysfs mapping
exists for the device and a pointer to the struct is kept in the mapping
data structures.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: core: hold reference to pci_dev while used
Todd Poynor [Sun, 29 Jul 2018 19:36:34 +0000 (12:36 -0700)]
staging: gasket: core: hold reference to pci_dev while used

Hold a reference on the struct pci_dev while a pointer to it is held in
the gasket data structures.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoRevert "staging:r8188eu: Use lib80211 to encrypt (TKIP) tx frames"
Greg Kroah-Hartman [Mon, 30 Jul 2018 08:46:03 +0000 (10:46 +0200)]
Revert "staging:r8188eu: Use lib80211 to encrypt (TKIP) tx frames"

This reverts commit 0d4876f4e977798238db594321db9184704fcf5d as it
breaks the build once 4.18-rc7 was merged into the staging-next tree.

Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge 4.18-rc7 into staging-next
Greg Kroah-Hartman [Mon, 30 Jul 2018 08:13:15 +0000 (10:13 +0200)]
Merge 4.18-rc7 into staging-next

We want the staging changes in here for testing and merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: use the wrapped PTR_ERR_OR_ZERO instead of open code
Gao Xiang [Mon, 30 Jul 2018 01:51:01 +0000 (09:51 +0800)]
staging: erofs: use the wrapped PTR_ERR_OR_ZERO instead of open code

Just clean up and logic doesn't change.

Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050766.html
Fixes: d72d1ce60174 ("staging: erofs: add namei functions")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoLinux 4.18-rc7
Linus Torvalds [Sun, 29 Jul 2018 21:44:52 +0000 (14:44 -0700)]
Linux 4.18-rc7

6 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 29 Jul 2018 20:13:45 +0000 (13:13 -0700)]
Merge tag 'ext4_for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Some miscellaneous ext4 fixes for 4.18; one fix is for a regression
  introduced in 4.18-rc4.

  Sorry for the late-breaking pull. I was originally going to wait for
  the next merge window, but Eric Whitney found a regression introduced
  in 4.18-rc4, so I decided to push out the regression plus the other
  fixes now. (The other commits have been baking in linux-next since
  early July)"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix check to prevent initializing reserved inodes
  ext4: check for allocation block validity with block group locked
  ext4: fix inline data updates with checksums enabled
  ext4: clear mmp sequence number when remounting read-only
  ext4: fix false negatives *and* false positives in ext4_check_descriptors()

6 years agosquashfs: be more careful about metadata corruption
Linus Torvalds [Sun, 29 Jul 2018 19:44:46 +0000 (12:44 -0700)]
squashfs: be more careful about metadata corruption

Anatoly Trosinenko reports that a corrupted squashfs image can cause a
kernel oops.  It turns out that squashfs can end up being confused about
negative fragment lengths.

The regular squashfs_read_data() does check for negative lengths, but
squashfs_read_metadata() did not, and the fragment size code just
blindly trusted the on-disk value.  Fix both the fragment parsing and
the metadata reading code.

Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Phillip Lougher <phillip@squashfs.org.uk>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6 years agoext4: fix check to prevent initializing reserved inodes
Theodore Ts'o [Sat, 28 Jul 2018 12:12:04 +0000 (08:12 -0400)]
ext4: fix check to prevent initializing reserved inodes

Commit 8844618d8aa7: "ext4: only look at the bg_flags field if it is
valid" will complain if block group zero does not have the
EXT4_BG_INODE_ZEROED flag set.  Unfortunately, this is not correct,
since a freshly created file system has this flag cleared.  It gets
almost immediately after the file system is mounted read-write --- but
the following somewhat unlikely sequence will end up triggering a
false positive report of a corrupted file system:

   mkfs.ext4 /dev/vdc
   mount -o ro /dev/vdc /vdc
   mount -o remount,rw /dev/vdc

Instead, when initializing the inode table for block group zero, test
to make sure that itable_unused count is not too large, since that is
the case that will result in some or all of the reserved inodes
getting cleared.

This fixes the failures reported by Eric Whiteney when running
generic/230 and generic/231 in the the nojournal test case.

Fixes: 8844618d8aa7 ("ext4: only look at the bg_flags field if it is valid")
Reported-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agostaging: fix platform_no_drv_owner.cocci warnings
kbuild test robot [Sun, 29 Jul 2018 11:19:26 +0000 (19:19 +0800)]
staging: fix platform_no_drv_owner.cocci warnings

drivers/staging/axis-fifo/axis-fifo.c:1081:3-8: 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

Fixes: 4a965c5f89de ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core")
CC: Jacob Feder <jacobsfeder@gmail.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoiio: adc: xilinx: Move request_irq before enabling interrupts
Manish Narani [Mon, 23 Jul 2018 15:02:03 +0000 (20:32 +0530)]
iio: adc: xilinx: Move request_irq before enabling interrupts

Enabling the Interrupts before registering the irq handler is a bad
idea. This patch corrects the same for XADC driver.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: xilinx: Remove platform_get_irq from xadc_remove function
Manish Narani [Mon, 23 Jul 2018 15:02:02 +0000 (20:32 +0530)]
iio: adc: xilinx: Remove platform_get_irq from xadc_remove function

This patch avoids getting irq number in xadc_remove function. Instead
store 'irq' in xadc struct and use xadc->irq wherever needed.
This patch also resolves a warning reported by coverity where it asks to
check return value of platform_get_irq() for any errors in xadc_remove.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: xilinx: limit pcap clock frequency value
Manish Narani [Mon, 23 Jul 2018 15:02:01 +0000 (20:32 +0530)]
iio: adc: xilinx: limit pcap clock frequency value

This patch limits the xadc pcap clock frequency value to be less than
200MHz. This fixes the issue when zynq is booted at higher frequency
values, pcap crosses the maximum limit of 200MHz(Fmax) as it is derived
from IOPLL.
If this limit is crossed it is required to alter the WEDGE and REDGE
bits of XADC_CFG register to make timings better in the interface. So to
avoid alteration of these bits every time, the pcap value should not
cross the Fmax limit.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: xilinx: Check for return values in clk related functions
Manish Narani [Mon, 23 Jul 2018 15:02:00 +0000 (20:32 +0530)]
iio: adc: xilinx: Check for return values in clk related functions

This patch adds check for return values from clock related functions.
This was reported by static code analysis tool.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: vcnl4000: add support for VCNL4200
Tomas Novotny [Wed, 25 Jul 2018 15:18:21 +0000 (17:18 +0200)]
iio: vcnl4000: add support for VCNL4200

VCNL4200 is an integrated long distance (up to 1500mm) proximity and
ambient light sensor.

The support is very basic. There is no configuration of proximity and
ambient light sensing yet. Only the reading of both measured values is
done.

The reading of ambient light and proximity values is blocking. If you
request a new value too early, the driver waits for new value to be
ready.

Signed-off-by: Tomas Novotny <tomas@novotny.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: vcnl4000: warn on incorrectly specified device id
Tomas Novotny [Wed, 25 Jul 2018 15:18:20 +0000 (17:18 +0200)]
iio: vcnl4000: warn on incorrectly specified device id

We can detect incorrectly specified device id for some chips, so warn
user in that case.

Signed-off-by: Tomas Novotny <tomas@novotny.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: vcnl4000: add VCNL4010 and VCNL4020 device id
Tomas Novotny [Wed, 25 Jul 2018 15:18:19 +0000 (17:18 +0200)]
iio: vcnl4000: add VCNL4010 and VCNL4020 device id

The driver already supports VCNL4010/20 devices. The currently supported
features and detectable product id are the same, so add shared id for
them.

This is a groundwork to extend the driver by detecting incorrectly
specified device id.

Signed-off-by: Tomas Novotny <tomas@novotny.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: rtl8188eu: remove unused rtw_calculate_wlan_pkt_size_by_attribue()
Michael Straube [Sat, 28 Jul 2018 14:29:17 +0000 (16:29 +0200)]
staging: rtl8188eu: remove unused rtw_calculate_wlan_pkt_size_by_attribue()

The function rtw_calculate_wlan_pkt_size_by_attribue() also defined as
rtw_wlan_pkt_size() is never used, so remove it. Discovered by cppcheck.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: replace tabs with spaces
Michael Straube [Sat, 28 Jul 2018 14:29:16 +0000 (16:29 +0200)]
staging: rtl8188eu: replace tabs with spaces

Replace tabs with spaces, clears a checkpatch 'line over 80 characters'
warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>