platform/kernel/linux-starfive.git
7 years agostaging: unisys: visorbus: Don't check for more than PAGE_SIZE length in visorbus
David Binder [Tue, 3 Jan 2017 21:01:16 +0000 (16:01 -0500)]
staging: unisys: visorbus: Don't check for more than PAGE_SIZE length in visorbus

Since a sysfs entry is allocated 1 page of memory (4096 bytes) by default,
there is no need to enforce this limit in the driver. This patch corrects
visorbus/visorbus_main.c.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: fix incorrect ERROR tags from logs
Galo Navarro [Tue, 3 Jan 2017 22:12:09 +0000 (23:12 +0100)]
staging: rtl8188eu: fix incorrect ERROR tags from logs

Several lifecycle events in the rtl8188eu driver are logged using the
DBG_88E_LEVEL macro from rtw_debug.h, which is tagged as ERROR
regardless of the actual level.  Below are dmesg excerpts after loading
and unloading the module, the messages are misleading as there was no
error.

    [517434.916239] usbcore: registered new interface driver r8188eu
    [517435.680653] R8188EU: ERROR indicate disassoc
    [517437.122606] R8188EU: ERROR assoc success
    [517797.735611] usbcore: deregistering interface driver r8188eu
    [517797.736069] R8188EU: ERROR indicate disassoc

Remove the ERROR prefix from the logs.  After the patch, logs are:

    [517949.873976] usbcore: registered new interface driver r8188eu
    [517950.592845] R8188EU: indicate disassoc
    [517951.993973] R8188EU: assoc success
    [521778.784448] usbcore: deregistering interface driver r8188eu
    [521778.784838] R8188EU: indicate disassoc

Signed-off-by: Galo Navarro <anglorvaroa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: change dma_buf variable to __le16
Ramiro Oliveira [Tue, 3 Jan 2017 14:43:40 +0000 (14:43 +0000)]
staging: most: change dma_buf variable to __le16

dma_buf is being cast to __le16 *, but it was defined as u16 *.
sparse reported this error as:
drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning: cast to restricted
__le16

This patch changes dma_buf from u16 to __le16.

Signed-off-by: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:iio:addac Fixes Alignment should match open parenthesis
Scott Matheina [Wed, 4 Jan 2017 01:50:24 +0000 (19:50 -0600)]
staging:iio:addac Fixes Alignment should match open parenthesis

Fixes style issue where Alignment doesn't match open parenthesis

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: lustre: lustre: lmv: Compress return logic into one line.
Gustavo A. R. Silva [Thu, 5 Jan 2017 05:14:36 +0000 (21:14 -0800)]
Staging: lustre: lustre: lmv: Compress return logic into one line.

Simplify return logic to avoid unnecessary variable assignments.
These issues were detected using Coccinelle and the following semantic patch:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: remove unused function _linked_rx_signal_strehgth_display
Luca Ceresoli [Wed, 4 Jan 2017 16:55:47 +0000 (17:55 +0100)]
staging: rtl8188eu: remove unused function _linked_rx_signal_strehgth_display

Not referenced anymore since commit 9fe7b29c6cc1 ("staging: rtl8188eu:
remove unused field bRxRSSIDisplay in struct adapter").

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: log: Fix line over 80 characters.
Emmanuil Chatzipetru [Wed, 4 Jan 2017 16:08:19 +0000 (17:08 +0100)]
staging: greybus: log: Fix line over 80 characters.

Fix coding style issue caught by checkpatch.pl related to the following
warning:
- CHECK: WARNING: line over 80 characters
This is done by dropping a redundant cast and by replacing the format specifier
in dev_err(); to "%zu" instead of "%d", in order to silence the warnings of the
compiler.

Also, while at it, drop the redundant cast in the comparison as well to maintain
consistency.

Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: audio_topology: Fix spaces between operator and string
Emmanuil Chatzipetru [Wed, 4 Jan 2017 16:08:18 +0000 (17:08 +0100)]
staging: greybus: audio_topology: Fix spaces between operator and string

Fix coding style issue caught by checkpatch.pl related to the following
warning:
- "CHECK: spaces preferred around that '*' (ctx:VxV) "

Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: remove unused members from struct recv_priv
Luca Ceresoli [Thu, 29 Dec 2016 23:01:06 +0000 (00:01 +0100)]
staging: rtl8188eu: remove unused members from struct recv_priv

Since commit da25a8ec6b2d ("staging: rtl8188eu: remove unused
debugging functions") is_signal_dbg is never set to true, so the code
under if (adapter->recvpriv.is_signal_dbg) is dead. Remove the
variable and the dead code.

The signal_strength_dbg was referenced only in the code that is being
removed, so remove it as well.

Also fix coding style issues in the touched lines.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: remove unused field bRxRSSIDisplay in struct adapter
Luca Ceresoli [Thu, 29 Dec 2016 23:01:04 +0000 (00:01 +0100)]
staging: rtl8188eu: remove unused field bRxRSSIDisplay in struct adapter

Since commit da25a8ec6b2d ("staging: rtl8188eu: remove unused
debugging functions") this field is never set set to any nonzero
value, so it is actually always zero.

It is also used only once, as a boolean inside an if(). This means the
code under that if() is dead code, so remove it as well.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: In core directory, fixed 'missing a balnk line after declarations...
Yamanappagouda Patil [Thu, 22 Dec 2016 17:02:13 +0000 (22:32 +0530)]
staging: rtl8188eu: In core directory, fixed 'missing a balnk line after declarations' warnings.

Fixed checkpatch.pl warnings in rtl8188eu/core directory.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Fixed 'Missing a blank line after declarations' warnings.
Yamanappagouda Patil [Thu, 22 Dec 2016 16:49:12 +0000 (22:19 +0530)]
staging: rtl8188eu: Fixed 'Missing a blank line after declarations' warnings.

Fixed checkpatch.pl 'Missing a blank line after declarations' in
rtl8188eu module.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: used a better macro
Jannik Becher [Tue, 20 Dec 2016 17:59:50 +0000 (18:59 +0100)]
staging: rtl8712: used a better macro

Fixed a sparse warning.
Using be16_to_cpus() to avoid double assignment.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed u16 to __be16
Jannik Becher [Tue, 20 Dec 2016 17:59:49 +0000 (18:59 +0100)]
staging: rtl8712: changed u16 to __be16

Fixed sparse warning.
Just changed u16 to __be16 and typecasts.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed cast to __le16
Jannik Becher [Tue, 20 Dec 2016 17:59:48 +0000 (18:59 +0100)]
staging: rtl8712: changed cast to __le16

Fixed sparse warning.
Changed u16 to __le16

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed u32 to __le32
Jannik Becher [Tue, 20 Dec 2016 17:59:47 +0000 (18:59 +0100)]
staging: rtl8712: changed u32 to __le32

Fixed sparse warnings.
Deleted cpu_to_le32() for enum. I'm not sure why it was there.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: fixed little endian problem
Jannik Becher [Tue, 20 Dec 2016 17:59:46 +0000 (18:59 +0100)]
staging: rtl8712: fixed little endian problem

Fixed a sparse warning.
Using function le16_to_cpus() to avoid double assignment.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed uint to __le32
Jannik Becher [Tue, 20 Dec 2016 17:59:45 +0000 (18:59 +0100)]
staging: rtl8712: changed uint to __le32

Fixed a sparse warning.
Just changed uint to __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed u32 to __le32
Jannik Becher [Tue, 20 Dec 2016 17:59:44 +0000 (18:59 +0100)]
staging: rtl8712: changed u32 to __le32

Fixed sparse warning.
Just changed u32 to __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed typecast to __le
Jannik Becher [Tue, 20 Dec 2016 17:59:43 +0000 (18:59 +0100)]
staging: rtl8712: changed typecast to __le

Fixed sparse warning.
Changed uint to __le16 and __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed GetFrameSubType macro
Jannik Becher [Tue, 20 Dec 2016 17:59:42 +0000 (18:59 +0100)]
staging: rtl8712: changed GetFrameSubType macro

Fixed a sparse warning.
GetFrameSubType and GetFrameType should cast to __le16. Furthermore
GetFramSubType should use le16_to_cpu instead of cpu_to_le16.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: casted variables to __le32
Jannik Becher [Tue, 20 Dec 2016 17:59:41 +0000 (18:59 +0100)]
staging: rtl8712: casted variables to __le32

Fixed a sparse warning.
Casting __le32 variables to the right type.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed function argument to __le32
Jannik Becher [Tue, 20 Dec 2016 17:59:40 +0000 (18:59 +0100)]
staging: rtl8712: changed function argument to __le32

Fixed a sparse warning "cast to restricted __le32".
Function argument is of type __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed variables to __le32
Jannik Becher [Tue, 20 Dec 2016 17:59:39 +0000 (18:59 +0100)]
staging: rtl8712: changed variables to __le32

Fixed sparse warning "cast to restricted __le32".
Changed struct tx_desc members to __le32 and pcmdbuf to __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed struct members to __le32
Jannik Becher [Tue, 20 Dec 2016 17:59:38 +0000 (18:59 +0100)]
staging: rtl8712: changed struct members to __le32

Fixed sparse warning "cast to restricted __le32".
struct sitesurvey_parm uses little endian members.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: xgifb: This patch removes the unnecessary return statement using spatch
Rahul Krishnan [Fri, 23 Dec 2016 09:59:46 +0000 (15:29 +0530)]
staging: xgifb: This patch removes the unnecessary return statement using spatch

This patch removes unnecessary return statement using spatch tool

Signed-off-by: Rahul Krishnan <mrahul.krishnan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: r8188eu: fix spelling mistake on xmitframe_coalsece
Colin Ian King [Thu, 29 Dec 2016 15:42:27 +0000 (15:42 +0000)]
staging: r8188eu: fix spelling mistake on xmitframe_coalsece

trivial fix to spelling mistake of function name in debuf message,
should be xmitframe_coalesce instead of xmitframe_coalsece.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: wilc1000: Fix endian sparse warning
Mike Kofron [Thu, 29 Dec 2016 21:35:48 +0000 (16:35 -0500)]
staging: wilc1000: Fix endian sparse warning

drivers/staging/wilc1000/linux_wlan.c:995:18: warning: restricted __be16 degrades to integer

Signed-off-by: Mike Kofron <mpkofron@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: vt6656: checkpatch: fix identifier name in wcmd.h
Tobias Heineken [Wed, 21 Dec 2016 14:35:34 +0000 (15:35 +0100)]
Staging: vt6656: checkpatch: fix identifier name in wcmd.h

This is a patch to the wcmd.h file that fixes up two identifier
name warnings found by the checkpatch.pl tool at lines 54 and 56

Signed-off-by: Tobias Heineken <tobias.heineken+kernel@robotics-erlangen.de>
Signed-off-by: Florian Schleicher <florian.schleicher@fau.de>
CC: linux-kernel@i4.cs.fau.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: changed struct members to __le32
Jannik Becher [Sun, 18 Dec 2016 06:53:45 +0000 (07:53 +0100)]
staging: rtl8712: changed struct members to __le32

Fixed sparse warning "cast to restricted __le32".
struct recv_stat and struct phy_stat have always little endian members.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: svc_watchdog: replace printk() with pr_err()
Emmanuil Chatzipetru [Thu, 22 Dec 2016 15:22:03 +0000 (16:22 +0100)]
staging: greybus: svc_watchdog: replace printk() with pr_err()

Fix coding style issue caught by checkpatch.pl related to the following
warning:
- "WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then
dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ."

Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: svc_watchdog: Fix spaces on a single definition statement
Emmanuil Chatzipetru [Thu, 22 Dec 2016 15:22:02 +0000 (16:22 +0100)]
staging: greybus: svc_watchdog: Fix spaces on a single definition statement

Fix coding style issue caught by checkpatch.pl related to the following
warning:
- "CHECK: spaces preferred around that '*' (ctx:VxV) "

Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: arche-apb-ctrl: fix unused warnings on resume/suspend
Jérémy Lefaure [Sat, 17 Dec 2016 00:33:02 +0000 (19:33 -0500)]
staging: greybus: arche-apb-ctrl: fix unused warnings on resume/suspend

When CONFIG_PM_SLEEP is disabled, SIMPLE_DEV_PM_OPS does not use
arche_apb_ctrl_resume and arche_apb_ctrl_suspend functions:

drivers/staging/greybus/arche-apb-ctrl.c:478:12: warning:
‘arche_apb_ctrl_resume’ defined but not used [-Wunused-function]
 static int arche_apb_ctrl_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~
drivers/staging/greybus/arche-apb-ctrl.c:464:12: warning:
‘arche_apb_ctrl_suspend’ defined but not used [-Wunused-function]
 static int arche_apb_ctrl_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~

Adding __maybe_unused to the declaration of these functions removes the
warnings.

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: add host device function pointer checks
Jason Hrycay [Tue, 20 Dec 2016 20:49:27 +0000 (14:49 -0600)]
staging: greybus: add host device function pointer checks

Add sanity checks for cport_quiesce and cport_clear before invoking the
callbacks as these function pointers are not required during the host
device registration. This follows the logic implemented elsewhere for
various other function pointers.

Signed-off-by: Jason Hrycay <jhrycay@gmail.com>
Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: loopback: use gb_loopback_async_wait_all don't spin
Bryan O'Donoghue [Thu, 22 Dec 2016 00:37:28 +0000 (00:37 +0000)]
staging: greybus: loopback: use gb_loopback_async_wait_all don't spin

Currently the greybus-loopback thread logic spins around waiting for
send_count == iteration_max which on real hardware doesn't make a
difference to us but in simulation is excruciatingly slow, anti-social and
bad manners. Use the existing gb_loopback_async_wait_all() function to gate
continuing when the send_count == iteration_max and go to sleep until
there's something worthwhile to-do.

Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: emxx_udc: Fix CamelCase variable name
Afonso Bordado [Tue, 20 Dec 2016 13:55:08 +0000 (13:55 +0000)]
staging: emxx_udc: Fix CamelCase variable name

Changes from CamelCase to a kernel format

Signed-off-by: Afonso Bordado <afonsobordado@az8.co>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: emxx_udc: Remove unecessary temporary variable
Afonso Bordado [Tue, 20 Dec 2016 13:55:07 +0000 (13:55 +0000)]
staging: emxx_udc: Remove unecessary temporary variable

This improves code readability.

Signed-off-by: Afonso Bordado <afonsobordado@az8.co>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: emxx_udc: Rename CamelCase variable
Afonso Bordado [Tue, 20 Dec 2016 13:55:06 +0000 (13:55 +0000)]
staging: emxx_udc: Rename CamelCase variable

The new name complies with the kernel styling guidelines and is more descriptive.

Signed-off-by: Afonso Bordado <afonsobordado@az8.co>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: emxx_udc: Fix CamelCase function name
Afonso Bordado [Tue, 20 Dec 2016 13:55:05 +0000 (13:55 +0000)]
staging: emxx_udc: Fix CamelCase function name

Change EP0_out_PIO to use the kernel convention.

Signed-off-by: Afonso Bordado <afonsobordado@az8.co>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: emxx_udc: remove incorrect __init annotations
Arnd Bergmann [Fri, 16 Dec 2016 09:09:39 +0000 (10:09 +0100)]
staging: emxx_udc: remove incorrect __init annotations

The probe function is not marked __init, but some other functions
are. This leads to a warning on older compilers (e.g. gcc-4.3),
and can cause executing freed memory when built with those
compilers:

WARNING: drivers/staging/emxx_udc/emxx_udc.o(.text+0x2d78): Section mismatch in reference from the function nbu2ss_drv_probe() to the function .init.text:nbu2ss_drv_contest_init()

This removes the annotations.

Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Fix bracing on single statement blocks
Aaron Moore [Sun, 18 Dec 2016 05:48:32 +0000 (00:48 -0500)]
staging: vc04_services: Fix bracing on single statement blocks

Fix coding style issue caught by checkpatch.pl relating to braces on
single statement blocks. This issue was corrected in 3 locations.

Signed-off-by: Aaron Moore <aaron@atamisk.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Fix NULL ptr sparse warnings
Mike Kofron [Fri, 9 Dec 2016 16:21:01 +0000 (11:21 -0500)]
staging: vc04_services: Fix NULL ptr sparse warnings

In calls to queue_message() in vchiq_core.c, the "void *context"
parameter is set as 0 rather than NULL. This patch amends each call to
use the proper NULL pointer. The following sparse warnings are fixed:

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:1623:23: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:1976:47: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:2075:47: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:2095:47: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:2907:39: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:2929:39: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:3059:72: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:3860:31: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:3870:31: warning: Using plain integer as NULL pointer
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c:3880:31: warning: Using plain integer as NULL pointer

Signed-off-by: Mike Kofron <mpkofron@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: ks7010: ks7010_sdio.h: Trailing whitespace
Manoj Sawai [Mon, 12 Dec 2016 19:29:51 +0000 (19:29 +0000)]
Staging: ks7010: ks7010_sdio.h: Trailing whitespace

Removed trailing whitespace.

Signed-off-by: Manoj Sawai <mas@iitkgp.ac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: ks7010: ks7010_sdio.h: Complex macro not in parentheses
Manoj Sawai [Mon, 12 Dec 2016 19:29:50 +0000 (19:29 +0000)]
Staging: ks7010: ks7010_sdio.h: Complex macro not in parentheses

Fixed coding style error. Complex macro not inside parentheses.

Signed-off-by: Manoj Sawai <mas@iitkgp.ac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: skein: checkpatch: fix comment aligning in skein_base.c
Tobias Heineken [Thu, 22 Dec 2016 13:55:14 +0000 (14:55 +0100)]
Staging: skein: checkpatch: fix comment aligning in skein_base.c

This is a patch to the skein_base.c file that fixes up a
comment aligning warning found by the checkpatch.pl tool at line 2

Signed-off-by: Tobias Heineken <tobias.heineken+kernel@robotics-erlangen.de>
Signed-off-by: Florian Schleicher <florian.schleicher@fau.de>
CC: linux-kernel@i4.cs.fau.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: fix code alignment with open parenthesis
Scott Matheina [Wed, 21 Dec 2016 02:42:19 +0000 (20:42 -0600)]
staging: fbtft: fix code alignment with open parenthesis

These changes where identified by checkpatch.pl as needed changes to
align the code with the linux development coding style. The several
lines of text where aligned with the precending parenthesis.

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: update TODO file
Fernando Apesteguia [Sun, 11 Dec 2016 19:13:05 +0000 (20:13 +0100)]
staging: dgnc: update TODO file

Remove reference to checkpatch warnings since its output is now clean.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fixed spelling error in TODO file for dgnc driver
Scott Matheina [Thu, 22 Dec 2016 02:44:55 +0000 (20:44 -0600)]
staging: fixed spelling error in TODO file for dgnc driver

fixed a missing letter in the TODO file 'unneeded'

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: comedi: proc: Warn if unable to create proc entry
Cheah Kok Cheong [Fri, 30 Dec 2016 11:27:41 +0000 (19:27 +0800)]
Staging: comedi: proc: Warn if unable to create proc entry

The proc entry is not essential for the comedi system as
evident by the support for !CONFIG_PROC_FS. So for failure
to create, just warn and continue loading.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: comedi: proc: Add module owner
Cheah Kok Cheong [Fri, 30 Dec 2016 11:27:17 +0000 (19:27 +0800)]
Staging: comedi: proc: Add module owner

Since this is a loadable kernel module, add module ownership
to follow LKM semantics.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: comedi: proc: Add __init prefix
Cheah Kok Cheong [Fri, 30 Dec 2016 11:26:50 +0000 (19:26 +0800)]
Staging: comedi: proc: Add __init prefix

Add __init prefix so that symbol will be discarded after
module loading.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: comedi: proc: Change file permission to read only
Cheah Kok Cheong [Fri, 30 Dec 2016 11:26:24 +0000 (19:26 +0800)]
Staging: comedi: proc: Change file permission to read only

As there's no write operation, change to read only.
Was inadvertantly switched to 0644 in commit 1f817b86d5e6
("comedi: Don't use create_proc_read_entry()").

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: comedi: comedi_fops: Avoid orphaned proc entry
Cheah Kok Cheong [Fri, 30 Dec 2016 11:25:52 +0000 (19:25 +0800)]
Staging: comedi: comedi_fops: Avoid orphaned proc entry

Move comedi_proc_init to the end to avoid orphaned proc entry
if module loading failed.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: comedi: comedidev.h: Drop old style zero-length array
Cheah Kok Cheong [Wed, 21 Dec 2016 19:13:19 +0000 (03:13 +0800)]
Staging: comedi: comedidev.h: Drop old style zero-length array

According to Documentation/Changes, the minimum gcc version required
to compile the kernel is 3.2 (this is probably outdated too).

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: ni_670x: using the BIT(x) macro
Saber Rezvani [Fri, 16 Dec 2016 20:20:04 +0000 (23:50 +0330)]
staging: comedi: ni_670x: using the BIT(x) macro

Fix the checkpatch.pl issue:
CHECK: Prefer using the BIT macro
replacing bit shifting on 1 with the BIT(x) macro.

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: ni_at_ao: using the BIT(x) macro
Saber Rezvani [Fri, 16 Dec 2016 20:06:20 +0000 (23:36 +0330)]
staging: comedi: ni_at_ao: using the BIT(x) macro

Fix the checkpatch.pl issue:
CHECK: Prefer using the BIT macro
replacing bit shifting on 1 with the BIT(x) macro.

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: cb_pcidas64: use preferred kernel type u32
Saber Rezvani [Fri, 16 Dec 2016 19:15:16 +0000 (22:45 +0330)]
staging: comedi: cb_pcidas64: use preferred kernel type u32

Fix the checkpatch.pl issue:
CHECK: Prefer kernel type 'u32' over 'uint32_t'

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: cb_pcidas64: use preferred kernel type u16
Saber Rezvani [Fri, 16 Dec 2016 19:15:15 +0000 (22:45 +0330)]
staging: comedi: cb_pcidas64: use preferred kernel type u16

Fix the checkpatch.pl issue:
CHECK: Prefer kernel type 'u16' over 'uint16_t'

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: cb_pcidas64: use preferred kernel type u8
Saber Rezvani [Fri, 16 Dec 2016 19:15:14 +0000 (22:45 +0330)]
staging: comedi: cb_pcidas64: use preferred kernel type u8

Fix the checkpatch.pl issue:
CHECK: Prefer kernel type 'u8' over 'uint8_t'

Signed-off-by: Saber Rezvani <irsaber@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: comedidev.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:51 +0000 (13:19 +0000)]
staging: comedi: comedidev.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: comedi_usb.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:50 +0000 (13:19 +0000)]
staging: comedi: comedi_usb.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: comedi_pcmcia.[ch]: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:49 +0000 (13:19 +0000)]
staging: comedi: comedi_pcmcia.[ch]: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: comedi_internal.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:48 +0000 (13:19 +0000)]
staging: comedi: comedi_internal.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: comedi_compat32.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:47 +0000 (13:19 +0000)]
staging: comedi: comedi_compat32.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: ni_tio_internal.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:46 +0000 (13:19 +0000)]
staging: comedi: ni_tio_internal.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: ni_tio.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:45 +0000 (13:19 +0000)]
staging: comedi: ni_tio.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: ni_labpc.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:44 +0000 (13:19 +0000)]
staging: comedi: ni_labpc.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: mite.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:43 +0000 (13:19 +0000)]
staging: comedi: mite.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: comedi_isadma.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:42 +0000 (13:19 +0000)]
staging: comedi: comedi_isadma.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: comedi_8254.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:41 +0000 (13:19 +0000)]
staging: comedi: comedi_8254.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: addi_watchdog.h: add identifiers to function parameters
Ian Abbott [Thu, 15 Dec 2016 13:19:40 +0000 (13:19 +0000)]
staging: comedi: addi_watchdog.h: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodrivers: staging: comedi: fix function prototypes
Piotr Gregor [Wed, 14 Dec 2016 13:42:11 +0000 (13:42 +0000)]
drivers: staging: comedi: fix function prototypes

Add names of parameters to function prototypes in comedi PCI.
Checkpatch reports now no errors.

Signed-off-by: Piotr Gregor <piotrgregor@rsyncme.org>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: nvec: fix indent issue in nvec_power.c
Matthew Smith [Fri, 16 Dec 2016 17:16:47 +0000 (17:16 +0000)]
staging: nvec: fix indent issue in nvec_power.c

Fixes "WARNING: Statements should start on a tabstop" from checkpatch.pl

Signed-off-by: Matthew Smith <matthew11235@outlook.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: android: ion: return -ENOMEM in ion_cma_heap allocation failure
Jaewon Kim [Fri, 9 Dec 2016 05:05:30 +0000 (14:05 +0900)]
staging: android: ion: return -ENOMEM in ion_cma_heap allocation failure

Initial Commit 349c9e138551 ("gpu: ion: add CMA heap") returns -1 in allocation
failure. The returned value is passed up to userspace through ioctl. So user can
misunderstand error reason as -EPERM(1) rather than -ENOMEM(12).

This patch simply changed this to return -ENOMEM.

Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: my_device_destroy add error handling
David Kershner [Thu, 22 Dec 2016 16:09:07 +0000 (11:09 -0500)]
staging: unisys: visorbus: my_device_destroy add error handling

Add the proper error handling to my_device_destroy so it can be send
back up the stack for further error reporting.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: my_device_changestate add error handling
David Kershner [Thu, 22 Dec 2016 16:09:06 +0000 (11:09 -0500)]
staging: unisys: visorbus: my_device_changestate add error handling

The function my_device_changestate was not returning errors up the stack.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Add err handling for function save_crash_message
David Kershner [Thu, 22 Dec 2016 16:09:05 +0000 (11:09 -0500)]
staging: unisys: visorbus: Add err handling for function save_crash_message

The function save_crash_message returns an error, don't ignore it,
respond appropriately and send it up.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: my_device_create add error handling
David Kershner [Thu, 22 Dec 2016 16:09:04 +0000 (11:09 -0500)]
staging: unisys: visorbus: my_device_create add error handling

Add proper error handling to the function my_device_create and
propagate the error message up the stack.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorhba: Remove unused MAX_BUF define
Bryan Thompson [Thu, 22 Dec 2016 16:09:03 +0000 (11:09 -0500)]
staging: unisys: visorhba: Remove unused MAX_BUF define

Remove the MAX_BUF define and associated comments.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Convert references to /proc to /sys
David Binder [Thu, 22 Dec 2016 16:09:02 +0000 (11:09 -0500)]
staging: unisys: visorbus: Convert references to /proc to /sys

Removes references to visorchipset in the /proc filesystem, and replaces
them with references to the /sys filesystem. Also removes reference to the
visorchipset driver, and replaces it with a reference to plain
visorchipset (since it is no longer a standalone driver).

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: controlvmchannel.h remove unused pound defines
Erik Arfvidson [Thu, 22 Dec 2016 16:09:01 +0000 (11:09 -0500)]
staging: unisys: visorbus: controlvmchannel.h remove unused pound defines

This patch removes unused pound defines in controlvmchannel.h.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Remove unneeded checks for valid variable addr
David Binder [Thu, 22 Dec 2016 16:09:00 +0000 (11:09 -0500)]
staging: unisys: visorbus: Remove unneeded checks for valid variable addr

The 'retry' variable created in handle_command() is statically allocated,
and its address is never set to NULL. Therefore conditionals to verify
the validity of the retry variable's address are unnecessary.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Use switch statement instead of conditionals
David Binder [Thu, 22 Dec 2016 16:08:59 +0000 (11:08 -0500)]
staging: unisys: visorbus: Use switch statement instead of conditionals

Control flow is now directed using a switch statement, triggered by the
enum crash_obj_type function parameter, instead of a set of conditional
statements.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: shorten error message defines
Sameer Wadgaonkar [Thu, 22 Dec 2016 16:08:58 +0000 (11:08 -0500)]
staging: unisys: visorbus: shorten error message defines

This patch shortens a few error message defines by removing ERROR
from the define.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: osc: use rb_entry_safe
Geliang Tang [Tue, 20 Dec 2016 13:56:55 +0000 (21:56 +0800)]
staging: lustre: osc: use rb_entry_safe

Use rb_entry_safe() instead of container_of() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging : lustre : Remove braces from single-line body.
Tabrez khan [Fri, 16 Dec 2016 14:29:31 +0000 (19:59 +0530)]
staging : lustre : Remove braces from single-line body.

Remove unnecessary braces {} for single while statement.
This warning is found using checkpatch.pl.

Signed-off-by: Tabrez khan <khan.tabrez21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: obdclass: style cleanup for obdo related functions
Ben Evans [Sat, 10 Dec 2016 18:05:58 +0000 (13:05 -0500)]
staging: lustre: obdclass: style cleanup for obdo related functions

Change the style of lustre_get_wire_obdo and
lustre_set_wire_obdo to conform to linux kernel
standard.

Signed-off-by: Ben Evans <bevans@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/16917
Reviewed-on: http://review.whamcloud.com/19266
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: obdclass: Create a header for obdo related functions
Ben Evans [Sat, 10 Dec 2016 18:05:57 +0000 (13:05 -0500)]
staging: lustre: obdclass: Create a header for obdo related functions

Remove all obdo related functions from lustre_idl.h
Create lustre_odbo.h. Include where appropriate.
Make the functions lustre_get_wire_obdo and
lustre_set_wire_obdo to not be inlined functions.

Signed-off-by: Ben Evans <bevans@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/16917
Reviewed-on: http://review.whamcloud.com/19266
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: Fix variable type declaration after refactoring
Quentin Lambert [Thu, 8 Dec 2016 20:38:27 +0000 (21:38 +0100)]
staging: lustre: Fix variable type declaration after refactoring

A recent clean-up declared och_flags as a int rather than fmode_t. This
lead to the following sparse warning:

drivers/staging/lustre/lustre/llite/file.c:106:30: warning: restricted
fmode_t degrades to integer

This patch fixes this issue.

Fixes: 0a1200991234f7 ("staging: lustre: cleanup lustre_lib.h")
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: make brw_inject_one_error() static
James Simmons [Wed, 7 Dec 2016 22:55:17 +0000 (17:55 -0500)]
staging: lustre: lnet: make brw_inject_one_error() static

It's not used anywhere outside of brw_test.c file.
Highlighted by sparse.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: osc: handle osc eviction correctly
Jinshan Xiong [Wed, 7 Dec 2016 22:49:12 +0000 (17:49 -0500)]
staging: lustre: osc: handle osc eviction correctly

Cleanup everything if an OSC is being evicted.
Group lock is not well supported yet.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/14989
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre/ptlrpc: Move nrs_conf_fifo extern to a header
Oleg Drokin [Wed, 7 Dec 2016 22:41:34 +0000 (17:41 -0500)]
staging/lustre/ptlrpc: Move nrs_conf_fifo extern to a header

This avoids having an extern definition in a C file which is bad,
and also silences sparse complaint as well.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre: Move lov_read_and_clear_async_rc declaration
Oleg Drokin [Wed, 7 Dec 2016 22:41:33 +0000 (17:41 -0500)]
staging/lustre: Move lov_read_and_clear_async_rc declaration

Move it to obd.h, so that it's included from both the users and
the actual definition, making sure they never get out of sync.
This also silences a sparse warning.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre: Declare lu_context/session_tags_default
Oleg Drokin [Wed, 7 Dec 2016 22:41:32 +0000 (17:41 -0500)]
staging/lustre: Declare lu_context/session_tags_default

Make the declaration in a header, not as an extern in a C file,
that is frowned upon.
This also makes sparse a little bit more happy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre/osc: extern declare osc_caches in a header
Oleg Drokin [Wed, 7 Dec 2016 22:41:31 +0000 (17:41 -0500)]
staging/lustre/osc: extern declare osc_caches in a header

This avoids frowned upon extern in the C file, and also
shuts down a sparse warning of
drivers/staging/lustre/lustre/osc/osc_dev.c:55:22: warning: symbol 'osc_caches' was not declared. Should it be static?

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre/lov: make lov_lsm_alloc() static
Oleg Drokin [Wed, 7 Dec 2016 22:41:30 +0000 (17:41 -0500)]
staging/lustre/lov: make lov_lsm_alloc() static

It's not used anywhere outside of this file.
Highlighted by sparse.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre/llite: mark ll_io_init() static
Oleg Drokin [Wed, 7 Dec 2016 22:41:29 +0000 (17:41 -0500)]
staging/lustre/llite: mark ll_io_init() static

It's not used anywhere out of this file.
Highlighted by sparse.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre/ldlm: Correct itree_overlap_cb return type
Oleg Drokin [Wed, 7 Dec 2016 22:41:28 +0000 (17:41 -0500)]
staging/lustre/ldlm: Correct itree_overlap_cb return type

As per interval_search() prototype, the callback should return
enum, not int.
This fixes correspondign sparse warning.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/lustre/llite: move root_squash from sysfs to debugfs
Oleg Drokin [Wed, 7 Dec 2016 22:41:27 +0000 (17:41 -0500)]
staging/lustre/llite: move root_squash from sysfs to debugfs

root_squash control got accidentally moved to sysfs instead of
debugfs, and the write side of it was also broken expecting a
userspace buffer.
It contains both uid and gid values in a single file, so debugfs
is a clear place for it.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Fixes: c948390f10ccc "fix inconsistencies of root squash feature"
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: use designated initializers
Kees Cook [Sat, 17 Dec 2016 01:00:45 +0000 (17:00 -0800)]
staging: lustre: ldlm: use designated initializers

Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>