GitHub/moto-9609/android_kernel_motorola_exynos9610.git
8 years agostaging: lustre: avoid race during lnet acceptor thread termination
Bruno Faccini [Mon, 22 Feb 2016 22:29:21 +0000 (17:29 -0500)]
staging: lustre: avoid race during lnet acceptor thread termination

This patch will avoid potential race, around socket sleepers
wait list, during acceptor thread termination and using
sk_callback_lock RW-Lock protection.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6476
Reviewed-on: http://review.whamcloud.com/14503
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer
Frank Zago [Mon, 22 Feb 2016 22:29:20 +0000 (17:29 -0500)]
staging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer

A lot of symbols don't need to be exported at all because they are
only used in the module they belong to.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5829
Reviewed-on: http://review.whamcloud.com/13320
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove messages from lazy portal on NI shutdown
Amir Shehata [Mon, 22 Feb 2016 22:29:19 +0000 (17:29 -0500)]
staging: lustre: remove messages from lazy portal on NI shutdown

When shutting down an NI in a busy system, some messages received
on this NI, might be on the lazy portal.  They would have grabbed
a ref count on the NI.  Therefore NI will not be removed until
messages are processed.

In order to avoid this scenario, when an NI is shutdown go through
all messages queued on the lazy portal and drop messages for the
NI being shutdown

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6040
Reviewed-on: http://review.whamcloud.com/13836
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: prevent assert on LNet module unload
Amir Shehata [Mon, 22 Feb 2016 22:29:18 +0000 (17:29 -0500)]
staging: lustre: prevent assert on LNet module unload

There is a use case where lnet can be unloaded while there are
no NIs configured.  Removing lnet in this case will cause
LNetFini() to be called without a prior call to LNetNIFini().
This will cause the LASSERT(the_lnet.ln_refcount == 0) to be
triggered.

To deal with this use case when LNet is configured a reference
count on the module is taken using try_module_get().  This way
LNet must be unconfigured before it could be removed; therefore
avoiding the above case.  When LNet is unconfigured module_put()
is called to return the reference count.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6010
Reviewed-on: http://review.whamcloud.com/13110
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: assume a kernel build
John L. Hammond [Mon, 22 Feb 2016 22:29:17 +0000 (17:29 -0500)]
staging: lustre: assume a kernel build

In lnet/lnet/ and lnet/selftest/ assume a kernel build (assume that
 __KERNEL__ is defined). Remove some common code only needed for user
space LNet.

Only part of the work of this patch got merged. This is the final
bits.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/13121
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: improvement to router checker
Amir Shehata [Mon, 22 Feb 2016 22:29:16 +0000 (17:29 -0500)]
staging: lustre: improvement to router checker

This patch starts router checker thread all the time.

The router checker only checks routes by ping if
live_router_check_interval or dead_router_check_interval are set
to something other than 0, and there are routes configured.

If these conditions are not met the router checker sleeps until woken
up when a route is added.  It is also woken up whenever the RC is
being stopped to ensure the thread doesn't hang.

In the future when DLC starts configuring the live and dead
router_check_interval parameters, then by manipulating them
the router checker can be turned on and off by the user.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6003
Reviewed-on: http://review.whamcloud.com/13035
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: handle lnet_check_routes() errors
Amir Shehata [Mon, 22 Feb 2016 22:29:15 +0000 (17:29 -0500)]
staging: lustre: handle lnet_check_routes() errors

After adding a route, lnet_check_routes() is called to ensure that
the route added doesn't invalidate the routing configuration.  If
lnet_check_routes() fails then the route just added, which caused the
current configuration to be invalidated is deleted, and an error
is returned to the user.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6218
Reviewed-on: http://review.whamcloud.com/13445
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: return -EEXIST if NI is not unique
Amir Shehata [Mon, 22 Feb 2016 22:29:14 +0000 (17:29 -0500)]
staging: lustre: return -EEXIST if NI is not unique

Return -EEXIST and not -EINVAL when trying to add a
network interface which is not unique.

Some minor cleanup in api-ni.c

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5875
Reviewed-on: http://review.whamcloud.com/13056
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: reject invalid net configuration for lnet
Amir Shehata [Mon, 22 Feb 2016 22:29:13 +0000 (17:29 -0500)]
staging: lustre: reject invalid net configuration for lnet

Currently if there exists a route that goes over a
remote net and then this net is added dynamically as
a local net, then traffic stops because the code in
lnet_send() determines that the destination nid
can be reached from another local_ni, but the src_nid
is still stuck on the earlier NI, because the src_nid
is stored in the ptlrpc layer and is not updated
when a local NI is configured.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5874
Reviewed-on: http://review.whamcloud.com/12912
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: startup lnet acceptor thread dynamically
Amir Shehata [Mon, 22 Feb 2016 22:29:12 +0000 (17:29 -0500)]
staging: lustre: startup lnet acceptor thread dynamically

With DLC it's possible to start up a system with no NIs that require
the acceptor thread, and thus it won't start.  Later on the user
can add an NI that requires the acceptor thread to start, it is
then necessary to start it up.

If the user removes a NI and as a result there are no more
NIs that require the acceptor thread then it should be stopped.
This patch adds logic in the dynamically adding and removing NIs
code to ensure the above logic is implemented.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6002
Reviewed-on: http://review.whamcloud.com/13010
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: missed a few cases of using NULL instead of 0
Frank Zago [Mon, 22 Feb 2016 22:29:11 +0000 (17:29 -0500)]
staging: lustre: missed a few cases of using NULL instead of 0

It is preferable to use NULL instead of 0 for pointers. This fixes sparse
warnings such as:

lustre/fld/fld_request.c:126:17: warning: Using plain integer as NULL pointer

The second parameter of class_match_param() was changed to a const, to
be able to remove a cast in one user, to prevent splitting a long
line. No other code change.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/12567
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make some lnet functions static
Frank Zago [Mon, 22 Feb 2016 22:29:10 +0000 (17:29 -0500)]
staging: lustre: make some lnet functions static

Some functions and variables are only used in their C file, so reduce
their scope. This reduces the code size, and fixes sparse warnings
such as:

warning: symbol 'proc_lnet_routes' was not declared.
        Should it be static?
warning: symbol 'proc_lnet_routers' was not declared.
        Should it be static?

Some prototypes were removed from C files and added to the proper
header.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/12206
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: return appropriate errno when adding route
Amir Shehata [Mon, 22 Feb 2016 22:29:09 +0000 (17:29 -0500)]
staging: lustre: return appropriate errno when adding route

When adding route it ignored specific scenarios, namely:
1. route already exists
2. route is on a local net
3. route is unreacheable

This patch returns the appropriate return codes from the lower level
function lnet_add_route(), and then ignores the above case from the
calling function, lnet_parse_route().  This is needed so we don't
halt processing routes in the module parameters.

However, we can now add routes dynamically, and it should be returned
to the user whether adding the requested route succeeded or failed.

In userspace it is determined whether to continue adding routes or to
halt processing.  Currently "lnetctl import < config" continues
adding the rest of the configuration and reports at the end which
operations passed and which ones failed.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6045
Reviewed-on: http://review.whamcloud.com/13116
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: improve LNet clean up code and API
Amir Shehata [Mon, 22 Feb 2016 22:29:08 +0000 (17:29 -0500)]
staging: lustre: improve LNet clean up code and API

This patch addresses a set of related issues: LU-5568, LU-5734,
LU-5839, LU-5849, LU-5850.

Create the local lnet_startup_lndni() API.  This function starts
up one LND.  lnet_startup_lndnis() calls this function in a loop
on every ni in the list passed in.  lnet_startup_lndni() is
responsible for cleaning up after itself in case of failure.
It calls lnet_free_ni() if the ni fails to start.  It calls
lnet_shutdown_lndni() if it successfully called the
lnd startup function, but fails later on.

lnet_startup_lndnis() also cleans up after itself.
If lnet_startup_lndni() fails then lnet_shutdown_lndnis() is
called to clean up all nis that might have been
started, and then free the rest of the nis on the list
which have not been started yet.

To facilitate the above changes lnet_dyn_del_ni() now
manages the ping info.  It calls lnet_shutdown_lndni(),
to shutdown the NI.  lnet_shutdown_lndni() is no longer
an exposed API and doesn't manage the ping info, making
it callable from lnet_startup_lndni() as well.

There are two scenarios for calling lnet_startup_lndni()

1. from lnet_startup_lndnis()
If lnet_startup_lndni() fails it requires to shutdown the ni
without doing anything with the ping information as it hasn't
been created yet.

2. from lnet_dyn_add_ni()
As above it will shutdown the ni, and then lnet_dyn_add_ni() will
take care of managing the ping info

The second part of this change is to ensure that the LOLND is not
added by lnet_parse_networks(), but the caller which needs to do
it (IE: LNetNIInit)

This change ensures that lnet_dyn_add_ni() need only check if there is
only one net that's being added, if not then it frees everything,
otherwise it proceeds to startup the requested net.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5734
Reviewed-on: http://review.whamcloud.com/12658
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove LUSTRE_{,SRV_}LNET_PID
John L. Hammond [Mon, 22 Feb 2016 22:29:07 +0000 (17:29 -0500)]
staging: lustre: remove LUSTRE_{,SRV_}LNET_PID

Remove LUSTRE_LNET_PID (12354) and LUSTRE_SRV_LNET_PID (12345) from
the libcfs headers and replace their uses with a new macro
LNET_PID_LUSTRE (also 12345) in lnet/types.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11985
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make local functions static for LNet ni
Frank Zago [Mon, 22 Feb 2016 22:29:06 +0000 (17:29 -0500)]
staging: lustre: make local functions static for LNet ni

The function lnet_unprepare can be made static.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11306
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: DLC user/kernel space glue code
Amir Shehata [Mon, 22 Feb 2016 22:29:05 +0000 (17:29 -0500)]
staging: lustre: DLC user/kernel space glue code

This is the sixth patch of a set of patches that enables DLC.

This patch enables the user space to call into the kernel space
DLC code.  Added handlers in the LNetCtl function to call
the new functions added for Dynamic Lnet Configuration

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456
Reviewed-on: http://review.whamcloud.com/8023
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix crash due to NULL networks string
Amir Shehata [Mon, 22 Feb 2016 22:29:04 +0000 (17:29 -0500)]
staging: lustre: fix crash due to NULL networks string

If there is an invalid networks or ip2nets lnet_parse_networks()
gets called with a NULL 'network' string parameter

lnet_parse_networks() needs to sanitize its input string now that
it's being called from multiple places.  Instead, check for
a NULL string everytime the function is called, which reduces the
probability of errors with other code modifications.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5540
Reviewed-on: http://review.whamcloud.com/11626
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Dynamic LNet Configuration (DLC) show command
Amir Shehata [Mon, 22 Feb 2016 22:29:03 +0000 (17:29 -0500)]
staging: lustre: Dynamic LNet Configuration (DLC) show command

This is the fifth patch of a set of patches that enables DLC.

This patch adds the new structures which will be used
in the IOCTL communication.  It also added a set of
show operations to show buffers, networks, statistics
and peer information.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456
Reviewed-on: http://review.whamcloud.com/8022
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes
Amir Shehata [Mon, 22 Feb 2016 22:29:02 +0000 (17:29 -0500)]
staging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes

This is the fourth patch of a set of patches that enables DLC.

This patch changes the IOCTL infrastructure in preparation of
adding extra IOCTL communication between user and kernel space.
The changes include:
- adding a common header to be passed to ioctl infra functions
  instead of passing an exact structure.  This header is meant
  to be included in all structures to be passed through that
  interface.  The IOCTL handler casts this header to a particular
  type that it expects
- All sanity testing on the past in structure is performed in the
  generic ioctl infrastructure code.
- All ioctl handlers changed to take the header instead of a
  particular structure type

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456
Reviewed-on: http://review.whamcloud.com/8021
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoMerge char-misc-next into staging-next
Greg Kroah-Hartman [Mon, 22 Feb 2016 22:46:24 +0000 (14:46 -0800)]
Merge char-misc-next into staging-next

This resolves the merge issues and confusions people were having with
the goldfish drivers due to changes for them showing up in two different
trees.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wfi_netdevice: Remove header files
Amitoj Kaur Chawla [Mon, 22 Feb 2016 08:44:24 +0000 (14:14 +0530)]
staging: wilc1000: wilc_wfi_netdevice: Remove header files

Remove duplicate header files. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Remove header file
Amitoj Kaur Chawla [Mon, 22 Feb 2016 08:44:17 +0000 (14:14 +0530)]
staging: wilc1000: Remove header file

Remove duplicate header file. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: Remove header files
Amitoj Kaur Chawla [Mon, 22 Feb 2016 08:44:10 +0000 (14:14 +0530)]
staging: sm750fb: Remove header files

Remove duplicate include files. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8188eu: os_dep: Remove header file
Amitoj Kaur Chawla [Mon, 22 Feb 2016 08:44:04 +0000 (14:14 +0530)]
staging: rtl8188eu: os_dep: Remove header file

Remove duplicate include file. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rdma: hfi1: Remove header file
Amitoj Kaur Chawla [Mon, 22 Feb 2016 08:43:58 +0000 (14:13 +0530)]
staging: rdma: hfi1: Remove header file

Remove duplicate include file. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: Remove header file
Amitoj Kaur Chawla [Mon, 22 Feb 2016 08:43:49 +0000 (14:13 +0530)]
staging: lustre: obdclass: Remove header file

Remove duplicate include file. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: emxx_udc: Remove header file
Amitoj Kaur Chawla [Mon, 22 Feb 2016 08:43:44 +0000 (14:13 +0530)]
staging: emxx_udc: Remove header file

Remove duplicate include file. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Check for quoted strings broken across lines
Anchal Jain [Sun, 21 Feb 2016 16:49:05 +0000 (22:19 +0530)]
staging: wilc1000: Check for quoted strings broken across lines

checkpatch warn about quoted strings split across lines.
So, convert multi-line string into a single line.

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes linux_wlan_common.h file
Chris Park [Mon, 22 Feb 2016 04:41:19 +0000 (13:41 +0900)]
staging: wilc1000: removes linux_wlan_common.h file

This patch removes linux_wlan_common.h file and also removes the following
preprocessor at files that include it:
 - #include 'linux_wlan_common.h'

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove useless define in linux_wlan_common.h file
Chris Park [Mon, 22 Feb 2016 04:41:18 +0000 (13:41 +0900)]
staging: wilc1000: remove useless define in linux_wlan_common.h file

This patch removes useless define in linux_wlan_common.h file

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: move MODALIS and GPIO_NUM define to wilc_wlan.h file
Chris Park [Mon, 22 Feb 2016 04:41:17 +0000 (13:41 +0900)]
staging: wilc1000: move MODALIS and GPIO_NUM define to wilc_wlan.h file

This patch moves MODALIS and GPIO_NUM define to wilc_wlan.h file.
MODALIS and GPIO_NUM define are used to two files (wilc_sdio.c,
wilc_spi.c), these files already include wilc_wlan.h file in common.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: move WILC_MULTICAST_TABLE_SIZE define to wilc_wlan_if.h file
Chris Park [Mon, 22 Feb 2016 04:41:16 +0000 (13:41 +0900)]
staging: wilc1000: move WILC_MULTICAST_TABLE_SIZE define to wilc_wlan_if.h file

This patch moves WILC_MULTICAST_TABLE_SIZE define to wilc_wlan_if.h file.
This define is used to three files(host_interface.c,host_interface.h,
linux_wlan.c) these files already include wilc_wlan_if.h file in common.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wlan_cfg_init: changes unused argument
Leo Kim [Mon, 22 Feb 2016 04:41:15 +0000 (13:41 +0900)]
staging: wilc1000: wilc_wlan_cfg_init: changes unused argument

This patch changes the argument of the wilc_wlan_cfg_init function,
wilc_debug to void type because wilc_debug function is not used any more.
In addition, finally removes wilc_debug and related variables.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unnecessary variable of wilc_mac_cfg_t structure
Leo Kim [Mon, 22 Feb 2016 04:41:14 +0000 (13:41 +0900)]
staging: wilc1000: removes unnecessary variable of wilc_mac_cfg_t structure

This patch removes unnecessary variable of wilc_mac_cfg_t structure.
The variable is debug print function pointer.
Removes all what used this variable.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unnecessary wilc_debug print log
Leo Kim [Mon, 22 Feb 2016 04:41:13 +0000 (13:41 +0900)]
staging: wilc1000: removes unnecessary wilc_debug print log

This patch removes unnecessary wilc_debug print log.
The print log was written when if condition fail.
The condition is chip-id check function.
Also, replaces this condition with normal function.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unnecessary wilc_debug print log
Leo Kim [Mon, 22 Feb 2016 04:41:12 +0000 (13:41 +0900)]
staging: wilc1000: removes unnecessary wilc_debug print log

This patch removes unnecessary wilc_debug print log and the check routine.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: replaces wilc_debug with netdev_err
Leo Kim [Mon, 22 Feb 2016 04:41:11 +0000 (13:41 +0900)]
staging: wilc1000: replaces wilc_debug with netdev_err

This patches replaces wilc_debug with netdev_err.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes wilc_dbg()
Leo Kim [Mon, 22 Feb 2016 04:41:10 +0000 (13:41 +0900)]
staging: wilc1000: removes wilc_dbg()

This patch removes wilc_dbg function because it's not any more.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: moves LINUX_RX_SIZE, LINUX_TX_SIZE
Chris Park [Mon, 22 Feb 2016 04:12:09 +0000 (13:12 +0900)]
staging: wilc1000: moves LINUX_RX_SIZE, LINUX_TX_SIZE

This patch moves LINUX_RX_SIZE and LINUX_TX_SIZE to wilc_wlan.h file
because there are only used to wilc_wlan.c file.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: moves to define values
Chris Park [Mon, 22 Feb 2016 04:12:08 +0000 (13:12 +0900)]
staging: wilc1000: moves to define values

This patch moves DEBUG, INFO, WRN and ERR values to wilc_debugfs.c file
because this is only used to wilc_debugfs.c file.
And, removes unnecessary WILC_DEBUGFS and else-case variables.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes usused PRINT_XX(region...)
Chris Park [Mon, 22 Feb 2016 04:12:07 +0000 (13:12 +0900)]
staging: wilc1000: removes usused PRINT_XX(region...)

This patch removes unused PRINT_XX(region...)
because already removed in used to region feature of whole wilc source.
Also, removes unnecessary related region extern variable.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unused region feature
Chris Park [Mon, 22 Feb 2016 04:12:06 +0000 (13:12 +0900)]
staging: wilc1000: removes unused region feature

This patch removes unused region feature on debug message.
Also, removes the functions of related in this feature.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wlan.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:12:05 +0000 (13:12 +0900)]
staging: wilc1000: wilc_wlan.c: removes unnecessary log messages

This patch removes unnecessary log messages.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:12:04 +0000 (13:12 +0900)]
staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

This patch removes unnecessary log messages.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:12:03 +0000 (13:12 +0900)]
staging: wilc1000: linux_wlan.c: removes unnecessary log messages

This patch removes unnecessary log messages.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: host_interface.c: replace PRINT_ER with netdev_err
Chris Park [Mon, 22 Feb 2016 04:12:02 +0000 (13:12 +0900)]
staging: wilc1000: host_interface.c: replace PRINT_ER with netdev_err

This patch replaces PRINT_ER with netdev_err.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: host_interface.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:12:01 +0000 (13:12 +0900)]
staging: wilc1000: host_interface.c: removes unnecessary log messages

This patch removes unnecessary log messages.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: coreconfigurator.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:12:00 +0000 (13:12 +0900)]
staging: wilc1000: coreconfigurator.c: removes unnecessary log messages

This patch removes unnecessary log messages.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unused CFG80211_DBG tag
Chris Park [Mon, 22 Feb 2016 04:11:59 +0000 (13:11 +0900)]
staging: wilc1000: removes unused CFG80211_DBG tag

This patch removes unused CFG80211_DBG tag.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:11:58 +0000 (13:11 +0900)]
staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

This patch removes unnecessary log messages.
And, it adds a 'break' statement in accordance with the switch-case rule.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:11:57 +0000 (13:11 +0900)]
staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

This patch removes unnecessary log messages and relate variables.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: host_interface.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:11:56 +0000 (13:11 +0900)]
staging: wilc1000: host_interface.c: removes unnecessary log messages

This patch removes unnecessary log message and relate variables.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unused HOSTAPD_DBG tag
Chris Park [Mon, 22 Feb 2016 04:11:55 +0000 (13:11 +0900)]
staging: wilc1000: removes unused HOSTAPD_DBG tag

This patch removes unused HOSTAPD_DBG tag.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages
Chris Park [Mon, 22 Feb 2016 04:11:54 +0000 (13:11 +0900)]
staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages

This patch removes the unnecessary log messages which is used with
the HOSTAPD_DBG tag.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_mon.c: removes comments
Chris Park [Mon, 22 Feb 2016 04:11:53 +0000 (13:11 +0900)]
staging: wilc1000: linux_mon.c: removes comments

This patch removes unnecessary comments.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_mon.c: removes unnecessary log message
Chris Park [Mon, 22 Feb 2016 04:11:52 +0000 (13:11 +0900)]
staging: wilc1000: linux_mon.c: removes unnecessary log message

This patch removes unnecessary log message and relate variables.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: host_interface.c: removes unnecessary log message
Chris Park [Mon, 22 Feb 2016 04:11:51 +0000 (13:11 +0900)]
staging: wilc1000: host_interface.c: removes unnecessary log message

This patch removes unnecessary log message and relate variables.

Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes potential null dereference
Leo Kim [Mon, 22 Feb 2016 04:11:50 +0000 (13:11 +0900)]
staging: wilc1000: removes potential null dereference

This patch removes the error reported by smatch.
 - wilc_wfi_cfgoperations.c:674 scan() error:
   potential null dereference 'strHiddenNetwork.net_info'.  (kmalloc returns null)

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_mon.c: add to check routine
Leo Kim [Mon, 22 Feb 2016 04:11:49 +0000 (13:11 +0900)]
staging: wilc1000: linux_mon.c: add to check routine

This patch adds the return value which needs the check and
prints the error message when it fails.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err
Leo Kim [Mon, 22 Feb 2016 04:11:48 +0000 (13:11 +0900)]
staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err

This patches replaces PRINT_ER with netdev_err.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_mon.c: removes debug logs
Leo Kim [Mon, 22 Feb 2016 04:11:47 +0000 (13:11 +0900)]
staging: wilc1000: linux_mon.c: removes debug logs

This patches removes unnecessary debug logs.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_wlan.c: removes PRINT_ER
Leo Kim [Mon, 22 Feb 2016 04:11:46 +0000 (13:11 +0900)]
staging: wilc1000: wilc_wlan.c: removes PRINT_ER

This patches removes PRINT_ER that is unnecessary debug logs.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: Remove wrapper function put_event_entry
Shraddha Barke [Wed, 17 Feb 2016 12:33:38 +0000 (18:03 +0530)]
Staging: gdm72xx: Remove wrapper function put_event_entry

put_event_entry is used only once. Replace it's usage with direct call
to list_add_tail().

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: Remove unnecessary parenthesis around function pointer
Shraddha Barke [Wed, 17 Feb 2016 12:32:34 +0000 (18:02 +0530)]
Staging: gdm72xx: Remove unnecessary parenthesis around function pointer

No need for the parentheses around any function pointer.
Detected using checkpatch.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: Add space around that "+", "&" and "/"
Shraddha Barke [Wed, 17 Feb 2016 12:31:26 +0000 (18:01 +0530)]
Staging: gdm72xx: Add space around that "+", "&" and "/"

Add missing spaces around "+", "&" and "/" to follow kernel coding
style. Warning detected by checkpatch.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: Add space around that "+", "&" and "|"
Shraddha Barke [Wed, 17 Feb 2016 12:30:45 +0000 (18:00 +0530)]
Staging: gdm72xx: Add space around that "+", "&" and "|"

Add missing spaces around "+", "&" and "|" to follow kernel coding
style. Warning detected by checkpatch.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Fix comparisons to NULL
Shaun Ren [Mon, 15 Feb 2016 18:58:54 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Fix comparisons to NULL

This patch changes all comparsions to NULL with !..., as reported by
checkpatch.pl.

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Remove unnecessary parentheses
Shaun Ren [Mon, 15 Feb 2016 18:58:53 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Remove unnecessary parentheses

This patch removes all unnecessary parentheses found by checkpatch.pl.

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Fix label naming convention
Shaun Ren [Mon, 15 Feb 2016 18:58:52 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Fix label naming convention

This patch fixes the following naming convention issue in rtsx_transport.c,
as reported by checkpatch.pl:

CHECK: Avoid CamelCase: <Handle_Errors>

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Remove extra newlines
Shaun Ren [Mon, 15 Feb 2016 18:58:51 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Remove extra newlines

This patch fixes the following issues in rtsx_transport.c as reported by
checkpatch.pl:

CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Please don't use multiple blank lines

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Add spaces around -
Shaun Ren [Mon, 15 Feb 2016 18:58:50 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Add spaces around -

This patch fixes the following styling issue in rtsx_transport.c
as reported by checkpatch.pl:

CHECK: spaces preferred around that '-' (ctx:VxV)

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Remove spaces after casts
Shaun Ren [Mon, 15 Feb 2016 18:58:49 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Remove spaces after casts

This patch removes all spaces after casts in rtsx_transport.c, as reported
by checkpatch.pl:

CHECK: No space is necessary after a cast

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Align to open parenthesis
Shaun Ren [Mon, 15 Feb 2016 18:58:48 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Align to open parenthesis

This patch fixes the alignment issue reported by checkpatch.pl:

CHECK: Alignment should match open parenthesis

Add a unsigned char *sgbuffer in rtsx_stor_access_xfer_buffer to make the
following memcpy logic easier to read.

Add a struct scatterlist *sg in the use_sg branch of
rtsx_transfer_data_partial to make the parameters of the
rtsx_transfer_sglist_adma_partial call fit in 80 character lines after
aligning them to the open parenthesis.

Refactor memcpy logic in rtsx_stor_access_xfer_buf to make it more legible.

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rts5208: rtsx_transport.c: Cleanup comments
Shaun Ren [Mon, 15 Feb 2016 18:58:47 +0000 (10:58 -0800)]
Staging: rts5208: rtsx_transport.c: Cleanup comments

This patch fixes all multiline comments to conform to the coding style,
which states that multiline comments should start with "/*" and end
with "*/" on a separate line.

Also cleans up some comments to make them more clear and/or reflect what
the code is doing.

Signed-off-by: Shaun Ren <shaun.ren@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: remove sm750_help.h
Mike Rapoport [Fri, 19 Feb 2016 15:56:15 +0000 (17:56 +0200)]
staging: sm750fb: remove sm750_help.h

This header only contains unused FIELD_*() macros and friends and may be
removed

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: move MHz() and roundedDiv() close to their usage
Mike Rapoport [Fri, 19 Feb 2016 15:56:14 +0000 (17:56 +0200)]
staging: sm750fb: move MHz() and roundedDiv() close to their usage

The MHz() and roundedDiv macros are used only by ddk750_chip.c, so move
their definition there.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: replace absDiff with kernel standard abs macro
Mike Rapoport [Fri, 19 Feb 2016 15:56:13 +0000 (17:56 +0200)]
staging: sm750fb: replace absDiff with kernel standard abs macro

<linux/kernel.h> already has 'abs', use it instead of custom absDiff

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750: change definition of multi-bit register fields
Mike Rapoport [Fri, 19 Feb 2016 15:56:12 +0000 (17:56 +0200)]
staging: sm750: change definition of multi-bit register fields

Use stratigh-forward of multi-bit register fields

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: sm750fb: use BIT() macro for single-bit fields definition
Mike Rapoport [Fri, 19 Feb 2016 15:56:11 +0000 (17:56 +0200)]
staging: sm750fb: use BIT() macro for single-bit fields definition

Replace complex definition of single-bit fields with BIT() macro for the
registers that are not currently referenced by the driver.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: nvec: Fix alignment with the open parenthesis
Laura Garcia Liebana [Sat, 20 Feb 2016 11:38:20 +0000 (12:38 +0100)]
staging: nvec: Fix alignment with the open parenthesis

Alignment should match open parenthesis. Checkpatch detected these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: nvec: Use the BIT macro
Laura Garcia Liebana [Sat, 20 Feb 2016 10:32:36 +0000 (11:32 +0100)]
staging: nvec: Use the BIT macro

Prefer using the BIT macro instead of (1 << X). Checkpatch detected this
issue.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: terminate "write" command when stopped
Ian Abbott [Fri, 19 Feb 2016 16:13:57 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: terminate "write" command when stopped

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the current
position.  An asynchronous command in the "read" direction is terminated
automatically once it has stopped and information about the final
position and error has been reported back to the user.  That is not
currently done for commands in the "write" direction.  Change it to
terminate the command in the "write" direction automatically.  If the
command stopped with an error, report an `EPIPE` error back to the user,
otherwise just report the final buffer position back to the user.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: return -EPIPE for abnormal read
Ian Abbott [Fri, 19 Feb 2016 16:13:56 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: return -EPIPE for abnormal read

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the current
position.  If an asynchronous command in the "read" direction has
stopped normally, the command is terminated as soon as the position has
been advanced to the end of all available data.  This is not currently
done if the command terminated with an error.  Change it to allow the
command to be terminated even if it stopped with an error, but report an
`EPIPE` error to the user first.  The `EPIPE` error will not be
reported until the "read" position reported back to the user has been
advanced to the end of all available data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: become non-busy even if bytes_read is 0
Ian Abbott [Fri, 19 Feb 2016 16:13:55 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: become non-busy even if bytes_read is 0

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the new
position.  On input, the `bytes_read` member of `struct comedi_bufinfo`
specified the amount to advance the "read" position for an asynchronous
command in the "read" direction.  If the command has already stopped
normally, and the "read" position has been advanced to the end of all
available data, the command is terminated by calling
`do_become_nonbusy()`.  (That is not currently done if the command
stopped with an error.)  Currently, the command is only terminated if
the user is trying to advance the "read" position by a non-zero amount.
Change it to allow the command to be terminated even if the user is not
trying to advance the "read" position.  This is justifiable, as the only
time a command stops without error is when it has been set up to read a
finite amount of data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: return error if no active command
Ian Abbott [Fri, 19 Feb 2016 16:13:54 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: return error if no active command

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer and/or get the current buffer position.  If no asynchronous
command is active (started via the file object that issued this ioctl),
this information is meaningless.  Change it to return an error
(`-EINVAL`) in this case.  Prior to this change, if a command was
started via a different file object, the ioctl returned `-EACCES`, but
now it will return `-EINVAL`, which is consistent with the current
behavior of the "read" and "write" file operation handlers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: force bytes_written to 0 if stopped
Ian Abbott [Fri, 19 Feb 2016 16:13:53 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: force bytes_written to 0 if stopped

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the new
position.  On input, the `bytes_written` member of `struct
comedi_bufinfo` specifies the amount to advance the "write" position for
an asynchronous command in the "write" direction.  On output, the member
indicates the amount the "write" position has actually been advanced.
Advancing the "write" position is current done even if the command has
stopped and cannot use any more written data.  Change it to force the
amount successfully written to 0 in that case.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: update buffer before becoming non-busy
Ian Abbott [Fri, 19 Feb 2016 16:13:52 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: update buffer before becoming non-busy

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the new
position.  For an asynchronous command in the "read" direction, if the
command has finished acquiring data normally, `do_become_nonbusy()` is
called to terminate the command.  That resets the buffer position, and
currently, the position information returned back to the user is after
the buffer has been reset.  It should be more useful to return the
buffer position before the reset, so move the call to
`do_become_nonbusy()` after the code that gets the updated buffer
position.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: force bytes_read or bytes_written to 0
Ian Abbott [Fri, 19 Feb 2016 16:13:51 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: force bytes_read or bytes_written to 0

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the new
position.  On input, the `bytes_read` member of `struct comedi_bufinfo`
specifies the amount to advance the "read" position for an asynchronous
command in the "read" direction, and the `bytes_written` member
specifies the amount to advance the "write" position for a command in
the "write" direction.  The handler `do_bufinfo_ioctl()` may adjust
these by the amount the position is actually advanced before copying
them back to the user.  Currently, it ignores the specified `bytes_read`
value for a command in the "write" direction, and ignores the specified
`bytes_written` for a command in the "read" direction, so the values
copied back to the user are unchanged.  Change it to force the ignored
value to 0 before copying the values back to the user.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: COMEDI_BUFINFO: get amount freed, not amount allocated
Ian Abbott [Fri, 19 Feb 2016 16:13:50 +0000 (16:13 +0000)]
staging: comedi: COMEDI_BUFINFO: get amount freed, not amount allocated

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the new
position.  On input, the `bytes_read` member of `struct comedi_bufinfo`
specifies the amount to advance the "read" position for an asynchronous
command in the "read" direction, and the `bytes_written` member
specifies the amount to advance the "write" position for a command in
the "write" direction.  The handler `do_bufinfo_ioctl()` may limit the
specified values according to amount of readable or writable space in
the buffer.  On output, the `struct comedi_bufinfo` is filled in with
the updated position information, along with the adjusted `bytes_read`
and `bytes_written` members.

Advancing the buffer position occurs in two steps: first, some buffer
space is allocated, and second, it is freed, advancing the current
"read" or "write" position.  Currently, `do_bufinfo_ioctl()` limits
`bytes_read` or `bytes_written` to the amount it could allocate in the
first step, but that is invisible and irrelevant to the ioctl user.
It's mostly irrelevant to the COMEDI internals as well, apart from
limiting how much can be freed in the second step.  Change it to ignore
how much it managed to allocate in the first step and just use the
amount that was actually freed in the second step, which is the amount
the current buffer position was actually moved by this ioctl call.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: Use DIV_ROUND_CLOSEST
Amitoj Kaur Chawla [Fri, 19 Feb 2016 15:27:15 +0000 (20:57 +0530)]
staging: comedi: drivers: Use DIV_ROUND_CLOSEST

The kernel.h macro DIV_ROUND_CLOSEST performs the computation
`(x +d/2)/d` but is perhaps more readable.

The Coccinelle script used is as follows:
// <smpl>
@@
expression x,__divisor;
@@
- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: Remove unnecessary else following return
Janani Ravichandran [Thu, 18 Feb 2016 22:48:17 +0000 (17:48 -0500)]
staging: comedi: drivers: Remove unnecessary else following return

Else is unnecessary when there is a return statement in the
corresponding if block.
Coccinelle patch:

@rule1@
expression e1;
@@

if (e1) { ... return ...; }
-       else{
        ...
-            }

@rule2@
expression e2;
statement s1;
@@

if(e2) { ... return ...; }
-       else
s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: android: Remove unneeded else following a return
Janani Ravichandran [Thu, 18 Feb 2016 22:39:11 +0000 (17:39 -0500)]
staging: android: Remove unneeded else following a return

Remove unnecessary else when there is a return statement in the
corresponding if block.
Coccinelle patch used:

@rule1@
expression e1;
@@

if (e1) { ... return ...; }
-       else{
        ...
-            }

@rule2@
expression e2;
statement s1;
@@

if(e2) { ... return ...; }
-       else
s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: mt29f_spinand: Remove unneeded else following return
Janani Ravichandran [Thu, 18 Feb 2016 22:28:07 +0000 (17:28 -0500)]
staging: mt29f_spinand: Remove unneeded else following return

Remove unnecessary else when there is a return statement in the
corresponding if block. Coccinelle patch used:
@rule1@
expression e1;
@@

        if (e1) { ... return ...; }
-       else{
         ...
-     }

@rule2@
expression e2;
statement s1;
@@

if(e2) { ... return ...; }
-       else
s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6656: simplify tests of successful urb status
Alison Schofield [Wed, 17 Feb 2016 17:45:28 +0000 (09:45 -0800)]
staging: vt6656: simplify tests of successful urb status

Use if (status) in tests for successful urb status.

This replaces (status != 0) and (status == STATUS_SUCCESS).
(STATUS_SUCCESS is defined for NDIS status in this driver, but
was being misused)

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8712: Replace explicit NULL comparison
Bhaktipriya Shridhar [Thu, 18 Feb 2016 18:54:30 +0000 (00:24 +0530)]
staging: rtl8712: Replace explicit NULL comparison

Replace explicit NULL comparison with ! operator.
Found with Coccinelle.

@@
expression e;
@@
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8712: reduce stack usage
Arnd Bergmann [Wed, 17 Feb 2016 08:32:58 +0000 (09:32 +0100)]
staging: rtl8712: reduce stack usage

The "translate_scan" function in rtl8712 uses a lot of stack, and
gets inlined into its single caller, r8711_wx_get_scan, which
in some configurations now blows the 1024 byte stack warning
limit:

drivers/staging/rtl8712/rtl871x_ioctl_linux.c: In function 'r8711_wx_get_scan':
drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1227:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This somewhat reduces the stack usage by moving the translate_scan
function out of line with the noinline_for_stack annotation.
It might be possible to modify translate_scan() a little further
to reduce the stack usage, but with this patch, we can build without
the warning, the the call chain to get here is rather predictable
(sys_ioctl->vfs_ioctl->sock_ioctl->dev_ioctl->wext_ioctl->
r8711_wx_get_scan).

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8712: Improve suspend/resume functionality.
Hemmo Nieminen [Fri, 19 Feb 2016 19:02:24 +0000 (21:02 +0200)]
staging: rtl8712: Improve suspend/resume functionality.

Fix a driver hang caused by earlier suspend/resume cycles. By handling a
ENODEV error during suspend as a real error we eventually end up stopping
the whole driver.

Fix this by handling the ENODEV error (during suspend) essentially by
retrying.

Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8712: Declare function as static
Amitoj Kaur Chawla [Tue, 16 Feb 2016 13:01:55 +0000 (18:31 +0530)]
staging: rtl8712: Declare function as static

Declare rtl871x_intf_resume() function static since it is defined and called
in this file only.

This fixes the following sparse warning:
warning: symbol 'rtl871x_intf_resume' was not declared. Should it be static?

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: fsl-mc: Remove unneeded else following a return
Janani Ravichandran [Thu, 18 Feb 2016 22:22:50 +0000 (17:22 -0500)]
staging: fsl-mc: Remove unneeded else following a return

Remove unnecessary else when there is a return statement in the
corresponding if block. Coccinelle patch used:

@rule1@
expression e1;
@@

if (e1) { ... return ...; }
-       else{
        ...
-       }

@rule2@
expression e2;
statement s1;
@@

if(e2) { ... return ...; }
-       else
               s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>