cascardo/linux.git
8 years agostaging: unisys: Reduce indent
Christophe JAILLET [Mon, 13 Jul 2015 18:52:26 +0000 (20:52 +0200)]
staging: unisys: Reduce indent

Remove some extra tabs in order to improve readalibility.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: Use kzalloc instead of kmalloc/memset
Christophe JAILLET [Mon, 13 Jul 2015 18:51:32 +0000 (20:51 +0200)]
staging: unisys: Use kzalloc instead of kmalloc/memset

This patch turns a kmalloc/memset into an equivalent kzalloc.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: fix random memory corruption in visorchannel_write()
Tim Sell [Mon, 13 Jul 2015 18:51:24 +0000 (14:51 -0400)]
staging: unisys: fix random memory corruption in visorchannel_write()

visorchannel_write() and it's user visorbus_write_channel() are
exported, so all visorbus function drivers (i.e., drivers that call
visorbus_register_visor_driver()) are potentially affected by the bug.

Because of pointer-arithmetic rules, the address being written to in the
affected code was actually at byte offset:

    sizeof(struct channel_header) * offset

instead of just <offset> bytes as intended.

The bug could cause some very difficult-to-diagnose symptoms.  The
particular problem that led me on this chase was a kernel fault that
would occur during 'insmod visornic' after a previous 'rmmod visornic',
where we would fault during netdev_register_kobject() within
pm_runtime_set_memalloc_noio() while traversing a device list, which
occurred because dev->parent for the visorbus device had become
corrupted.

Fixes: 0abb60c1c ('staging: unisys: visorchannel_write(): Handle...')
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: correctly NULL-terminate visorbus sysfs attribute array
Tim Sell [Mon, 13 Jul 2015 18:51:23 +0000 (14:51 -0400)]
staging: unisys: correctly NULL-terminate visorbus sysfs attribute array

I'm not sure what adverse runtime effects the previously-omitted
NULL-termination would cause, but the code was definitely wrong.

Fixes: 795731627c ('staging: unisys: Clean up device sysfs attributes')
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: Fix broken build when ARCH=um
Ken Cox [Thu, 9 Jul 2015 17:28:56 +0000 (13:28 -0400)]
staging: unisys: Fix broken build when ARCH=um

When building with ARCH=um you get the following error:

arch/x86/include/asm/cpufeature.h:252:42: error: 'REQUIRED_MASK0'
undeclared

The Unisys drivers should not be compiled for UML, so this patch addresses
that by adding a dependency to kconfig for !UML.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Tested-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: Allow visorbus to autoload
David Kershner [Thu, 9 Jul 2015 17:27:53 +0000 (13:27 -0400)]
staging: unisys: Allow visorbus to autoload

We inadvertently remove the MODULE_DEVICE_TABLE line for visorbus,
this patch adds it back in.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Fixes: d5b3f1dccee4 ('staging: unisys: move timskmod.h functionality')
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: prevent erroneous kfree of devdata pointer
Tim Sell [Thu, 9 Jul 2015 17:27:52 +0000 (13:27 -0400)]
staging: unisys: visornic: prevent erroneous kfree of devdata pointer

A struct visornic_devdata for each visornic device is actually allocated as
part of alloc_etherdev(), here in visornic_probe():

    netdev = alloc_etherdev(sizeof(struct visornic_devdata));

But code in devdata_release() was treating devdata as a pointer that needed
to be kfree()d!  This was causing all sorts of weird behavior after doing
an rmmod of visornic, both because free_netdev() was actually freeing the
memory used for devdata, and because devdata wasn't pointing to
dynamically-allocated memory in the first place.

The kfree(devdata) and the kref that tracked devdata's usage have been
appropriately deleted.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: use preferred interface for setting netdev's parent
Tim Sell [Thu, 9 Jul 2015 17:27:51 +0000 (13:27 -0400)]
staging: unisys: visornic: use preferred interface for setting netdev's parent

Just switch this line so it uses the correct function call.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: delay start of worker thread until netdev created
Tim Sell [Thu, 9 Jul 2015 17:27:50 +0000 (13:27 -0400)]
staging: unisys: visornic: delay start of worker thread until netdev created

This only makes sense, since the worker thread depends upon the netdev
existing.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: don't destroy global workqueues until devs destroyed
Tim Sell [Thu, 9 Jul 2015 17:27:49 +0000 (13:27 -0400)]
staging: unisys: visornic: don't destroy global workqueues until devs destroyed

visornic_cleanup() was previously incorrectly destroying its global
workqueues prior to cleaning up the devices which used them.  This patch
corrects the order of these operations.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: correctly clean up device on removal
Tim Sell [Thu, 9 Jul 2015 17:27:48 +0000 (13:27 -0400)]
staging: unisys: visornic: correctly clean up device on removal

visornic_remove() is called to logically detach the visornic driver from a
visorbus-supplied device, which can happen either just prior to a
visorbus-supplied device disappearing, or as a result of an rmmod of
visornic.  Prior to this patch, logic was missing to properly clean up for
this removal, which was fixed via the following changes:

* A going_away flag is now used to interlock between device destruction and
  workqueue operations, protected by priv_lock.  I.e., setting
  going_away=true under lock guarantees that no new work items can get
  queued to the work queues.  going_away=true also short-circuits other
  operations to enable device destruction to proceed.

* Missing clean-up operations for the workqueues, netdev, debugfs entries,
  and the worker thread were added.

* Memory referenced from the visornic private devdata struct is now freed
  as part of devdata destruction.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: correct obvious double-allocation of workqueues
Tim Sell [Thu, 9 Jul 2015 17:27:47 +0000 (13:27 -0400)]
staging: unisys: visornic: correct obvious double-allocation of workqueues

Looks like an errant patch fitting caused us to redundantly allocate the
workqueues at both the beginning and end of visornic_init().  This was
corrected by removing the allocations at the beginning.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Fixes: 68905a14e49c ('staging: unisys: Add s-Par visornic ethernet driver')
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: add error messages to visornic
Tim Sell [Thu, 9 Jul 2015 17:27:46 +0000 (13:27 -0400)]
staging: unisys: add error messages to visornic

Add error message to genuine rare error paths, and debug messages
to enable relatively non-verbose tracing of code paths

You can enable debug messages by including this on the kernel command line:

    visornic.dyndbg=+p

or by this from the command line:

    echo "module visornic +p" > <debugfs>/dynamic_debug/control

Refer to Documentation/dynamic-debug-howto.txt for more details.

In addition to the new debug and error messages, a message like the
following will be logged every time a visornic device is probed, which
will enable you to map back-and-forth between visorbus device names
(e.g., "vbus2:dev0") and netdev names (e.g., "eth0"):

    visornic vbus2:dev0: visornic_probe success netdev=eth0

With this patch and visornic debugging enabled, you should expect to see
messages like the following in the most-common scenarios:

* driver loaded:

      visornic_init

* device probed:

      visornic vbus2:dev0: visornic_probe
      visor_thread_start
      visor_thread_start success

* network interface configured (ifconfig):

      net eth0: visornic_open
      net eth0: visornic_enable_with_timeout
      net eth0: visornic_enable_with_timeout success
      net eth0: visornic_open success

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: neglect to NULL rcvbuf pointer
Tim Sell [Thu, 9 Jul 2015 17:27:45 +0000 (13:27 -0400)]
staging: unisys: neglect to NULL rcvbuf pointer

Neglect to NULL rcvbuf pointer array could result in faults later

This problem would exhibit itself as a fault when when attempting to stop
any visornic device (i.e., in visornic_disable_with_timeout() or
visornic_serverdown_complete()) that had never been started (i.e., for
which init_rcv_bufs() had never been called).  Because the array of rcvbuf
was never cleared to NULLs, we would mistakenly attempt to call kfree_skb()
on garbage memory.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: prevent faults in visornic_pause
Tim Sell [Thu, 9 Jul 2015 17:27:44 +0000 (13:27 -0400)]
staging: unisys: prevent faults in visornic_pause

Prevent faults in visornic_pause, visornic_resume(), and visornic_remove()

Prior to this patch, any call to visornic_pause(), visornic_resume(), or
visornic_remove() would fault, due to dev_set_drvdata() never having been
called to stash our struct visornic_devdata * into the device's drvdata.
I.e., all calls to dev_get_drvdata() were returning NULL, meaning a fault
was soon to follow.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: correct visornic_pause
Tim Sell [Thu, 9 Jul 2015 17:27:43 +0000 (13:27 -0400)]
staging: unisys: visornic: correct visornic_pause

Correct visornic_pause() to indicate completion asynchronously rather
than in-line

Previously, visornic_pause() (called to stop the device due to IOVM service
partition recovery) was calling the passed complete_func() in-line, rather
than delaying the calling until after the device had actually been stopped.

The behavior has been corrected so that the calling of the complete_func()
is now delayed until after the stopping of the device has been completed in
visornic_serverdown_complete(), which runs asynchronously via the workqueue
visornic_serverdown_workqueue.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: prevent faults processing messages
Tim Sell [Thu, 9 Jul 2015 17:27:42 +0000 (13:27 -0400)]
staging: unisys: prevent faults processing messages

Prevent faults processing messages for devices that no driver has yet
registered to handle.

Previously, code of the form:

    drv = to_visor_driver(dev->device.driver);
    if (!drv)
        goto away;

was not having the desired intent, because to_visor_driver() was
essentially returning garbage if its argument was NULL.  The only existing
case of this is in initiate_chipset_device_pause_resume(), which is called
during IOVM service partition recovery.  We were thus faulting when IOVM
service partition recovery was initiated on a bus that had at least one
device for which no function driver had registered
(visorbus_register_visor_driver).

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: respond to msgs post device_create
Tim Sell [Thu, 9 Jul 2015 17:27:41 +0000 (13:27 -0400)]
staging: unisys: respond to msgs post device_create

Fix problem that prevents us from responding to any device message after
device_create.

By neglecting to NULL out pending_msg_hdr after the device_create response,
we were effectively preventing any subsequent messages to the device from
working, because device_epilog() will correctly bail out early if it sees
that pending_msg_hdr is still set non-NULL, as that is an indicator to mean
that an unanswered message is still outstanding.

This problem was discovered as part of testing IOVM service partition
recovery, because device_epilog() was in fact bailing out when it was
called from my_device_changestate(), which of course prevented us from
transitioning the device to the paused state.  However, the incorrect
behavior would occur for ANY subsequent command directed at the device,
not just for changestate.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: sm750fb: ddk750_dvi.h: Fix brace coding style issue
Anders Fridlund [Thu, 9 Jul 2015 12:45:22 +0000 (14:45 +0200)]
Staging: sm750fb: ddk750_dvi.h: Fix brace coding style issue

This is a patch to the ddk750_dvi.h file that fixes up a brace error
found by the checkpatch.pl tool

Signed-off-by: Anders Fridlund <anders.fridlund@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: coding style global ERROR fixes
Vinay Simha BN [Tue, 14 Jul 2015 13:45:28 +0000 (19:15 +0530)]
staging: sm750fb: coding style global ERROR fixes

kernel coding style fixes for below messages from
scripts/checkpatch.pl

ERROR: do not initialise globals to 0 or NULL

Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: add required spaces around C operators
Anatoly Stepanov [Sun, 28 Jun 2015 23:44:04 +0000 (02:44 +0300)]
staging: sm750fb: add required spaces around C operators

Add spaces according to checkpatch.pl messages:
"ERROR: spaces required around that '=' (ctx:VxV)"
"ERROR: need consistent spacing around '-' (ctx:WxV)"
"ERROR: spaces required around that '?' (ctx:VxE)"
"ERROR: need consistent spacing around '&' (ctx:VxW)"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: fix open brace in function declaration
Anatoly Stepanov [Sun, 28 Jun 2015 23:44:03 +0000 (02:44 +0300)]
staging: sm750fb: fix open brace in function declaration

Fix according to checkpatch.pl message:
"ERROR: open brace '{' following function declarations go on the next line"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: remove assignment from if condition
Anatoly Stepanov [Sun, 28 Jun 2015 23:44:02 +0000 (02:44 +0300)]
staging: sm750fb: remove assignment from if condition

Remove assignment from if condition according to checkpatch.pl message:
"ERROR: do not use assignment in if condition"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: fix 'switch and case' indentation
Anatoly Stepanov [Sun, 28 Jun 2015 23:44:01 +0000 (02:44 +0300)]
staging: sm750fb: fix 'switch and case' indentation

Fix according to checkpatch.pl message:
"ERROR: switch and case should be at the same indent"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: fix indentation in 'else' statements
Anatoly Stepanov [Sun, 28 Jun 2015 23:44:00 +0000 (02:44 +0300)]
staging: sm750fb: fix indentation in 'else' statements

Fix indentation according to checkpatch.pl message:
"ERROR: space required after that close brace '}'"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: put open brace on the previous line
Anatoly Stepanov [Sun, 28 Jun 2015 23:43:59 +0000 (02:43 +0300)]
staging: sm750fb: put open brace on the previous line

Fix open braces according to checkpatch.pl message:
"ERROR: that open brace { should be on the previous line"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: fix indentation of pointer operator
Anatoly Stepanov [Sun, 28 Jun 2015 23:43:58 +0000 (02:43 +0300)]
staging: sm750fb: fix indentation of pointer operator

Fix indentation of pointer operator '*' according to checkpatch.pl message:
"ERROR: 'foo* bar' should be 'foo *bar' "

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: insert space before open parenthesis
Anatoly Stepanov [Sun, 28 Jun 2015 23:43:57 +0000 (02:43 +0300)]
staging: sm750fb: insert space before open parenthesis

Insert spaces before '(' according to checkpatch.pl message:
"ERROR: space required before the open parenthesis"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: insert space between ')' and '{'
Anatoly Stepanov [Sun, 28 Jun 2015 23:43:56 +0000 (02:43 +0300)]
staging: sm750fb: insert space between ')' and '{'

Insert spaces according to checkpatch.pl message:
"ERROR: space required before the open brace '{'"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: remove trailing whitespaces
Anatoly Stepanov [Sun, 28 Jun 2015 23:43:55 +0000 (02:43 +0300)]
staging: sm750fb: remove trailing whitespaces

Remove trailing whitespaces according to checkpatch.pl error message:
"ERROR: trailing whitespace"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: replace spaces with tabs
Anatoly Stepanov [Sun, 28 Jun 2015 23:43:54 +0000 (02:43 +0300)]
staging: sm750fb: replace spaces with tabs

Replace spaces with tabs according to checkpatch.pl error message:
"ERROR: code indent should use tabs where possible"

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: remove redundant __func__ in debug statement
Hari Prasath Gujulan Elango [Wed, 24 Jun 2015 16:51:21 +0000 (16:51 +0000)]
staging: sm750fb: remove redundant __func__ in debug statement

This patch removes the redundant __func__ from dynamic debug prints as
the pr_xxx set of functions can be dynamically controlled to include
function name.Also fix a typo in debug statement.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: Comedi: comedi_fops: Fixed the return error code
Santhosh Pai [Mon, 29 Jun 2015 09:44:03 +0000 (10:44 +0100)]
staging: Comedi: comedi_fops: Fixed the return error code

This patch fixes the checkpatch.pl warning:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

try_module_get fails when the reference count of the module is not
allowed to be incremented ,and hence -ENXIO is returned indicating
no device or address.

[IA - combined two of santhosh's changes to the error return value!]

Signed-off-by: santhosh pai <santhosh.pai88@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: use CAP_SYS_ADMIN instead of CAP_NET_ADMIN
Ian Abbott [Tue, 7 Jul 2015 16:06:52 +0000 (17:06 +0100)]
staging: comedi: use CAP_SYS_ADMIN instead of CAP_NET_ADMIN

If the "comedi" module has been loaded with the
"comedi_num_legacy_minors" module parameter set to a non-zero value,
some reserved comedi devices get created.  These can be attached to a
low-level comedi driver using the `COMEDI_DEVCONFIG` ioctl command,
which checks for the `CAP_SYS_ADMIN` capability.  Of course, the comedi
device needs to be opened before the ioctl command can be sent.  If the
comedi device is unattached, `comedi_open()` currently requires the
`CAP_NET_ADMIN` capability.  It makes more sense to just require the
`CAP_SYS_ADMIN` capability here, so change it.

For the curious, commit a8f80e8ff94e ("Networking: use CAP_NET_ADMIN
when deciding to call request_module") changed this capability from
`CAP_SYS_MODULE` to `CAP_NET_ADMIN`, even though it doesn't seem
relevant here.  The original `CAP_SYS_MODULE` capability was due to the
function having some code to request a module using a "char-major-%i-%i"
alias, but that was never compiled in and was removed by commit
f30f2c2d417b ("staging: comedi: remove check for CONFIG_KMOD").

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: cb_pcimdas: add external analog output ranges
Ian Abbott [Tue, 7 Jul 2015 17:06:07 +0000 (18:06 +0100)]
staging: comedi: cb_pcimdas: add external analog output ranges

The analog output range is not programmable, but the ranges for each of
the two analog output channels are settable via jumpers.  These jumper
settings are not readable by the driver.  The driver
provides a range table containing all the possible internal ranges
(+/-10V, +/-5V, 0-10V, 0-5V) to provide information to the user
application (although any range selected by the application that differs
from the jumper settings will not produce the expected voltage output).

The range table does not cover all possible ranges of the analog output
channels.  The jumpers also allow an external reference voltage between
0 and 10V to be used as bipolar or unipolar output range.  Add a couple
more ranges to the end of the range table to define these two external
ranges.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: Grammar s/Enable support a/Enable support for a/
Geert Uytterhoeven [Mon, 6 Jul 2015 13:41:18 +0000 (15:41 +0200)]
staging: comedi: Grammar s/Enable support a/Enable support for a/

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: fix cast warning in comedi_compat32.c
Geliang Tang [Mon, 22 Jun 2015 15:33:42 +0000 (23:33 +0800)]
staging: comedi: fix cast warning in comedi_compat32.c

This patch fixes the following sparse warning:

drivers/staging/comedi/comedi_compat32.c:205:16: warning: cast removes
address space of expression

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: fix lines over 80 characters
Luis de Bethencourt [Mon, 22 Jun 2015 13:03:15 +0000 (15:03 +0200)]
staging: comedi: das16m1: fix lines over 80 characters

Warnings found by checkpatch.pl
WARNING: line over 80 characters
/drivers/staging/comedi/drivers/das16m1.c:414
+   if (devpriv->adc_count == 0 && hw_counter == devpriv->initial_hw_count) {

/drivers/staging/comedi/drivers/das16m1.c:417
/drivers/staging/comedi/drivers/das16m1.c:418
/drivers/staging/comedi/drivers/das16m1.c:419
/drivers/staging/comedi/drivers/das16m1.c:420
/drivers/staging/comedi/drivers/das16m1.c:421

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: no space before tabs
Luis de Bethencourt [Mon, 22 Jun 2015 13:02:36 +0000 (15:02 +0200)]
staging: comedi: das16m1: no space before tabs

Warning found by checkpatch.pl
WARNING: please, no space before tabs
/drivers/staging/comedi/drivers/das16m1.c:83
+  404-407 ^I8254$

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: s626: Simplify a trivial if-return sequence
Abdul Hussain [Mon, 22 Jun 2015 06:11:13 +0000 (06:11 +0000)]
Staging: comedi: s626: Simplify a trivial if-return sequence

This patch simplify a trivial if-return sequence. Possibly combine with
a preceding function call.

Signed-off-by: Abdul Hussain <habdul@visteon.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: ni_daq_dio24: Simplify a trivial if-return sequence
Abdul Hussain [Mon, 22 Jun 2015 06:11:09 +0000 (06:11 +0000)]
Staging: comedi: ni_daq_dio24: Simplify a trivial if-return sequence

This patch simplify a trivial if-return sequence. Possibly combine with
a preceding function call.

Signed-off-by: Abdul Hussain <habdul@visteon.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: dac02: Simplify a trivial if-return sequence
Abdul Hussain [Mon, 22 Jun 2015 06:11:06 +0000 (06:11 +0000)]
Staging: comedi: dac02: Simplify a trivial if-return sequence

This patch simplify a trivial if-return sequence. Possibly combine with
a preceding function call.

Signed-off-by: Abdul Hussain <habdul@visteon.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: fl512: Simplify a trivial if-return sequence
Abdul Hussain [Mon, 22 Jun 2015 06:10:59 +0000 (06:10 +0000)]
Staging: comedi: fl512: Simplify a trivial if-return sequence

This patch simplify a trivial if-return sequence. Possibly combine with
a preceding function call.

Signed-off-by: Abdul Hussain <habdul@visteon.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: dmm32at: Simplify a trivial if-return sequence
Abdul Hussain [Mon, 22 Jun 2015 06:10:56 +0000 (06:10 +0000)]
Staging: comedi: dmm32at: Simplify a trivial if-return sequence

This patch simplify a trivial if-return sequence. Possibly combine with
a preceding function call.

Signed-off-by: Abdul Hussain <habdul@visteon.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das08_cs: don't split Author string
Luis de Bethencourt [Mon, 22 Jun 2015 12:14:35 +0000 (14:14 +0200)]
staging: comedi: das08_cs: don't split Author string

fixes checkpatch.pl WARNING: quoted string split across lines

+MODULE_AUTHOR("David A. Schleef <ds@schleef.org>, "
+             "Frank Mori Hess <fmhess@users.sourceforge.net>");

Modules with multiple authors have a MODULE_AUTHOR line for each one.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: android: ion_chunk_heap.c: Fixed line over 80 characters
Guillermo O. Freschi [Sun, 21 Jun 2015 08:28:55 +0000 (05:28 -0300)]
staging: android: ion_chunk_heap.c: Fixed line over 80 characters

Simple style fix.

Signed-off-by: Guillermo O. Freschi <kedrot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: android: ion: reorder variable definitions
Dmitry Kalinkin [Mon, 13 Jul 2015 12:50:30 +0000 (15:50 +0300)]
staging: android: ion: reorder variable definitions

Prevents false positive "missing empty line after a definition"
checkpatch warning.

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Deletion of unnecessary checks before three function calls
Markus Elfring [Tue, 14 Jul 2015 07:35:42 +0000 (09:35 +0200)]
staging: lustre: Deletion of unnecessary checks before three function calls

The following functions test whether their argument is NULL and then
return immediately.
* kfree
* ll_file_data_put
* ptlrpc_connection_put

Thus the test around such calls is not needed.

This issue was detected by using the Coccinelle software.

See also a previous update suggestion:
"remove unneeded null test before free" by Julia Lawall
https://lkml.org/lkml/2015/5/1/498
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg878600.html

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix whitespace coding style issues in libcfs/module.c
Lukasz Janyst [Tue, 14 Jul 2015 15:22:21 +0000 (17:22 +0200)]
staging: lustre: fix whitespace coding style issues in libcfs/module.c

This is a patch to the libcfs/module.c file fixing whitespace warnings
found by checkpatch.pl.

Signed-off-by: Lukasz Janyst <lj@buggybrain.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: Fix kstrtouint return value check fix
Oleg Drokin [Tue, 14 Jul 2015 03:17:57 +0000 (23:17 -0400)]
staging/lustre/libcfs: Fix kstrtouint return value check fix

Apparently kstrtouint could return not just -EINVAL, but also -ERANGE,
so make sure we just check the return value for something negative.

Noticed by Dan Carpenter <dan.carpenter@oracle.com>

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: remove unused portal_enter_debugger variable
Dmitry Eremin [Tue, 14 Jul 2015 03:17:56 +0000 (23:17 -0400)]
staging/lustre/libcfs: remove unused portal_enter_debugger variable

Remove portal_enter_debugger because it's not used any more.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: get rid of debugfs/lnet/console_{min, max}_delay_centisecs
Dmitry Eremin [Tue, 14 Jul 2015 03:17:55 +0000 (23:17 -0400)]
staging/lustre/libcfs: get rid of debugfs/lnet/console_{min, max}_delay_centisecs

They are just fancy module parameters wrappers,
so just the same functionality now would be accessible via
/sys/module/libcfs/parameters/libcfs_console_{min,max}_delay

Also install compatibility symlinks

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: get rid of debugfs/lnet/debug_mb
Oleg Drokin [Tue, 14 Jul 2015 03:17:54 +0000 (23:17 -0400)]
staging/lustre/libcfs: get rid of debugfs/lnet/debug_mb

It's just a fancy libcfs_debug_mb module parameter wrapper,
so just add debug buffer size check and resizing and the same
functionality now would be accessible via
/sys/module/libcfs/parameters/libcfs_debug_mb

Also add a symlink for backwards compatibility.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: move assignment out of conditional
Perry Hooker [Mon, 13 Jul 2015 23:33:47 +0000 (17:33 -0600)]
staging: lustre: libcfs: move assignment out of conditional

Found by checkpatch.pl

Signed-off-by: Perry Hooker <perry.hooker@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: fixed a blank line after declarations coding style issue
Ronit Halder [Fri, 10 Jul 2015 17:35:39 +0000 (23:05 +0530)]
Staging: lustre: fixed a blank line after declarations coding style issue

Fixed a blank line after declarations coding style issue

Signed-off-by: Ronit Halder <ronit.crj@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: lustre: obdclass: genops: fixed brace coding style issues
Kris Baumann [Thu, 9 Jul 2015 20:12:48 +0000 (22:12 +0200)]
Staging: lustre: lustre: obdclass: genops: fixed brace coding style issues

Fixed several brace coding style issues.

Signed-off-by: Kris Baumann <krisbaumann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:lustre: fix "space required after that ', '" error in cl_page.c
Anders Fridlund [Thu, 9 Jul 2015 09:02:09 +0000 (11:02 +0200)]
staging:lustre: fix "space required after that ', '" error in cl_page.c

This is a patch to the cl_page.c file that fixes a
"space required after that ','" error found by the checkpatch.pl tool.

Signed-off-by: Anders Fridlund <anders.fridlund@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make ptlrpc_init static
Matt Mooney [Wed, 8 Jul 2015 16:21:11 +0000 (09:21 -0700)]
staging: lustre: make ptlrpc_init static

fix sparse warning in lustre/ptlrpc/ptlrpc_module.c:54:12:
     warning: symbol 'ptlrpc_init' was not declared. Should it be static?

The __init macro is moved before the function name to match standard usage.

Signed-off-by: Matt Mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove dead code
Hari Prasath Gujulan Elango [Wed, 8 Jul 2015 13:34:36 +0000 (13:34 +0000)]
staging: lustre: remove dead code

This patch removes commented code.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: Remove unneeded lnet watchdog_ratelimit sysctl
Dmitry Eremin [Mon, 6 Jul 2015 16:48:55 +0000 (12:48 -0400)]
staging/lustre/libcfs: Remove unneeded lnet watchdog_ratelimit sysctl

It is no longer used anywhere.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: Remove redundant enums and sysctl moduleparams
Dmitry Eremin [Mon, 6 Jul 2015 16:48:54 +0000 (12:48 -0400)]
staging/lustre/libcfs: Remove redundant enums and sysctl moduleparams

/proc/sys/lnet/lnet_memused
Remove memory tracking for LNet.
Remove redundant enums definition.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: get rid of debugfs/lnet/console_backoff
Oleg Drokin [Mon, 6 Jul 2015 16:48:53 +0000 (12:48 -0400)]
staging/lustre/libcfs: get rid of debugfs/lnet/console_backoff

module parameter libcfs_console_backoff accessible through
/sys/module/libcfs/parameters/libcfs_console_backoff would
do the same thing, just add a special "uintpos" parameter
type to disallow 0 values too.
Also add a symlink to the module parameter variable for
backwards compatibility

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: Remove redundant lnet debugfs variables
Oleg Drokin [Mon, 6 Jul 2015 16:48:52 +0000 (12:48 -0400)]
staging/lustre/libcfs: Remove redundant lnet debugfs variables

/proc/sys/lnet/console_ratelimit, debug_path and panic_on_lbug
are module parameters with no special magic accessible via
/sys/module/libcfs/parameters/libcfs_console_ratelimit,
/sys/module/libcfs/parameters/libcfs_debug_file_path and
/sys/module/libcfs/parameters/libcfs_panic_on_lbug respectively.

As such just replace them with corresponding symlinks

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: move /proc/sys/lnet to debugfs
Oleg Drokin [Mon, 6 Jul 2015 16:48:51 +0000 (12:48 -0400)]
staging/lustre/libcfs: move /proc/sys/lnet to debugfs

Parameters in lnet sysctl are of debug quantity, so let's move them
to debugfs instead.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Get rid of remaining /proc/sys/lustre plumbing
Oleg Drokin [Mon, 6 Jul 2015 16:48:50 +0000 (12:48 -0400)]
staging/lustre: Get rid of remaining /proc/sys/lustre plumbing

Since all of the variables from /proc/sys/lustre were moved to
/sys/fs/lustre, get rid of the remaining infrastructure.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/obdclass: Move AT controls from sysctl to sysfs
Oleg Drokin [Mon, 6 Jul 2015 16:48:49 +0000 (12:48 -0400)]
staging/lustre/obdclass: Move AT controls from sysctl to sysfs

Adaptive Timeouts controls are being moved from /proc/sys/lustre
to /sys/fs/lustre

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/obdclass: move debug controls to sysfs
Oleg Drokin [Mon, 6 Jul 2015 16:48:48 +0000 (12:48 -0400)]
staging/lustre/obdclass: move debug controls to sysfs

debug_peer_on_timeout, dump_on_timeout and dump_on_eviction
controls from /proc/sys/lustre to /sys/fs/lustre

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/obdclass: move max_dirty_mb from sysctl to sysfs
Oleg Drokin [Mon, 6 Jul 2015 16:48:47 +0000 (12:48 -0400)]
staging/lustre/obdclass: move max_dirty_mb from sysctl to sysfs

max_dirty_mb is now a parameter in /sys/fs/lustre/

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/obdclass: move sysctl timeout to sysfs
Oleg Drokin [Mon, 6 Jul 2015 16:48:46 +0000 (12:48 -0400)]
staging/lustre/obdclass: move sysctl timeout to sysfs

This is the first step of moving lustre sysctls from
/proc/sys/lustre to /sys/fs/lustre

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Remove unneeded ldlm_timeout control
Oleg Drokin [Mon, 6 Jul 2015 16:48:45 +0000 (12:48 -0400)]
staging/lustre: Remove unneeded ldlm_timeout control

ldlm_timeout is used server-side to determine AST timeouts,
so it makes no sense on the client, esp. since it's not really used
anywhere.
Remove all traces of it except from the config where make
it a noop.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Remove now obsolete memory tracking sysctls
Oleg Drokin [Mon, 6 Jul 2015 16:48:44 +0000 (12:48 -0400)]
staging/lustre: Remove now obsolete memory tracking sysctls

In the past when Lustre did its own allocation amounts tracking
the results were shown in sysctl as current and overall max
number of bytes and pages allocated. Now that we don't
track these, remove the sysctls.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: remove alloc_fail_rate sysctl
Oleg Drokin [Mon, 6 Jul 2015 16:48:43 +0000 (12:48 -0400)]
staging/lustre: remove alloc_fail_rate sysctl

It was used to control allocation failure rate, but there is
in-kernel way of doing that that's more versatile too.

This is going to remove just the sysctl, the underlying variable
will be removed once all OBD_ALLOC* macros removal patchseries land.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/obdclass: fix class_procfs_init error return value
Oleg Drokin [Mon, 6 Jul 2015 16:48:42 +0000 (12:48 -0400)]
staging/lustre/obdclass: fix class_procfs_init error return value

Dan Carpenter noticed that procfs conversion patches introduced
a bug where should kobject_create_and_add, an error is not returned
from class_procfs_init.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/ldlm: In ldlm_pools_fini make sure there was init first.
Oleg Drokin [Mon, 6 Jul 2015 16:48:41 +0000 (12:48 -0400)]
staging/lustre/ldlm: In ldlm_pools_fini make sure there was init first.

It turns out if you call ldlm_pools_fini without completing the
ldlm_pools_init, then attempt to unregister not yet registered
shrinkers makes the kernel very unhappy.
So make sure we have them registered first.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: make ldebugfs_remove recursive
Oleg Drokin [Mon, 6 Jul 2015 16:48:40 +0000 (12:48 -0400)]
staging/lustre: make ldebugfs_remove recursive

ldebugfs_remove is usually called on directories with files passed in
as attributes, so simple debugfs_remove failes on them as not empty
Switch to debugfs_remove_recursive.

This fixes a number of problems where a new filesystem is mounted after
being unmounted first.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lov: Move target sysfs symlink removal to LOV freeing
Oleg Drokin [Wed, 24 Jun 2015 14:09:24 +0000 (10:09 -0400)]
staging/lustre/lov: Move target sysfs symlink removal to LOV freeing

This helps to avoid use after free on unmount.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lnet: Move asm/irq.h include after linux includes
Oleg Drokin [Wed, 24 Jun 2015 14:07:45 +0000 (10:07 -0400)]
staging/lustre/lnet: Move asm/irq.h include after linux includes

Apparently m86k cannot build if you include asm/irq.h before
linux/* includes and fixing it there is hard.
So just move asm/irq.h include to where it does not cause any problems.

Thanks to Geert Uytterhoeven for getting to the root of it.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Compile-Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: drop trivially useless initialization
Julia Lawall [Sat, 20 Jun 2015 19:07:49 +0000 (21:07 +0200)]
staging: lustre: libcfs: drop trivially useless initialization

Remove initialization of a variable that is immediately reassigned.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: llog: drop trivially useless initialization
Julia Lawall [Sat, 20 Jun 2015 19:07:52 +0000 (21:07 +0200)]
staging: lustre: obdclass: llog: drop trivially useless initialization

Remove initialization of a variable that is immediately reassigned.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: drop trivially useless initialization
Julia Lawall [Sat, 20 Jun 2015 19:07:51 +0000 (21:07 +0200)]
staging: lustre: lmv: drop trivially useless initialization

Remove initialization of a variable that is immediately reassigned.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: osc: drop trivially useless initialization
Julia Lawall [Sat, 20 Jun 2015 19:07:53 +0000 (21:07 +0200)]
staging: lustre: osc: drop trivially useless initialization

Remove initialization of a variable that is immediately reassigned.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: drop trivially useless initialization
Julia Lawall [Sat, 20 Jun 2015 19:07:50 +0000 (21:07 +0200)]
staging: lustre: llite: drop trivially useless initialization

Remove initialization of a variable that is immediately reassigned.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ptlrpc: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:10 +0000 (18:59 +0200)]
staging: lustre: ptlrpc: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: osc: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:09 +0000 (18:59 +0200)]
staging: lustre: osc: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdecho: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:08 +0000 (18:59 +0200)]
staging: lustre: obdecho: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:07 +0000 (18:59 +0200)]
staging: lustre: obdclass: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: mgc: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:06 +0000 (18:59 +0200)]
staging: lustre: mgc: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: mdc: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:05 +0000 (18:59 +0200)]
staging: lustre: mdc: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lov: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:04 +0000 (18:59 +0200)]
staging: lustre: lov: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:03 +0000 (18:59 +0200)]
staging: lustre: lmv: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:02 +0000 (18:59 +0200)]
staging: lustre: ldlm: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lclient: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:01 +0000 (18:59 +0200)]
staging: lustre: lclient: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fld: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:59:00 +0000 (18:59 +0200)]
staging: lustre: fld: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fid: Use !x to check for kzalloc failure
Julia Lawall [Sat, 20 Jun 2015 16:58:59 +0000 (18:58 +0200)]
staging: lustre: fid: Use !x to check for kzalloc failure

!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agowilc1000: host_interface.c: global variables do not need to be explicitly initialized...
Daniel Machon [Mon, 6 Jul 2015 17:48:04 +0000 (19:48 +0200)]
wilc1000: host_interface.c: global variables do not need to be explicitly initialized to 0 or NULL.

Fixed explicit initialization of global pointer variable.

GCC takes care of this implicitly.

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:wilc1000: code cleanup Fix reported by coccinelle
Prasanna Karthik [Mon, 29 Jun 2015 12:43:32 +0000 (12:43 +0000)]
staging:wilc1000: code cleanup Fix reported by coccinelle

Removed {} for single statement if block

Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: switch printks to vsprintf IPv4 extension
Luis de Bethencourt [Fri, 26 Jun 2015 15:40:25 +0000 (17:40 +0200)]
staging: wilc1000: switch printks to vsprintf IPv4 extension

Switch printks with IP addresses to use vsprintf extension %pI4.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fix typos in PRINT_ERR()
Luis de Bethencourt [Fri, 26 Jun 2015 14:47:28 +0000 (16:47 +0200)]
staging: wilc1000: fix typos in PRINT_ERR()

Fix typo "packe" to "packet".

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove whitespaces before quoted newlines
Luis de Bethencourt [Fri, 26 Jun 2015 14:45:58 +0000 (16:45 +0200)]
staging: wilc1000: remove whitespaces before quoted newlines

Fix all checkpatch.pl warnings:
WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: add blank lines after declarations
Luis de Bethencourt [Fri, 26 Jun 2015 14:45:14 +0000 (16:45 +0200)]
staging: wilc1000: add blank lines after declarations

Fix all checkpatch.pl warnings:
WARNING: Missing a blank line after declarations

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>