linux-2.6-microblaze.git
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>
7 years agoLinux 4.10-rc2
Linus Torvalds [Sun, 1 Jan 2017 22:31:53 +0000 (14:31 -0800)]
Linux 4.10-rc2

7 years agoMerge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim...
Linus Torvalds [Sun, 1 Jan 2017 20:27:05 +0000 (12:27 -0800)]
Merge branch 'libnvdimm-fixes' of git://git./linux/kernel/git/nvdimm/nvdimm

Pull DAX updates from Dan Williams:
 "The completion of Jan's DAX work for 4.10.

  As I mentioned in the libnvdimm-for-4.10 pull request, these are some
  final fixes for the DAX dirty-cacheline-tracking invalidation work
  that was merged through the -mm, ext4, and xfs trees in -rc1. These
  patches were prepared prior to the merge window, but we waited for
  4.10-rc1 to have a stable merge base after all the prerequisites were
  merged.

  Quoting Jan on the overall changes in these patches:

     "So I'd like all these 6 patches to go for rc2. The first three
      patches fix invalidation of exceptional DAX entries (a bug which
      is there for a long time) - without these patches data loss can
      occur on power failure even though user called fsync(2). The other
      three patches change locking of DAX faults so that ->iomap_begin()
      is called in a more relaxed locking context and we are safe to
      start a transaction there for ext4"

  These have received a build success notification from the kbuild
  robot, and pass the latest libnvdimm unit tests. There have not been
  any -next releases since -rc1, so they have not appeared there"

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  ext4: Simplify DAX fault path
  dax: Call ->iomap_begin without entry lock during dax fault
  dax: Finish fault completely when loading holes
  dax: Avoid page invalidation races and unnecessary radix tree traversals
  mm: Invalidate DAX radix tree entries only if appropriate
  ext2: Return BH_New buffers for zeroed blocks

7 years agoMerge tag 'docs-4.10-rc1-fix' of git://git.lwn.net/linux
Linus Torvalds [Fri, 30 Dec 2016 17:32:26 +0000 (09:32 -0800)]
Merge tag 'docs-4.10-rc1-fix' of git://git.lwn.net/linux

Pull documentation fixes from Jonathan Corbet:
 "Two small fixes:

   - A merge error on my part broke the DocBook build. I've
     requisitioned one of tglx's frozen sharks for appropriate
     disciplinary action and resolved to be more careful about testing
     the DocBook stuff as long as it's still around.

   - Fix an error in unaligned-memory-access.txt"

* tag 'docs-4.10-rc1-fix' of git://git.lwn.net/linux:
  Documentation/unaligned-memory-access.txt: fix incorrect comparison operator
  docs: Fix build failure

7 years agoMerge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Fri, 30 Dec 2016 17:29:50 +0000 (09:29 -0800)]
Merge branch 'linus' of git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This fixes a boot failure on some platforms when crypto self test is
  enabled along with the new acomp interface"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: testmgr - Use heap buffer for acomp test input

7 years agomm/filemap: fix parameters to test_bit()
Olof Johansson [Thu, 29 Dec 2016 22:16:07 +0000 (14:16 -0800)]
mm/filemap: fix parameters to test_bit()

 mm/filemap.c: In function 'clear_bit_unlock_is_negative_byte':
  mm/filemap.c:933:9: error: too few arguments to function 'test_bit'
    return test_bit(PG_waiters);
         ^~~~~~~~

Fixes: b91e1302ad9b ('mm: optimize PageWaiters bit use for unlock_page()')
Signed-off-by: Olof Johansson <olof@lixom.net>
Brown-paper-bag-by: Linus Torvalds <dummy@duh.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7 years agomm: optimize PageWaiters bit use for unlock_page()
Linus Torvalds [Tue, 27 Dec 2016 19:40:38 +0000 (11:40 -0800)]
mm: optimize PageWaiters bit use for unlock_page()

In commit 62906027091f ("mm: add PageWaiters indicating tasks are
waiting for a page bit") Nick Piggin made our page locking no longer
unconditionally touch the hashed page waitqueue, which not only helps
performance in general, but is particularly helpful on NUMA machines
where the hashed wait queues can bounce around a lot.

However, the "clear lock bit atomically and then test the waiters bit"
sequence turns out to be much more expensive than it needs to be,
because you get a nasty stall when trying to access the same word that
just got updated atomically.

On architectures where locking is done with LL/SC, this would be trivial
to fix with a new primitive that clears one bit and tests another
atomically, but that ends up not working on x86, where the only atomic
operations that return the result end up being cmpxchg and xadd.  The
atomic bit operations return the old value of the same bit we changed,
not the value of an unrelated bit.

On x86, we could put the lock bit in the high bit of the byte, and use
"xadd" with that bit (where the overflow ends up not touching other
bits), and look at the other bits of the result.  However, an even
simpler model is to just use a regular atomic "and" to clear the lock
bit, and then the sign bit in eflags will indicate the resulting state
of the unrelated bit #7.

So by moving the PageWaiters bit up to bit #7, we can atomically clear
the lock bit and test the waiters bit on x86 too.  And architectures
with LL/SC (which is all the usual RISC suspects), the particular bit
doesn't matter, so they are fine with this approach too.

This avoids the extra access to the same atomic word, and thus avoids
the costly stall at page unlock time.

The only downside is that the interface ends up being a bit odd and
specialized: clear a bit in a byte, and test the sign bit.  Nick doesn't
love the resulting name of the new primitive, but I'd rather make the
name be descriptive and very clear about the limitation imposed by
trying to work across all relevant architectures than make it be some
generic thing that doesn't make the odd semantics explicit.

So this introduces the new architecture primitive

    clear_bit_unlock_is_negative_byte();

and adds the trivial implementation for x86.  We have a generic
non-optimized fallback (that just does a "clear_bit()"+"test_bit(7)"
combination) which can be overridden by any architecture that can do
better.  According to Nick, Power has the same hickup x86 has, for
example, but some other architectures may not even care.

All these optimizations mean that my page locking stress-test (which is
just executing a lot of small short-lived shell scripts: "make test" in
the git source tree) no longer makes our page locking look horribly bad.
Before all these optimizations, just the unlock_page() costs were just
over 3% of all CPU overhead on "make test".  After this, it's down to
0.66%, so just a quarter of the cost it used to be.

(The difference on NUMA is bigger, but there this micro-optimization is
likely less noticeable, since the big issue on NUMA was not the accesses
to 'struct page', but the waitqueue accesses that were already removed
by Nick's earlier commit).

Acked-by: Nick Piggin <npiggin@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Bob Peterson <rpeterso@redhat.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Andrew Lutomirski <luto@kernel.org>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7 years agoMerge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Wed, 28 Dec 2016 01:51:36 +0000 (17:51 -0800)]
Merge branch 'linus' of git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This fixes a hash corruption bug in the marvell driver"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: marvell - Copy IVDIG before launching partial DMA ahash requests

7 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Wed, 28 Dec 2016 00:04:37 +0000 (16:04 -0800)]
Merge git://git./linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Various ipvlan fixes from Eric Dumazet and Mahesh Bandewar.

    The most important is to not assume the packet is RX just because
    the destination address matches that of the device. Such an
    assumption causes problems when an interface is put into loopback
    mode.

 2) If we retry when creating a new tc entry (because we dropped the
    RTNL mutex in order to load a module, for example) we end up with
    -EAGAIN and then loop trying to replay the request. But we didn't
    reset some state when looping back to the top like this, and if
    another thread meanwhile inserted the same tc entry we were trying
    to, we re-link it creating an enless loop in the tc chain. Fix from
    Daniel Borkmann.

 3) There are two different WRITE bits in the MDIO address register for
    the stmmac chip, depending upon the chip variant. Due to a bug we
    could set them both, fix from Hock Leong Kweh.

 4) Fix mlx4 bug in XDP_TX handling, from Tariq Toukan.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  net: stmmac: fix incorrect bit set in gmac4 mdio addr register
  r8169: add support for RTL8168 series add-on card.
  net: xdp: remove unused bfp_warn_invalid_xdp_buffer()
  openvswitch: upcall: Fix vlan handling.
  ipv4: Namespaceify tcp_tw_reuse knob
  net: korina: Fix NAPI versus resources freeing
  net, sched: fix soft lockup in tc_classify
  net/mlx4_en: Fix user prio field in XDP forward
  tipc: don't send FIN message from connectionless socket
  ipvlan: fix multicast processing
  ipvlan: fix various issues in ipvlan_process_multicast()

7 years agoDocumentation/unaligned-memory-access.txt: fix incorrect comparison operator
Cihangir Akturk [Sat, 17 Dec 2016 17:42:17 +0000 (19:42 +0200)]
Documentation/unaligned-memory-access.txt: fix incorrect comparison operator

In the actual implementation ether_addr_equal function tests for equality to 0
when returning. It seems in commit 0d74c4 it is somehow overlooked to change
this operator to reflect the actual function.

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
7 years agodocs: Fix build failure
John Brooks [Fri, 23 Dec 2016 00:53:10 +0000 (00:53 +0000)]
docs: Fix build failure

The 80211.tmpl DocBook file was removed in commit 819bf593767c ("docs-rst:
sphinxify 802.11 documentation"), but the 80211.xml target was re-added to
the Makefile by commit 7ddedebb03b7 ("ALSA: doc: ReSTize
writing-an-alsa-driver document"), leading to a failure when building the
documentation:

*** No rule to make target 'Documentation/DocBook/80211.xml', needed by
'Documentation/DocBook/80211.aux.xml'.

cc: stable@vger.kernel.org
Signed-off-by: John Brooks <john@fastquake.com>
Mea-culpa-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
7 years agoMerge tag 'v4.10-rc1' into docs-next
Jonathan Corbet [Tue, 27 Dec 2016 19:53:44 +0000 (12:53 -0700)]
Merge tag 'v4.10-rc1' into docs-next

Linux 4.10-rc1