]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/log
mirror_ubuntu-focal-kernel.git
5 years agostaging: kpc2000: add space between ) and { in cell_probe.c
Simon Sandström [Wed, 22 May 2019 20:58:45 +0000 (22:58 +0200)]
staging: kpc2000: add space between ) and { in cell_probe.c

Fixes checkpatch.pl error "space required before the open brace '{'".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: fix indent in cell_probe.c
Simon Sandström [Wed, 22 May 2019 20:58:44 +0000 (22:58 +0200)]
staging: kpc2000: fix indent in cell_probe.c

Use tabs instead of spaces for indentation.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: rtw_recv: fix warning Comparison to NULL
Hariprasad Kelam [Thu, 23 May 2019 02:50:59 +0000 (08:20 +0530)]
staging: rtl8723bs: core: rtw_recv: fix warning Comparison to NULL

fix below warning reported by checkpatch

CHECK: Comparison to NULL could be written
"!precvpriv->pallocated_frame_buf"
CHECK: Comparison to NULL could be written "padapter"

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
-----
changes in v2:
Corected few erorrs like (!*psta == NULL) pointed in
review

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: fix platform_no_drv_owner.cocci warnings
kbuild test robot [Wed, 22 May 2019 19:58:15 +0000 (03:58 +0800)]
staging: kpc2000: kpc_i2c: fix platform_no_drv_owner.cocci warnings

drivers/staging/kpc2000/kpc2000_i2c.c:652: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: 43ad38191816 ("staging: kpc2000: kpc_i2c: add static qual to local symbols in kpc_i2c.c")
CC: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: unisys: visornic: Replace GFP_ATOMIC with GFP_KERNEL
Hariprasad Kelam [Wed, 22 May 2019 17:05:30 +0000 (22:35 +0530)]
staging: unisys: visornic: Replace GFP_ATOMIC with GFP_KERNEL

As per below information

GFP_KERNEL  FLAG

This is a normal allocation and might block. This is the flag to use in
process context code when it is safe to sleep.

GFP_ATOMIC FLAG

The allocation is high-priority and does not sleep. This is the flag to
use in interrupt handlers, bottom halves and other situations where you
cannot sleep

And we can take advantage of GFP_KERNEL , as when system is in low
memory chances of getting success is high compared to GFP_ATOMIC.

As visornic_probe is in  process context we can use GPF_KERNEL.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: add static qual to local symbols in kpc_i2c.c
Geordan Neukum [Wed, 22 May 2019 12:14:02 +0000 (12:14 +0000)]
staging: kpc2000: kpc_i2c: add static qual to local symbols in kpc_i2c.c

kpc_i2c.c declares:
  - two functions
    - pi2c_probe()
    - pi2c_remove()
  - one struct
    - i2c_plat_driver_i
which are local to the file, yet missing the static qualifier. Add the
static qualifier to these symbols.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: Remove unnecessary function tracing prints
Geordan Neukum [Wed, 22 May 2019 12:14:01 +0000 (12:14 +0000)]
staging: kpc2000: kpc_i2c: Remove unnecessary function tracing prints

Many of the functions in kpc_i2c log debug-level messages to the
kernel log message buffer upon invocation. This is unnecessary, as
debugging tools like kgdb, kdb, etc. or the tracing tool ftrace
should be able to provide this same information. Therefore, remove
these print statements.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: use <linux/io.h> instead of <asm/io.h>
Geordan Neukum [Wed, 22 May 2019 12:14:00 +0000 (12:14 +0000)]
staging: kpc2000: kpc_i2c: use <linux/io.h> instead of <asm/io.h>

Rather than include asm/io.h, include linux/io.h. Issue reported
by the script checkpatch.pl.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: newline fixups to meet linux style guide
Geordan Neukum [Wed, 22 May 2019 12:13:59 +0000 (12:13 +0000)]
staging: kpc2000: kpc_i2c: newline fixups to meet linux style guide

The linux coding style document states:

  1) That braces should not be used where a single single statement
     will do. Therefore all instances of single block statements
     wrapped in braces that do not meet the qualifications of any
     of the exceptions to the rule should be fixed up.

  2) That the declaration of variables local to a given function
     should be immediately followed by a blank newline. Therefore,
     the single instance of this in kpc2000_i2c.c should be fixed
     up.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: remove unused module param disable_features
Geordan Neukum [Wed, 22 May 2019 12:13:58 +0000 (12:13 +0000)]
staging: kpc2000: kpc_i2c: remove unused module param disable_features

The module parameter 'disable_features' is currently unused. Therefore,
it should be removed.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8192u: Remove an unnecessary NULL check
Nathan Chancellor [Tue, 21 May 2019 17:42:21 +0000 (10:42 -0700)]
staging: rtl8192u: Remove an unnecessary NULL check

Clang warns:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2663:47: warning:
address of array 'param->u.wpa_ie.data' will always evaluate to 'true'
[-Wpointer-bool-conversion]
            (param->u.wpa_ie.len && !param->u.wpa_ie.data))
                                    ~~~~~~~~~~~~~~~~~^~~~

This was exposed by commit deabe03523a7 ("Staging: rtl8192u: ieee80211:
Use !x in place of NULL comparisons") because we disable the warning
that would have pointed out the comparison against NULL is also false:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2663:46: warning:
comparison of array 'param->u.wpa_ie.data' equal to a null pointer is
always false [-Wtautological-pointer-compare]
            (param->u.wpa_ie.len && param->u.wpa_ie.data == NULL))
                                    ~~~~~~~~~~~~~~~~^~~~    ~~~~

Remove it so clang no longer warns.

Link: https://github.com/ClangBuiltLinux/linux/issues/487
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: removed superfluous NULL checks from device attribute call-backs.
Jeremy Sowden [Tue, 21 May 2019 10:35:24 +0000 (11:35 +0100)]
staging: kpc2000: removed superfluous NULL checks from device attribute call-backs.

All the attribute show call-backs check whether pcard is NULL.  However,
pci_set_drvdata(pdev, pcard) is called before the sysfs files are
created during probe, and pci_set_drvdata(pdev, NULL) is not called
until after they are destroyed during remove; therefore, pcard will not
be NULL, and we can drop the checks.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: simplified kp2000_device retrieval in device attribute call-backs.
Jeremy Sowden [Tue, 21 May 2019 10:35:23 +0000 (11:35 +0100)]
staging: kpc2000: simplified kp2000_device retrieval in device attribute call-backs.

All the call-backs used the same formula to retrieve the pcard from dev:

  struct pci_dev *pdev = to_pci_dev(dev);
  struct kp2000_device *pcard;

  if (!pdev)
    return NULL;

  pcard = pci_get_drvdata(pdev);

Since to_pci_dev is a wrapper for container_of, it will not return NULL,
and since pci_get_drvdata just calls dev_get_drvdata on the dev member
of pdev, this is equivalent to:

  struct kp2000_device *pcard = dev_get_drvdata(&(container_of(dev, struct pci_dev, dev)->dev));

and we can simplify it to:

  struct kp2000_device *pcard = dev_get_drvdata(dev);

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: use IDA to assign card numbers.
Jeremy Sowden [Tue, 21 May 2019 10:35:22 +0000 (11:35 +0100)]
staging: kpc2000: use IDA to assign card numbers.

Previously the next card number was assigned from a static int local
variable.  Replaced it with an IDA.  Avoids the assignment of ever-
increasing card-numbers by allowing them to be reused.

Updated TODO.

Corrected format-specifier for unsigned pcard->card_num.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: added separate show functions for readable kp device attributes...
Jeremy Sowden [Tue, 21 May 2019 10:35:21 +0000 (11:35 +0100)]
staging: kpc2000: added separate show functions for readable kp device attributes, defined them as read-only, and declared them static.

Defined separate simple show functions for each attribute instead of
having a one big one containing a chain of conditionals.

Replaced calls to scnprintf with sprintf since all the outputs are
single integers.

All the readable device attributes are read-only, so used DEVICE_ATTR_RO
to define them.

The definitions are only used to populate the kp_attr_list attribute
array, so declared them as static.

Fixes the following sparse warnings:

  drivers/staging/kpc2000/kpc2000/core.c:152:1: warning: symbol 'dev_attr_ssid' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:153:1: warning: symbol 'dev_attr_ddna' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:154:1: warning: symbol 'dev_attr_card_id' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:155:1: warning: symbol 'dev_attr_hw_rev' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:156:1: warning: symbol 'dev_attr_build' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:157:1: warning: symbol 'dev_attr_build_date' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:158:1: warning: symbol 'dev_attr_build_time' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:159:1: warning: symbol 'dev_attr_cpld_reg' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/core.c:161:1: warning: symbol 'dev_attr_cpld_reconfigure' was not declared. Should it be static?

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: added a helper to get struct kp2000_device from struct device.
Jeremy Sowden [Tue, 21 May 2019 10:35:20 +0000 (11:35 +0100)]
staging: kpc2000: added a helper to get struct kp2000_device from struct device.

The attribute call-backs all use the same formula to get the pcard from
dev:

  struct pci_dev *pdev = to_pci_dev(dev);
  struct kp2000_device *pcard;

  if (!pdev)
    return -ENXIO;
  pcard = pci_get_drvdata(pdev);
  if (!pcard)
    return -ENXIO;

Added a function to reduce the duplicated code.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: improved formatting of core.c.
Jeremy Sowden [Tue, 21 May 2019 10:35:19 +0000 (11:35 +0100)]
staging: kpc2000: improved formatting of core.c.

  * Indented with tabs.
  * Broke lines over 80 columns where possible.
  * Removed braces from one-statement blocks.
  * Tidied up some comments.
  * Removed multiple blank lines.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Fix Coverity warning in rtw_dbg_port()
Hans de Goede [Tue, 21 May 2019 19:54:12 +0000 (21:54 +0200)]
staging: rtl8723bs: Fix Coverity warning in rtw_dbg_port()

Fix the following Coverity warning:

File: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c in function
rtw_dbg_port():

CID 18480: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
dead_error_condition: The condition (extra_arg & 7U) > 7U cannot be true.

        if ((extra_arg & 0x07) > 0x07)
                padapter->driver_ampdu_spacing = 0xFF;
        else
                padapter->driver_ampdu_spacing = extra_arg;

Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: remove redundant masking of pkt_offset
Colin Ian King [Tue, 21 May 2019 13:17:06 +0000 (14:17 +0100)]
staging: wilc1000: remove redundant masking of pkt_offset

The masking update of pkg_offset is redundant as the updated
value is never read and pkg_offset is re-assigned on the next
iteration of the loop.  Clean this up by removing the redundant
assignment.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fieldbus: arcx-anybus: change custom -> mmio regmap
Sven Van Asbroeck [Tue, 21 May 2019 18:29:32 +0000 (14:29 -0400)]
staging: fieldbus: arcx-anybus: change custom -> mmio regmap

The arcx-anybus's registers are accessed via a memory-mapped
IO region. A regmap associated with this region is created
using custom reg_read() / reg_write() callbacks.

However, an abstraction which creates a memory-mapped IO
region backed regmap already exists: devm_regmap_init_mmio().

Replace the custom regmap with the existing kernel abstraction.
As a pleasant side-effect, sparse warnings now disappear.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8188eu: core: Use !x in place of NULL comparisons
Puranjay Mohan [Tue, 21 May 2019 14:32:25 +0000 (20:02 +0530)]
Staging: rtl8188eu: core: Use !x in place of NULL comparisons

Change (x == NULL) to !x and (x != NULL) to x, to fix
following checkpatch.pl warnings:
CHECK: Comparison to NULL could be written "!x".

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8188eu: os_dep: Replace comparison with zero to !x
Puranjay Mohan [Tue, 21 May 2019 14:16:42 +0000 (19:46 +0530)]
Staging: rtl8188eu: os_dep: Replace comparison with zero to !x

Change comparison to zero to !x.
Replace (x == 0) to !x.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Replace function names in strings with "%s", __func__
Puranjay Mohan [Tue, 21 May 2019 14:07:11 +0000 (19:37 +0530)]
Staging: rtl8192u: ieee80211: Replace function names in strings with "%s", __func__

Use "%s", __func__ in place of strings which contain function names.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8723bs: os_dep: Remove functions that don't do anything.
Puranjay Mohan [Tue, 21 May 2019 13:30:12 +0000 (19:00 +0530)]
Staging: rtl8723bs: os_dep: Remove functions that don't do anything.

Remove functions which just print the name of function and return 0,
These functions fake the network core to say that they support these
options.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: removed two kpc_uio_class device attributes.
Jeremy Sowden [Tue, 21 May 2019 07:56:29 +0000 (08:56 +0100)]
staging: kpc2000: removed two kpc_uio_class device attributes.

The show functions of two attributes output nothing and they are unused.
Removed them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Reported-by: Matt Sickler <matt.sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: added separate show functions for kpc_uio_class device attributes...
Jeremy Sowden [Tue, 21 May 2019 07:56:28 +0000 (08:56 +0100)]
staging: kpc2000: added separate show functions for kpc_uio_class device attributes, defined them as read-only and declared them static.

Defined separate simple show functions for each attribute instead of
having a one big one containing a chain of conditionals.

Replaced scnprintf calls with sprintf since all the outputs are short
bounded strings or single integers.

All of the device attributes are read-only, so used DEVICE_ATTR_RO to
define them.

The definitions are only used to populate the kpc_uio_class_attrs
attribute array, so declared them as static.

Fixes the following sparse warnings:

  drivers/staging/kpc2000/kpc2000/cell_probe.c:220:1: warning: symbol 'dev_attr_offset' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:221:1: warning: symbol 'dev_attr_size' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:222:1: warning: symbol 'dev_attr_type' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:223:1: warning: symbol 'dev_attr_s2c_dma' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:224:1: warning: symbol 'dev_attr_c2s_dma' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:225:1: warning: symbol 'dev_attr_irq_count' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:226:1: warning: symbol 'dev_attr_irq_base_num' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:227:1: warning: symbol 'dev_attr_core_num' was not declared. Should it be static?

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: hal: Remove unused variable
Nishka Dasgupta [Tue, 21 May 2019 06:40:35 +0000 (12:10 +0530)]
staging: rtl8723bs: hal: Remove unused variable

Remove local variable psdio which is declared but not used (or returned)
in its function.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: manage error path during device initialization
Quentin Deslandes [Mon, 20 May 2019 16:39:05 +0000 (16:39 +0000)]
staging: vt6656: manage error path during device initialization

Check for error during device initialization callback and return a
meaningful error code or zero on success.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: clean-up registers initialization error path
Quentin Deslandes [Mon, 20 May 2019 16:39:04 +0000 (16:39 +0000)]
staging: vt6656: clean-up registers initialization error path

Avoid discarding function's return code during register initialization.
Handle it instead and return 0 on success or a negative errno value on
error.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: use meaningful error code during buffer allocation
Quentin Deslandes [Mon, 20 May 2019 16:39:04 +0000 (16:39 +0000)]
staging: vt6656: use meaningful error code during buffer allocation

Check on called function's returned value for error and return 0 on
success or a negative errno value on error instead of a boolean value.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: clean error path for firmware management
Quentin Deslandes [Mon, 20 May 2019 16:39:03 +0000 (16:39 +0000)]
staging: vt6656: clean error path for firmware management

Avoid discarding return value of functions called during firmware
management process. Handle such return value and return 0 on success or
a negative errno value on error.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: avoid discarding called function's return code
Quentin Deslandes [Mon, 20 May 2019 16:39:02 +0000 (16:39 +0000)]
staging: vt6656: avoid discarding called function's return code

Change some of the driver's functions in order to handle error codes
instead of discarding them. These function now returns 0 on success and
a negative errno value on error.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: clean function's error path in usbpipe.c
Quentin Deslandes [Mon, 20 May 2019 16:39:01 +0000 (16:39 +0000)]
staging: vt6656: clean function's error path in usbpipe.c

Avoid discarding called function's returned value. Store it instead in
order to act accordingly.

Update error path to return 0 on success and a negative errno value on
error.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: fix potential NULL pointer dereference
Quentin Deslandes [Mon, 20 May 2019 16:39:01 +0000 (16:39 +0000)]
staging: vt6656: fix potential NULL pointer dereference

vnt_free_tx_bufs() relies on priv->tx_context elements to be NULL if
they are not initialized (as vnt_free_rx_bufs() does). Add a check to
these elements in order to avoid NULL pointer dereference.

Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Fix if-else coding style issue
Puranjay Mohan [Mon, 20 May 2019 18:20:59 +0000 (23:50 +0530)]
Staging: rtl8192u: ieee80211: Fix if-else coding style issue

Fix following checkpatch.pl warning by adding braces around if
statement:
CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8188eu: core: Remove else after break
Puranjay Mohan [Mon, 20 May 2019 17:58:51 +0000 (23:28 +0530)]
Staging: rtl8188eu: core: Remove else after break

Remove else after break statements to fix following checkpatch.pl
warnings:
WARNING: else is not generally useful after a break or return.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: pi433: fix misspelling of packet
Yannick Loeck [Mon, 20 May 2019 15:28:52 +0000 (17:28 +0200)]
staging: pi433: fix misspelling of packet

Fixes the misspelling of packet in
<MASK_PACKETCONFIG1_PAKET_FORMAT_VARIABLE>

Signed-off-by: Yannick Loeck <yannick.loeck@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove SetBackEndControl() function
Greg Kroah-Hartman [Mon, 20 May 2019 08:47:16 +0000 (10:47 +0200)]
staging: kpc2000: remove SetBackEndControl() function

As this is only called twice, just call writel() like a normal driver
should :)

At the same time, clean up the formatting for the irq handler, as there
is no need to have that be incorrect, it just hurts the eyes...

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: dma_common_defs.h: remove unused inline functions
Greg Kroah-Hartman [Mon, 20 May 2019 08:47:15 +0000 (10:47 +0200)]
staging: kpc2000: dma_common_defs.h: remove unused inline functions

The functions GetBackEndStatus() and BackEndControlSetClear() are never
used by any code, so just remove them.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: move the i2c driver out of its subdirectory
Greg Kroah-Hartman [Mon, 20 May 2019 08:47:14 +0000 (10:47 +0200)]
staging: kpc2000: move the i2c driver out of its subdirectory

There is no need for a subdirectory for just a single .c file.  So move
it out of kpc_i2c/ and rename it to the module name that we want the
file to build to, saving one more linking stage.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: move the spi driver out of its subdirectory
Greg Kroah-Hartman [Mon, 20 May 2019 08:47:13 +0000 (10:47 +0200)]
staging: kpc2000: move the spi driver out of its subdirectory

There is no need for a subdirectory for just a single .c file.  So move
it out of kpc_spi/ and rename it to the module name that we want the
file to build to, saving one more linking stage.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove spi_parts.h
Greg Kroah-Hartman [Mon, 20 May 2019 08:47:12 +0000 (10:47 +0200)]
staging: kpc2000: remove spi_parts.h

The structures defined in spi_parts.h belong in the .c file that uses
it.  So move it directly into spi_driver.c to make things simpler to
manage.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: fix coding style in pcie.h
Greg Kroah-Hartman [Mon, 20 May 2019 08:47:11 +0000 (10:47 +0200)]
staging: kpc2000: fix coding style in pcie.h

Use tabs in pcie.h, like is mandated.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove fileops.c file.
Greg Kroah-Hartman [Mon, 20 May 2019 08:47:10 +0000 (10:47 +0200)]
staging: kpc2000: remove fileops.c file.

The fileops.c file does not need to be stand-alone, so move it into the
core.c file.  This lets us make some functions static, reducing the
global namespace of the driver.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: mt7621-dma: Remove braces around single if statement
Puranjay Mohan [Sun, 19 May 2019 17:00:32 +0000 (22:30 +0530)]
Staging: mt7621-dma: Remove braces around single if statement

Fix following checkpatch.pl warning by removing unnecessary braces:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt665*: use help instead of ---help--- in Kconfig
Moses Christopher [Sat, 18 May 2019 06:33:41 +0000 (12:03 +0530)]
staging: vt665*: use help instead of ---help--- in Kconfig

  - Resolve the following warning from the Kconfig,
    "WARNING: prefer 'help' over '---help---' for new help texts"

Signed-off-by: Moses Christopher <moseschristopherb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: use help instead of ---help--- in Kconfig
Moses Christopher [Sat, 18 May 2019 06:33:40 +0000 (12:03 +0530)]
staging: rtl8723bs: use help instead of ---help--- in Kconfig

  - Resolve the following warning from the Kconfig,
    "WARNING: prefer 'help' over '---help---' for new help texts"

Signed-off-by: Moses Christopher <moseschristopherb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: use help instead of ---help--- in Kconfig
Moses Christopher [Sat, 18 May 2019 06:33:39 +0000 (12:03 +0530)]
staging: rtl8188eu: use help instead of ---help--- in Kconfig

  - Resolve the following warning from the Kconfig,
    "WARNING: prefer 'help' over '---help---' for new help texts"

Signed-off-by: Moses Christopher <moseschristopherb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: unisys: use help instead of ---help--- in Kconfig
Moses Christopher [Sat, 18 May 2019 06:33:38 +0000 (12:03 +0530)]
staging: unisys: use help instead of ---help--- in Kconfig

  - Resolve the following warning from the Kconfig,
    "WARNING: prefer 'help' over '---help---' for new help texts"

Signed-off-by: Moses Christopher <moseschristopherb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: most: use help instead of ---help--- in Kconfig
Moses Christopher [Sat, 18 May 2019 06:33:37 +0000 (12:03 +0530)]
staging: most: use help instead of ---help--- in Kconfig

  - Resolve the following warning from the Kconfig,
    "WARNING: prefer 'help' over '---help---' for new help texts

Signed-off-by: Moses Christopher <moseschristopherb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2: use help instead of ---help--- in Kconfig
Moses Christopher [Sat, 18 May 2019 06:33:36 +0000 (12:03 +0530)]
staging: fsl-dpaa2: use help instead of ---help--- in Kconfig

  - Resolve the following warning from the Kconfig,
    "WARNING: prefer 'help' over '---help---' for new help texts"

Signed-off-by: Moses Christopher <moseschristopherb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: fixup block comment style in i2c_driver.c
Geordan Neukum [Sat, 18 May 2019 02:30:00 +0000 (02:30 +0000)]
staging: kpc2000: kpc_i2c: fixup block comment style in i2c_driver.c

Throughout i2c_driver.c, there are numerous deviations from the two
standards of:
- placing a '*' at the beginning of every line containing a
  block comment.
- placing the closing comment marker '*/' on a new line.

Instead, use a block comment style that is more consistent with the
prescribed guidelines.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: use %s with __func__ identifier in log messages
Geordan Neukum [Sat, 18 May 2019 02:29:59 +0000 (02:29 +0000)]
staging: kpc2000: kpc_i2c: use %s with __func__ identifier in log messages

Throughout i2c_driver.c, there are instances where the log strings
contain the function's name hardcoded into the string. Instead, use the
printk conversion specifier '%s' with the __func__ preprocessor
identifier to more maintainably print the function's name.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: prevent memory leak in probe() error case
Geordan Neukum [Sat, 18 May 2019 02:29:58 +0000 (02:29 +0000)]
staging: kpc2000: kpc_i2c: prevent memory leak in probe() error case

The probe() function performs a kzalloc to dynamically allocate memory
at runtime. If the allocation succeeds, yet invoking the function
i2c_add_adapter fails, the dynamically allocated memory is never freed.
Change the allocation to use the managed allocation API instead and
remove the manual freeing of the memory in the remove() function.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: reformat copyright for better readability
Geordan Neukum [Sat, 18 May 2019 02:29:57 +0000 (02:29 +0000)]
staging: kpc2000: kpc_i2c: reformat copyright for better readability

The copyright header in i2c_driver.c is difficult to read and not
chronologically ordered. Reformat and reorganize the copyright header
to be similar to other drivers in the i2c subsystem.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: reindent i2c_driver.c
Geordan Neukum [Sat, 18 May 2019 02:29:56 +0000 (02:29 +0000)]
staging: kpc2000: kpc_i2c: reindent i2c_driver.c

i2c_driver.c uses a mixture of space and tab indentations which
conflicts with the kernel coding style guide. Reindent i2c_driver.c.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove lock_card/unlock_card functions
Greg Kroah-Hartman [Fri, 17 May 2019 08:49:39 +0000 (10:49 +0200)]
staging: kpc2000: remove lock_card/unlock_card functions

We do not need an inline function to "hide" the lock, so just replace
the few calls to these functions with the "real" mutex_lock/unlock()
calls.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove kp200_module.c file
Greg Kroah-Hartman [Fri, 17 May 2019 08:49:37 +0000 (10:49 +0200)]
staging: kpc2000: remove kp200_module.c file

The kp200_module.c does not need to be stand-alone, so move it into the
core.c file.  This lets us make some functions static, reducing the
global namespace of the driver.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: fix coding style in uapi.h
Greg Kroah-Hartman [Fri, 17 May 2019 08:49:35 +0000 (10:49 +0200)]
staging: kpc2000: fix coding style in uapi.h

Use tabs in uapi.h, like is mandated.

Cc: Matt Sickler <Matt.Sickler@daktronics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fieldbus: solve warning incorrect type dev_core.c
Oscar Gomez Fuente [Fri, 17 May 2019 17:49:56 +0000 (19:49 +0200)]
staging: fieldbus: solve warning incorrect type dev_core.c

These changes solve a warning realated to an incorrect type inilizer in the function
fieldbus_poll.

Signed-off-by: Oscar Gomez Fuente <oscargomezf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Use !x in place of NULL comparisons
Puranjay Mohan [Fri, 17 May 2019 17:29:30 +0000 (22:59 +0530)]
Staging: rtl8192u: ieee80211: Use !x in place of NULL comparisons

Fix the following checkpatch.pl warning :
CHECK: Comparison to NULL could be written "!x"
by changing (x == NULL) to !x and (x != NULL) to x.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Fix boolinit.cocci warnings
Jeeeun Evans [Fri, 17 May 2019 17:14:48 +0000 (18:14 +0100)]
staging: rtl8723bs: Fix boolinit.cocci warnings

This patch removes unnecessary comparisons to bool.

Issue found by coccinelle:
drivers/staging/rtl8723bs/core/rtw_ap.c:2159:5-11: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_cmd.c:1741:7-17: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:360:5-15: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:360:28-39: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_mlme.c:1675:6-10: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:6766:8-21: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:181:5-40: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_wlan_util.c:748:14-42: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2429:15-47: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2458:7-17: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2524:8-18: WARNING: Comparison to bool
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:1653:13-36: WARNING: Comparison to bool

Signed-off-by: Jeeeun Evans <jeeeunevans@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: bcm2835-camera: Prefer kernel types
Madhumitha Prabakaran [Thu, 16 May 2019 21:33:40 +0000 (16:33 -0500)]
Staging: bcm2835-camera: Prefer kernel types

Fix the warning issued by checkpatch
Prefer kernel type 'u32' over 'uint32_t'.
Along with that include a blank line after a declaration
to maintain Linux kernel coding style.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
Hariprasad Kelam [Sun, 19 May 2019 09:35:57 +0000 (17:35 +0800)]
staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG

fix below warning reported by  coccicheck

drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON
instead of if condition followed by BUG.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
[ Gao Xiang: use DBG_BUGON instead of BUG_ON for eng version only. ]
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoMerge tag 'iio-for-5.3a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio...
Greg Kroah-Hartman [Mon, 20 May 2019 07:13:53 +0000 (09:13 +0200)]
Merge tag 'iio-for-5.3a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of new device support, features and cleanups for IIO in the 5.3 cycle

New device support
* mt6577
  - add supprot for the mt6765 which requires a few minor additional
    new features in the driver.

Yaml binding conversions
* adxl345
* isl29018
* tsl2583
* tsl2772

Minor features and improvements
* ad5758
  - declare an of_device_id table rather than just relying on the spi
    fallback which doesn't use the manufacturer id.
  - drop a set but not used variable left from previous refactor.
* ad7816
  - Add a bit more description to kconfig text.
* ad9523
  - change calculation order to improve frequency accuracy.
* adxl372
  - declare an of_device_id table
* adt7316
  - white space.
* at91_adc
  - Use dev_get_drvdata directly rather than boucing to the platform device
    and back again.
* cros_ec
  - add an id sysfs entry to bring in line with the other implementations.
* ds5522
  - drop a check on the of_node existing as we don't actually use it for
    anything.
* kxsd9
  - declare an of_device_id table.
* maxim_thermocouple
  - declare an of_device_id table.
* mt6577
  - add dt binding entry for mt8183 which is also supported.
* rcar-gyroadc
  - tidy up unnecessary error messages.
* stm32-dfsdm
  - improved error handling.
* stmpe-adc
  - drop an unnecessary variable assignment.
  - add an of_device_id table.
  - reinit completion on begin converstion to avoid a path in which
    previous round had been interrupted, also switch to non interruptible
    wait to avoid an issue with a user program using -pg
  - simplify interrupt handling by just having them always enabled.
  - reset all interrupts on startup and in the timeout handler to
    avoid getting stuck.
* sun4i-gpadc
  - SPDX

* tag 'iio-for-5.3a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (28 commits)
  iio: adc: mediatek: mt6577-auxadc, add mt6765 support
  dt-bindings: iio: adc: mediatek: Add document for mt6765
  dt-bindings: iio: accel: adxl345: switch to YAML bindings
  iio: adc: sun4i-gpadc-iio convert to SPDX license tags
  iio: ad9523-1: Improve reported VCO frequency accuracy
  iio: dac: ds4422/ds4424 drop of_node check
  iio: stmpe-adc: Reset possible interrupts
  iio: stmpe-adc: Use wait_for_completion_timeout
  iio: stmpe-adc: Enable all stmpe-adc interrupts just once
  iio: stmpe-adc: Reinit completion struct on begin conversion
  iio: stmpe-adc: Add compatible name
  iio: stmpe-adc: Remove unnecessary assignment
  staging: iio: adc: Add paragraph to describe Kconfig symbol
  staging: iio: adt7316: match parenthesis alignment
  iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing
  dt-bindings: iio: isl29018: convert bindings to YAML format
  dt-bindings: adc: mt8183: add binding document
  iio: dac: ad5758: remove set but not used variable 'dc_dc_mode'
  iio: cros_ec: add 'id' sysfs entry
  iio: adc: stm32-dfsdm: missing error case during probe
  ...

5 years agoStaging: rtl8723bs: hal: Fix comparison to bool in if statements
Puranjay Mohan [Thu, 16 May 2019 09:11:40 +0000 (14:41 +0530)]
Staging: rtl8723bs: hal: Fix comparison to bool in if statements

Fix following warnings reported by coccicheck:
WARNING: Comparison to bool
by using !x in place of (x == false) and
x in place of (x == true).

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: removed trailing white-space.
Jeremy Sowden [Thu, 16 May 2019 21:38:06 +0000 (22:38 +0100)]
staging: kpc2000: removed trailing white-space.

Removed trailing white-space from four files.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: include <linux/io.h> instead of <asm/io.h>
Puranjay Mohan [Wed, 15 May 2019 16:33:14 +0000 (22:03 +0530)]
Staging: kpc2000: kpc_dma: include <linux/io.h> instead of <asm/io.h>

Fix following checkpatch.pl warning by including
<linux/io.h> instead of <asm/io.h>.

WARNING: Use #include <linux/io.h> instead of <asm/io.h>

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8188eu: os_dep: Use %s and __func__ in strings
Puranjay Mohan [Wed, 15 May 2019 17:18:44 +0000 (22:48 +0530)]
Staging: rtl8188eu: os_dep: Use %s and __func__ in strings

Fix following checkpatch.pl warnings by using %s and __func__
in strings instead of function names.

WARNING: Prefer using '"%s...", __func__' to using 'rtw_report_sec_ie', this function's name, in a string
and other similar warning.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: rtw_recv: fix warning Unneeded variable ret
Hariprasad Kelam [Wed, 15 May 2019 17:08:46 +0000 (22:38 +0530)]
staging: rtl8723bs: core: rtw_recv: fix warning Unneeded variable ret

fix below warning reported by coccicheck

drivers/staging/rtl8723bs/core/rtw_recv.c:1903:5-8: Unneeded variable:
"ret". Return "_SUCCESS" on line 1972
drivers/staging/rtl8723bs/core/rtw_recv.c:1618:6-9: Unneeded variable:
"ret". Return "_SUCCESS" on line 1705

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Fix coding style issues related to if else
Puranjay Mohan [Wed, 15 May 2019 18:17:04 +0000 (23:47 +0530)]
Staging: rtl8192u: ieee80211: Fix coding style issues related to if else

Fix positions of braces for if-else statements.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vchiq: stop explicitly comparing with zero to catch errors
Nicolas Saenz Julienne [Thu, 9 May 2019 14:31:36 +0000 (16:31 +0200)]
staging: vchiq: stop explicitly comparing with zero to catch errors

The vchiq code tends to follow a coding pattern that's not accepted as
per the Linux kernel coding style

We have this:
if (expression != 0)

We want this:
if (expression)

We make an exception if the expression refers to a size, in which case
it's accepted for the sake of clarity.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vchiq: make wait events interruptible
Nicolas Saenz Julienne [Thu, 9 May 2019 14:31:35 +0000 (16:31 +0200)]
staging: vchiq: make wait events interruptible

The killable version of wait_event() is meant to be used on situations
where it should not fail at all costs, but still have the convenience of
being able to kill it if really necessary. Wait events in VCHIQ doesn't
fit this criteria, as it's mainly used as an interface to V4L2 and ALSA
devices.

Fixes: 852b2876a8a8 ("staging: vchiq: rework remove_event handling")
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vchiq: revert "switch to wait_for_completion_killable"
Nicolas Saenz Julienne [Thu, 9 May 2019 14:31:34 +0000 (16:31 +0200)]
staging: vchiq: revert "switch to wait_for_completion_killable"

The killable version of wait_for_completion() is meant to be used on
situations where it should not fail at all costs, but still have the
convenience of being able to kill it if really necessary. VCHIQ doesn't
fit this criteria, as it's mainly used as an interface to V4L2 and ALSA
devices.

Fixes: a772f116702e ("staging: vchiq: switch to wait_for_completion_killable")
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vchiq_2835_arm: revert "quit using custom down_interruptible()"
Nicolas Saenz Julienne [Thu, 9 May 2019 14:31:33 +0000 (16:31 +0200)]
staging: vchiq_2835_arm: revert "quit using custom down_interruptible()"

The killable version of down() is meant to be used on situations where
it should not fail at all costs, but still have the convenience of being
able to kill it if really necessary. VCHIQ doesn't fit this criteria, as
it's mainly used as an interface to V4L2 and ALSA devices.

Fixes: ff5979ad8636 ("staging: vchiq_2835_arm: quit using custom down_interruptible()")
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Use !x in place of NULL comparison
Puranjay Mohan [Tue, 14 May 2019 17:30:23 +0000 (23:00 +0530)]
Staging: rtl8192u: ieee80211: Use !x in place of NULL comparison

Fix comparison to NULL, chang to !x operation.
Issue found using checkpatch.pl

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Add spaces around '&&' operator
Puranjay Mohan [Tue, 14 May 2019 17:30:22 +0000 (23:00 +0530)]
Staging: rtl8192u: ieee80211: Add spaces around '&&' operator

Fix coding style errors by adding spaces around '&&' operators.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Fix coding style errors
Puranjay Mohan [Tue, 14 May 2019 17:30:21 +0000 (23:00 +0530)]
Staging: rtl8192u: ieee80211: Fix coding style errors

Fix coding style errors related to braces for if-else statements.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Fix spelling mistake
Puranjay Mohan [Tue, 14 May 2019 17:30:20 +0000 (23:00 +0530)]
Staging: rtl8192u: ieee80211: Fix spelling mistake

Correct spelling mistakes at two places in comments.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192u: ieee80211: Fix coding style warning
Puranjay Mohan [Tue, 14 May 2019 17:30:19 +0000 (23:00 +0530)]
Staging: rtl8192u: ieee80211: Fix coding style warning

Remove braces around a single if statement to fix following
checkpatch.pl warning.
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8192e: Use %s and __func__ in strings
Puranjay Mohan [Tue, 14 May 2019 21:44:07 +0000 (03:14 +0530)]
Staging: rtl8192e: Use %s and __func__ in strings

Fix following checkpatch.pl warnings by using %s and __func__
in strings instead of function names.

WARNING: Prefer using '"%s...", __func__' to using '_rtl92e_dm_check_rate_adaptive', this function's name, in a string
WARNING: Prefer using '"%s...", __func__' to using 'rtl92e_dm_restore_state', this function's name, in a string

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: drop unneeded -Wall addition
Masahiro Yamada [Wed, 15 May 2019 04:31:22 +0000 (13:31 +0900)]
staging: erofs: drop unneeded -Wall addition

The top level Makefile adds -Wall globally:

  KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \

I see two "-Wall" added for compiling objects in drivers/staging/erofs/.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: clean up after probe failure.
Jeremy Sowden [Wed, 15 May 2019 11:14:37 +0000 (12:14 +0100)]
staging: kpc2000: clean up after probe failure.

On error, kp2000_probe_cores just returned an error without freeing
resources which had previously been allocated.  Added the missing
clean-up code.

Updated TODO.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: added missing clean-up to probe_core_uio.
Jeremy Sowden [Wed, 15 May 2019 11:14:36 +0000 (12:14 +0100)]
staging: kpc2000: added missing clean-up to probe_core_uio.

On error, probe_core_uio just returned an error without freeing
resources which had previously been allocated.  Added the missing
clean-up code.

Updated TODO.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: added designated initializers to two structs.
Jeremy Sowden [Wed, 15 May 2019 11:14:35 +0000 (12:14 +0100)]
staging: kpc2000: added designated initializers to two structs.

Fixed the following two sparse warnings by using designated
initializers:

  drivers/staging/kpc2000/kpc2000/cell_probe.c:101:34: warning: Using plain integer as NULL pointer
  drivers/staging/kpc2000/kpc2000/cell_probe.c:364:34: warning: Using plain integer as NULL pointer

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: declare two functions as static.
Jeremy Sowden [Wed, 15 May 2019 11:14:34 +0000 (12:14 +0100)]
staging: kpc2000: declare two functions as static.

Two functions were not used outside the translation-unit in which they
were defined.  Declared them static.

Fixes two sparse warnings:

  drivers/staging/kpc2000/kpc2000/cell_probe.c:98:5: warning: symbol 'probe_core_basic' was not declared. Should it be static?
  drivers/staging/kpc2000/kpc2000/cell_probe.c:288:5: warning: symbol 'probe_core_uio' was not declared. Should it be static?

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: inverted conditional in order to reduce indentation.
Jeremy Sowden [Wed, 15 May 2019 11:14:33 +0000 (12:14 +0100)]
staging: kpc2000: inverted conditional in order to reduce indentation.

Changed:

  for (...) {
    ...
    if (expr) {
      ...
    }
  }

into:

  for (...) {
    ...
    if (!expr)
      continue;
    ...
  }

in order to reduce indentation of conditional block.  Fixed indentation
of cases blocks at the same time.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve cast warning and use const for file_operation
Vandana BN [Mon, 13 May 2019 13:43:27 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve cast warning and use const for file_operation

This Patch resolves unnecessary cast warning and const file_operations
reported by checkpath.pl
WARNING: unnecessary cast may hide bugs
WARNING: struct file_operations should normally be const

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve warning to use __func__ insted of funtion name...
Vandana BN [Mon, 13 May 2019 13:43:26 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve warning to use __func__ insted of funtion name reported by checkpatch.

This patch resolves warnings to use __func__ insted of funtion name.
WARNING: Prefer using '"%s...", __func__' to using 'setup_dma_engine', this function's name, in a string

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve warning Missing blank line after declarations...
Vandana BN [Mon, 13 May 2019 13:43:25 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve warning Missing blank line after declarations & labels not to be indented.

This patch resloves below warnings reported by checkpath in kpc_dma
WARNING: Missing a blank line after declarations
WARNING: labels should not be indented
CHECK: Please don't use multiple blank lines
CHECK: Please use a blank line after function/struct/union/enum
declarations

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve checkpath errors Macros in paranthesis & trailing...
Vandana BN [Mon, 13 May 2019 13:43:24 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve checkpath errors Macros in paranthesis & trailing statements on next line.

This patch fixes below errors reported by checkpath
ERROR: Macros with complex values should be enclosed in parentheses
CHECK: Prefer using the BIT macro
ERROR: trailing statements should be on next line
ERROR: trailing statements should be on next line

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve code indent and trailing statements on next line...
Vandana BN [Mon, 13 May 2019 13:43:23 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve code indent and trailing statements on next line errors reported by checkpatch.

This patch fixes code indentaion error reported by checkpath
ERROR: switch and case should be at the same indent
ERROR: trailing statements should be on next line

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve checkpatch space errors around brace '{', '!'...
Vandana BN [Mon, 13 May 2019 13:43:22 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve checkpatch space errors around brace '{', '!' and open paranthesis '('.

This patch resolves below errors reported by checkpath
ERROR: space required before the open brace '{'
ERROR: space prohibited after that '!' (ctx:BxW)
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve space errors around pointers and function declarat...
Vandana BN [Mon, 13 May 2019 13:43:21 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve space errors around pointers and function declarations reported by checkpatch.

This patch resolves below errors reported by checkpatch
ERROR: "(foo*)" should be "(foo *)"
ERROR: "foo * bar" should be "foo *bar"
ERROR: "foo __init  bar" should be "foo __init bar"
ERROR: "foo __exit  bar" should be "foo __exit bar"

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: kpc_dma: Resolve trailing whitespace error reported by checkpatch
Vandana BN [Mon, 13 May 2019 13:43:20 +0000 (19:13 +0530)]
Staging: kpc2000: kpc_dma: Resolve trailing whitespace error reported by checkpatch

Resolve trailing whitespace error from checkpatch.pl
ERROR: trailing whitespace

Signed-off-by: Vandana BN <bnvandana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: os_dep: Remove Unneeded variable ret
Hariprasad Kelam [Mon, 13 May 2019 11:15:18 +0000 (16:45 +0530)]
staging: rtl8723bs: os_dep: Remove Unneeded variable ret

fix below issue reported by coccicheck

drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2685:5-8: Unneeded
variable: "ret". Return "0" on line 3266

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
----
Changes in v2:
  - make subject line more clean

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8723bs: os_dep: Fix if-else coding style issues
Puranjay Mohan [Mon, 13 May 2019 19:57:06 +0000 (01:27 +0530)]
Staging: rtl8723bs: os_dep: Fix if-else coding style issues

Fix placement of opening brace in if-else statement
to correct coding style issue.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove unused function kp2000_cdev_write
YueHaibing [Sun, 12 May 2019 06:46:15 +0000 (14:46 +0800)]
staging: kpc2000: remove unused function kp2000_cdev_write

There is no callers in tree, so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vc04_services: bcm2835-camera: remove redundant assignment to variable ret
Colin Ian King [Sat, 11 May 2019 13:48:13 +0000 (14:48 +0100)]
staging: vc04_services: bcm2835-camera: remove redundant assignment to variable ret

The variable ret is being initialized however this is never read and later
it is being reassigned to a new value. The initialization is redundant and
hence can be removed.

Addresses-Coverity: ("Unused Value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: kpc2000: Cleanup in kpc_dma_transfer()
Madhumitha Prabakaran [Sun, 5 May 2019 18:32:30 +0000 (13:32 -0500)]
Staging: kpc2000: Cleanup in kpc_dma_transfer()

Remove unnecessary typecast in kzalloc function. In addition to that
replace kzalloc(sizeof(*acd)) over kzalloc(sizeof(struct aio_cb_data))
to maintain Linux kernel style.

Issue suggested by Coccinelle.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>