platform/kernel/linux-rpi.git
5 years agostaging: rtl8723bs: hal: Remove set but not used variable 'no_res' and 'phal'
YueHaibing [Sat, 25 May 2019 14:36:40 +0000 (22:36 +0800)]
staging: rtl8723bs: hal: Remove set but not used variable 'no_res' and 'phal'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c: In function xmit_xmitframes:
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:205:5: warning: variable no_res set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c: In function rtl8723bs_free_xmit_priv:
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:640:23: warning: variable phal set but not used [-Wunused-but-set-variable]

They are never used and can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: rtw_ap: fix Unneeded variable: "ret". Return "0"
Hariprasad Kelam [Fri, 24 May 2019 18:41:05 +0000 (00:11 +0530)]
staging: rtl8723bs: core: rtw_ap: fix Unneeded variable: "ret". Return "0"

Function "rtw_sta_flush" always returns 0 value.
So change return type of rtw_sta_flush from int to void.

Same thing applies for rtw_hostapd_sta_flush

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
-----
Changes v2 -
       change return type of rtw_sta_flush
Changes v3 -
       fix indentaion issue
Changes v4 -
       prepare patch on linux-next
Changes v5 -
      cleanup subject and commit message

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging/gasket: Fix string split
Tianzheng Li [Fri, 24 May 2019 11:31:05 +0000 (13:31 +0200)]
staging/gasket: Fix string split

This patch removes unnecessary quoted string splits.

Co-developed-by: Jie Zhang <zhangjie.cnde@gmail.com>
Signed-off-by: Jie Zhang <zhangjie.cnde@gmail.com>
Signed-off-by: Tianzheng Li <ltz0302@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: ks7010: Remove initialisation in ks7010_sdio.c
Nishka Dasgupta [Fri, 24 May 2019 08:58:42 +0000 (14:28 +0530)]
staging: ks7010: Remove initialisation in ks7010_sdio.c

As the initial value of the return variable result is never used, it can
be removed.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: ks7010: Merge multiple return variables in ks_hostif.c
Nishka Dasgupta [Fri, 24 May 2019 08:18:21 +0000 (13:48 +0530)]
staging: ks7010: Merge multiple return variables in ks_hostif.c

The function hostif_data_request had two return variables, ret and
result. When ret is assigned a value, in all cases (except one) this
assignment is followed immediately by a goto to the end of the
function. In the last case, the goto takes effect only if ret < 0;
however, if ret >= 0 then this value of ret is not needed in the
remainder of that branch. On the other hand result is used (assigned a
value and returned) only in those branches where ret >= 0 or ret has
not been used at all.
As the values of ret and result are not both required at the same point
in any branch, result can be removed and its occurrences replaced with
ret.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: ks7010: Remove initialisation in ks_hostif.c
Nishka Dasgupta [Fri, 24 May 2019 08:03:30 +0000 (13:33 +0530)]
staging: ks7010: Remove initialisation in ks_hostif.c

The initial value of return variable result is never used, so it can be
removed.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: replace bogus variable name in core.c
Simon Sandström [Wed, 29 May 2019 19:42:22 +0000 (21:42 +0200)]
staging: kpc2000: replace bogus variable name in core.c

"struct kp2000_regs temp" has nothing to do with temperatures, so
replace it with the more proper name "regs".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove extra spaces in core.c
Simon Sandström [Fri, 24 May 2019 11:08:02 +0000 (13:08 +0200)]
staging: kpc2000: remove extra spaces in core.c

Fixes checkpatch.pl error "foo __init  bar" should be "foo __init bar"
and "foo __exit  bar" should be "foo __exit bar".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove extra blank line in core.c
Simon Sandström [Fri, 24 May 2019 11:08:00 +0000 (13:08 +0200)]
staging: kpc2000: remove extra blank line in core.c

Fixes checkpatch.pl check "Please don't use multiple blank lines".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: Use devm_* API to manage mapped I/O space
Geordan Neukum [Sun, 26 May 2019 01:18:34 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: Use devm_* API to manage mapped I/O space

The kpc_i2c driver does not unmap its I/O space upon error cases in the
probe() function or upon remove(). Make the driver clean up after itself
more maintainably by using the managed resource API.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: fail probe if unable to map I/O space
Geordan Neukum [Sun, 26 May 2019 01:18:33 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: fail probe if unable to map I/O space

The kpc2000 driver does not verify whether or not mapping the I/O
space succeeded during probe time. Make the driver verify that the
mapping operation was successful before potentially using that area
in the future.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: fail probe if unable to get I/O resource
Geordan Neukum [Sun, 26 May 2019 01:18:32 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: fail probe if unable to get I/O resource

The kpc_i2c driver attempts to map its I/O space without verifying
whether or not the result of platform_get_resource() is NULL. Make the
driver check that platform_get_resource did not return NULL before
attempting to use the value returned to map an I/O space.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: Use drvdata instead of platform_data
Geordan Neukum [Sun, 26 May 2019 01:18:31 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: Use drvdata instead of platform_data

The kpc_i2c driver stashes private state data in the platform_data
member of its device structure. In general, the platform_data structure
is used for passing data to the driver during probe() rather than as a
storage area for runtime state data. Instead, use the drvdata member
for all state info meant to be accessible in driver callbacks.

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 consecutive newlines
Geordan Neukum [Sun, 26 May 2019 01:18:30 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: Remove unnecessary consecutive newlines

The kpc2000_i2c.c file contains instances of unnecessary consecutive
newlines which impact the readability of the file. Remove these
unnecessary newlines.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: Use BIT macro rather than manual bit shifting
Geordan Neukum [Sun, 26 May 2019 01:18:29 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: Use BIT macro rather than manual bit shifting

The FEATURES_* symbols use bit shifting of the style (1 << k) in order
to assign a certain meaning to the value of inividual bits being set
in the value of a given variable. Instead, use the BIT() macro in
order to improve readability and maintain consistency with the rest
of the kernel.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: kpc_i2c: Remove pldev from i2c_device structure
Geordan Neukum [Sun, 26 May 2019 01:18:28 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: Remove pldev from i2c_device structure

The i2c_device structure contains a member used to stash a pointer to
a platform_device. The driver contains no cases of this member being
used after initialization. Remove the unnecessary struct member and
the initialization of this member in the sole instance where the
driver creates a variable of type: struct i2c_device.

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 rw_sem
Geordan Neukum [Sun, 26 May 2019 01:18:27 +0000 (01:18 +0000)]
staging: kpc2000: kpc_i2c: Remove unused rw_sem

In pi2c_probe, a rw_sem is initialized and stashed off in the
i2c_device private runtime state struct. This rw_sem is never used
after initialization. Remove the rw_sem and cleanup unneeded header
inclusion.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: replace white spaces with tabs for kpc2000_spi.c
Mao Wenan [Tue, 28 May 2019 08:02:14 +0000 (16:02 +0800)]
staging: kpc2000: replace white spaces with tabs for kpc2000_spi.c

There are multiple wrong formats in kpc2000_spi.c,
is time to do clean work for it.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: report error status to spi core
Mao Wenan [Tue, 28 May 2019 08:02:13 +0000 (16:02 +0800)]
staging: kpc2000: report error status to spi core

There is an error condition that's not reported to
the spi core in kp_spi_transfer_one_message().
It should restore status value to m->status, and
return it in error path.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: Change to use DIV_ROUND_UP
Nishka Dasgupta [Wed, 29 May 2019 13:11:53 +0000 (18:41 +0530)]
staging: kpc2000: Change to use DIV_ROUND_UP

Use macro DIV_ROUND_UP instead of an equivalent sequence of operations.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: fix typo in Kconfig
Simon Sandström [Fri, 24 May 2019 20:30:57 +0000 (22:30 +0200)]
staging: kpc2000: fix typo in Kconfig

Fixes two minor typos in kpc2000's Kconfig: s/Kaktronics/Daktronics

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: speakup: serialio: fix warning linux/serial.h is included more than once
Hariprasad Kelam [Sun, 26 May 2019 07:13:22 +0000 (12:43 +0530)]
staging: speakup: serialio: fix warning linux/serial.h is included more than once

fix below warning reported by  includecheck

./drivers/staging/speakup/serialio.h: linux/serial.h is included more
than once.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: fix i_blocks calculation
Gao Xiang [Tue, 28 May 2019 03:19:43 +0000 (11:19 +0800)]
staging: erofs: fix i_blocks calculation

For compressed files, i_blocks should not be calculated
by using i_size. use i_u.compressed_blocks instead.

In addition, i_blocks was miscalculated for non-compressed
files previously, fix it as well.

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 agostaging: erofs: support statx
Gao Xiang [Tue, 28 May 2019 03:19:42 +0000 (11:19 +0800)]
staging: erofs: support statx

statx() has already been supported in commit a528d35e8bfc
("statx: Add a system call to make enhanced file info available"),
user programs can get more useful attributes.

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 agoMAINTAINERS: Add entry for anybuss drivers
Sven Van Asbroeck [Fri, 24 May 2019 19:10:13 +0000 (15:10 -0400)]
MAINTAINERS: Add entry for anybuss drivers

Add myself as the maintainer of the anybuss bus driver, and its client
drivers.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoMAINTAINERS: Add entry for fieldbus subsystem
Sven Van Asbroeck [Fri, 24 May 2019 19:10:12 +0000 (15:10 -0400)]
MAINTAINERS: Add entry for fieldbus subsystem

Add myself as the maintainer of the fieldbus subsystem.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove unnecessary oom message
Simon Sandström [Thu, 23 May 2019 12:51:43 +0000 (14:51 +0200)]
staging: kpc2000: remove unnecessary oom message

Fixes checkpatch.pl warning "Possible unnecessary 'out of memory'
message".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove unnecessary include in cell_probe.c
Simon Sandström [Thu, 23 May 2019 12:51:42 +0000 (14:51 +0200)]
staging: kpc2000: remove unnecessary include in cell_probe.c

Fixes checkpatch.pl warning "Use #include <linux/io.h> instead of
<asm/io.h>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove unnecessary braces in cell_probe.c
Simon Sandström [Thu, 23 May 2019 12:51:41 +0000 (14:51 +0200)]
staging: kpc2000: remove unnecessary braces in cell_probe.c

Fixes checkpatch.pl warnings "braces {} are not necessary for single
statement blocks".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: use kzalloc(sizeof(var)...) in cell_probe.c
Simon Sandström [Thu, 23 May 2019 12:51:40 +0000 (14:51 +0200)]
staging: kpc2000: use kzalloc(sizeof(var)...) in cell_probe.c

Fixes checkpatch.pl warning "Prefer kzalloc(sizeof(*kudev)...) over
kzalloc(sizeof(struct kpc_uio_device)...)"

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove extra blank lines in cell_probe.c
Simon Sandström [Thu, 23 May 2019 12:51:39 +0000 (14:51 +0200)]
staging: kpc2000: remove extra blank lines in cell_probe.c

Fixes checkpatch.pl warnings "Please don't use multiple blank lines".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: fix alignment issues in cell_probe.c
Simon Sandström [Thu, 23 May 2019 12:51:38 +0000 (14:51 +0200)]
staging: kpc2000: fix alignment issues in cell_probe.c

Fixes checkpatch.pl warnings "Alignment should match open parenthesis"
and "Lines should not end with a '('".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: add missing asterisk in comment
Simon Sandström [Thu, 23 May 2019 12:51:37 +0000 (14:51 +0200)]
staging: kpc2000: add missing asterisk in comment

Fixes checkpatch.pl error "code indent should use tabs where possible".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: use __func__ in debug messages
Simon Sandström [Thu, 23 May 2019 12:51:36 +0000 (14:51 +0200)]
staging: kpc2000: use __func__ in debug messages

Fixes checkpatch.pl warning "Prefer using '"%s...", __func__' to using
'<function name>', this function's name, in a string".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: add blank line after declarations
Simon Sandström [Thu, 23 May 2019 12:51:35 +0000 (14:51 +0200)]
staging: kpc2000: add blank line after declarations

Fixes checkpatch.pl warning "Missing a blank line after declarations".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: pi433: Remove unnecessary variable
Nishka Dasgupta [Thu, 23 May 2019 12:53:41 +0000 (18:23 +0530)]
staging: pi433: Remove unnecessary variable

The variable retval is assigned constant values twice, and can therefore
be replaced by its values.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: remove invalid spaces in cell_probe.c
Simon Sandström [Wed, 22 May 2019 20:58:49 +0000 (22:58 +0200)]
staging: kpc2000: remove invalid spaces in cell_probe.c

Fixes checkpatch.pl error "space prohibited before/after that
parenthesis".

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

Fixes checkpatch.pl error "space required after that ','".

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

Fixes checkpatch.pl warning "spaces preferred around that <op>".

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

Fixes checkpatch.pl error "else should follow close brace '}'" and
"trailing statements should be on next line".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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>