platform/kernel/linux-rpi.git
6 years agostaging: pi433: fix CamelCase for packetFormat enum
Valentin Vidic [Mon, 5 Mar 2018 07:02:14 +0000 (08:02 +0100)]
staging: pi433: fix CamelCase for packetFormat enum

Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <packetFormat>
  CHECK: Avoid CamelCase: <packetLengthFix>
  CHECK: Avoid CamelCase: <packetLengthVar>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoRevert "staging: Disable lustre file system for MIPS, SH, and XTENSA"
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
Revert "staging: Disable lustre file system for MIPS, SH, and XTENSA"

This reverts commit 16f1eeb660bd2bfd223704ee6350706b39c55a7a.

The reason for this patch was that lustre used copy_from_user_page.
Commit 76133e66b141 ("staging/lustre: Replace jobid acquiring with per
node setting") removed that usage.
So the arch restrictions can go.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: allow monolithic builds
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: allow monolithic builds

Remove restriction the lustre must be built
as modules.  It now works as a monolithic build.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ptlrpc: move thread creation out of module initialization
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: ptlrpc: move thread creation out of module initialization

When the ptlrpc module is loaded, it starts the pinger thread and
calls LNetNIInit which starts various threads.

We don't need these threads until the module is actually being
used, such as when a lustre filesystem is mounted.

So move the thread creation into new ptlrpc_inc_ref() (modeled on
ptlrpcd_inc_ref()), and call that when needed, such as at mount time.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: change sai_thread to sai_task.
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: change sai_thread to sai_task.

Rather than allocating a ptlrpc_thread for the
stat-ahead thread, just use the task_struct provided
by kthreads directly.

As nothing ever waits for the sai_task, it must call do_exit()
directly rather than simply return from the function.
Also it cannot use kthread_should_stop() to know when to stop.

There is one caller which can ask it to stop so we need a simple
signaling mechanism.  I've chosen to set ->sai_task to NULL
when the thread should finish up.  The thread notices this and
cleans up and exits.
lli_sa_lock is used to avoid races between waking up the process
and the process exiting.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove 'ptlrpc_thread usage' for sai_agl_thread
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: remove 'ptlrpc_thread usage' for sai_agl_thread

Lustre has a 'struct ptlrpc_thread' which provides
control functionality wrapped around kthreads.
None of the functionality used in statahead.c requires
ptlrcp_thread - it can all be done directly with kthreads.

So discard the ptlrpc_thread and just use a task_struct directly.

One particular change worth noting is that in the current
code, the thread performs some start-up actions and then
signals that it is ready to go.  In the new code, the thread
is first created, then the startup actions are perform, then
the thread is woken up.  This means there is no need to wait
any more than kthread_create() already waits.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove unused flag from ptlrpc_thread
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: remove unused flag from ptlrpc_thread

SVC_EVENT is no longer used.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ptlrpc: use workqueue for pinger
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: ptlrpc: use workqueue for pinger

lustre has a "Pinger" kthread which periodically pings peers
to ensure all hosts are functioning.

This can more easily be done using a work queue.

As maintaining contact with other peers is import for
keeping the filesystem running, and as the filesystem might
be involved in freeing memory, it is safest to have a
separate WQ_MEM_RECLAIM workqueue.

The SVC_EVENT functionality to wake up the thread can be
replaced with mod_delayed_work().

Also use round_jiffies_up_relative() rather than setting a
minimum of 1 second delay.  The PING_INTERVAL is measured in
seconds so this meets the need is allow the workqueue to
keep wakeups synchronized.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ptlrpc: use delayed_work in sec_gc
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: ptlrpc: use delayed_work in sec_gc

The garbage collection for security contexts currently
has a dedicated kthread which wakes up every 30 minutes
to discard old garbage.

Replace this with a simple delayed_work item on the
system work queue.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ldlm: use delayed_work for pools_recalc
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: ldlm: use delayed_work for pools_recalc

ldlm currenty has a kthread which wakes up every so often
and calls ldlm_pools_recalc().
The thread is started and stopped, but no other external interactions
happen.

This can trivially be replaced by a delayed_work if we have
ldlm_pools_recalc() reschedule the work rather than just report
when to do that.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: use workqueue for zombie management.
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: obdclass: use workqueue for zombie management.

obdclass currently maintains two lists of data structures
(imports and exports), and a kthread which will free
anything on either list.  The thread is woken whenever
anything is added to either list.

This is exactly the sort of thing that workqueues exist for.

So discard the zombie kthread and the lists and locks, and
create a single workqueue.  Each obd_import and obd_export
gets a work_struct to attach to this workqueue.

This requires a small change to import_sec_validate_get()
which was testing if an obd_import was on the zombie
list.  This cannot have every safely found it to be
on the list (as it could be freed asynchronously)
so it must be dead code.

We could use system_wq instead of creating a dedicated
zombie_wq, but as we occasionally want to flush all pending
work, it is a little nicer to only have to wait for our own
work items.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ptlrpc: change GFP_NOFS to GFP_KERNEL
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: ptlrpc: change GFP_NOFS to GFP_KERNEL

These allocations are performed during initialization,
so they don't need GFP_NOFS.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: get entropy from nid when nid set.
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: get entropy from nid when nid set.

When the 'lustre' module is loaded, it gets a list of
net devices and uses the node ids to  add entropy
to the prng.  This means that the network interfaces need
to be configured before the module is loaded, which prevents
the module from being compiled into a monolithic kernel.

So move this entropy addition to the moment when
the interface is imported to LNet and the node id is first known.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lnet: keep ln_nportals consistent
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: lnet: keep ln_nportals consistent

ln_nportals should be zero when no portals have
been allocated.  This ensures that memory allocation failure
is handled correctly elsewhere.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: don't require lct_owner to be non-NULL.
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: obdclass: don't require lct_owner to be non-NULL.

Some places in lu_object.c allow lct_owner to be NULL, implying
that the code is built in to the kernel (not a module), but
two places don't.  This prevents us from building lustre into
the kernel.

So remove the requirement and always allow lct_owner to be NULL.

This requires removing an "assert" that the module count is positive,
but this is redundant as module_put() already does the necessary test.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: statahead: remove incorrect test on agl_list_empty()
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: statahead: remove incorrect test on agl_list_empty()

Including agl_list_empty() in the wait_event_idle() condition
is pointless as the body of the loop doesn't do anything
about the agl list.
So if the list wasn't empty, the while loop would spin
indefinitely.

The test was removed in the lustre-release commit
672ab0e00d61 ("LU-3270 statahead: small fixes and cleanup"),
but not in the Linux commit 5231f7651c55 ("staging: lustre:
statahead: small fixes and cleanup").

Fixes: 5231f7651c55 ("staging: lustre: statahead: small fixes and cleanup")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix bug in osc_enter_cache_try
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: fix bug in osc_enter_cache_try

The lustre-release patch commit bdc5bb52c554 ("LU-4933 osc:
Automatically increase the max_dirty_mb") changed

-       if (cli->cl_dirty + PAGE_CACHE_SIZE <= cli->cl_dirty_max &&
+       if (cli->cl_dirty_pages < cli->cl_dirty_max_pages &&

When this patch landed in Linux a couple of years later, it landed as

-       if (cli->cl_dirty + PAGE_SIZE <= cli->cl_dirty_max &&
+       if (cli->cl_dirty_pages <= cli->cl_dirty_max_pages &&

which is clearly different ('<=' vs '<'), and allows cl_dirty_pages to
increase beyond cl_dirty_max_pages - which causes a latter assertion
to fails.

Fixes: 3147b268400a ("staging: lustre: osc: Automatically increase the max_dirty_mb")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obd_mount: use correct niduuid suffix.
NeilBrown [Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)]
staging: lustre: obd_mount: use correct niduuid suffix.

Commit 4f016420d368 ("Staging: lustre: obdclass: Use kasprintf") moved
some sprintf() calls earlier in the code to combine them with
memory allocation and create kasprintf() calls.

In one case, this code movement moved the sprintf to a location where the
values being formatter were different.
In particular
       sprintf(niduuid, "%s_%x", mgcname, i);
was move from *after* the line
        i = 0;
to a location where the value of 'i' was at least 1.

This cause the wrong name to be formatted, and triggers

       CERROR("del MDC UUID %s failed: rc = %d\n",
              niduuid, rc);

at unmount time.

So use '0' instead of 'i'.

Fixes: 4f016420d368 ("Staging: lustre: obdclass: Use kasprintf")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove else after return statement
Santha Meena Ramamoorthy [Sat, 24 Feb 2018 22:56:36 +0000 (14:56 -0800)]
staging: lustre: remove else after return statement

Remove else after a return statement as it is not useful. Issue found
using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: remove unused function
Anders Roxell [Tue, 6 Mar 2018 09:11:50 +0000 (10:11 +0100)]
staging: fsl-mc/dpio: remove unused function

gcc warns that function 'qbman_pull_desc_set_token' is not used.

drivers/staging/fsl-mc/bus/dpio/qbman-portal.c:525:13: warning: ‘qbman_pull_desc_set_token’ defined but not used [-Wunused-function]

In the current code we remove that function.

Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename u16DummyReasonCode to avoid camelCase
Ajay Singh [Fri, 2 Mar 2018 14:22:49 +0000 (19:52 +0530)]
staging: wilc1000: rename u16DummyReasonCode to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in handle_rcvd_ntwrk_info()
Ajay Singh [Fri, 2 Mar 2018 14:22:48 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char in handle_rcvd_ntwrk_info()

Fix 'line over 80 character' issues found by checkpatch.pl script by
use of temporary variable and avoided leading tab.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename handle_connect_timeout() variables to avoid camelCase
Ajay Singh [Fri, 2 Mar 2018 14:22:47 +0000 (19:52 +0530)]
staging: wilc1000: rename handle_connect_timeout() variables to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in wilc_scan_complete_received()
Ajay Singh [Fri, 2 Mar 2018 14:22:46 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char in wilc_scan_complete_received()

Fix 'line over 80 character' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in wilc_del_allstation() & wilc_deinit()
Ajay Singh [Fri, 2 Mar 2018 14:22:45 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char in wilc_del_allstation() & wilc_deinit()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in wilc_add_ptk()
Ajay Singh [Fri, 2 Mar 2018 14:22:44 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char in wilc_add_ptk()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename pstrHostIFkeyAttr to avoid camelCase issue
Ajay Singh [Fri, 2 Mar 2018 14:22:43 +0000 (19:52 +0530)]
staging: wilc1000: rename pstrHostIFkeyAttr to avoid camelCase issue

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in host_int_parse_join_bss_param()
Ajay Singh [Fri, 2 Mar 2018 14:22:42 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char in host_int_parse_join_bss_param()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char for wilc_gnrl_async_info_received()
Ajay Singh [Fri, 2 Mar 2018 14:22:41 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char for wilc_gnrl_async_info_received()

Fix 'line over 80 char' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in wilc_network_info_received()
Ajay Singh [Fri, 2 Mar 2018 14:22:40 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char in wilc_network_info_received()

Fix 'line over 80 character' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in handle_cfg_param()
Ajay Singh [Fri, 2 Mar 2018 14:22:39 +0000 (19:52 +0530)]
staging: wilc1000: fix line over 80 char in handle_cfg_param()

Fix 'line over 80 char' issues found by checkpatch.pl script in
handle_cfg_param(). Rename variables and used temporary variables
to fix the line over 80 characters issue.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove always 'true' check from 'if' statement
Ajay Singh [Fri, 2 Mar 2018 14:22:38 +0000 (19:52 +0530)]
staging: wilc1000: remove always 'true' check from 'if' statement

Fix few smatch warning related to 'warn: always true condition'.

handle_cfg_param() warn: always true condition
'(cfg_param_attr->auth_timeout < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->rts_threshold < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->beacon_interval < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->site_survey_scan_time < 65536) => (0-u16max <
65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->active_scan_time < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->passive_scan_time < 65536) => (0-u16max < 65536)'

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename enuEvent to avoid camelCase
Ajay Singh [Fri, 2 Mar 2018 14:22:37 +0000 (19:52 +0530)]
staging: wilc1000: rename enuEvent to avoid camelCase

Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()
Ajay Singh [Fri, 2 Mar 2018 14:17:20 +0000 (19:47 +0530)]
staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()

Refactor wilc_wlan_handle_rxq() to fix line over 80 character issue
found by checkpatch.pl script. Added a new function to split
'wilc_wlan_handle_rxq' function code.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()
Ajay Singh [Fri, 2 Mar 2018 14:17:19 +0000 (19:47 +0530)]
staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix open parenthesis mismatch in wilc_wlan_cfg_get()
Ajay Singh [Fri, 2 Mar 2018 14:17:18 +0000 (19:47 +0530)]
staging: wilc1000: fix open parenthesis mismatch in wilc_wlan_cfg_get()

Fix 'Alignment should match open parenthesis' issue found by
checkpatch.pl script. Reduce the leading tab, to make space for open
parenthesis match.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: Indent function parameter.
Quytelda Kahja [Tue, 6 Mar 2018 09:34:08 +0000 (01:34 -0800)]
staging: most: Indent function parameter.

Indent the parameters for a function call that extends past 80 characters.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: Add a blank line.
Quytelda Kahja [Tue, 6 Mar 2018 09:18:02 +0000 (01:18 -0800)]
staging: most: Add a blank line.

Use a blank line after components_show() function declaration.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Replace literal with constant.
Quytelda Kahja [Tue, 6 Mar 2018 10:00:04 +0000 (02:00 -0800)]
staging: ks7010: Replace literal with constant.

Replace literal bytestring with CIPHER_ID_WPA_WEP40 constant.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: emxx_udc: Remove unnecessary NULL checks
Dan Carpenter [Tue, 6 Mar 2018 10:03:56 +0000 (13:03 +0300)]
staging: emxx_udc: Remove unnecessary NULL checks

These pointers can't be NULL so I have removed the checks.

The checking was sort of problematic as well because it didn't make
sense.  In _nbu2ss_read_request_data() the && should have been ||.  In
nbu2ss_gad_get_frame() we know that "pgadget" is non-NULL and "udc" is
an offset from "pgadget" so it can't be NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Remove dead FRAGMENTS_T
Eric Anholt [Mon, 5 Mar 2018 20:28:02 +0000 (12:28 -0800)]
staging: vc04_services: Remove dead FRAGMENTS_T

It's not used in-tree, or in the downstream tree.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: replace NULL comparison with variable
Santha Meena Ramamoorthy [Mon, 5 Mar 2018 18:56:13 +0000 (10:56 -0800)]
staging: rtl8188eu: replace NULL comparison with variable

Replace NULL comparison of the variable with the variable name or
!variable to conform to the Linux kernel coding style. Issue found using
checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: place constant on the right side of test
Santha Meena Ramamoorthy [Mon, 5 Mar 2018 18:37:59 +0000 (10:37 -0800)]
staging: rtl8188eu: place constant on the right side of test

Place constants on the right side of the test during comparisons to
conform to the Linux kernel coding style. Issue found using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Replace memset with eth_zero_addr
Arushi Singhal [Sat, 3 Mar 2018 21:11:42 +0000 (02:41 +0530)]
staging: rtl8723bs: Replace memset with eth_zero_addr

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Coccinelle was used to do the replacement and add the
header file linux/etherdevice.h if not already present.

The Coccinelle semantic patch that makes this change is as follows:
@header@
@@
#include <linux/etherdevice.h>

@r1@
expression e;
@@

-memset(e,0x00,ETH_ALEN);
+eth_zero_addr(e);

@includeheader depends on r1 && !header@
@@
+ #include <linux/etherdevice.h>
#include <...>

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Remove unnecessary semicolon.
Arushi Singhal [Sat, 3 Mar 2018 19:17:26 +0000 (00:47 +0530)]
staging: rtl8723bs: Remove unnecessary semicolon.

Remove unnecessary semicolon using semicolon.cocci Coccinelle script.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Add spaces around operators.
Dafna Hirschfeld [Fri, 2 Mar 2018 13:09:58 +0000 (15:09 +0200)]
staging: rtl8192e: Add spaces around operators.

Add spaces around arithmetic and bitwise operators to improve
readability of the code.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Remove unnecessary parentheses
Dafna Hirschfeld [Fri, 2 Mar 2018 13:09:57 +0000 (15:09 +0200)]
staging: rtl8192e: Remove unnecessary parentheses

Remove unnecessary parentheses between 'address-of' operators
and a struct members.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Fix issues regarding blank lines
Dafna Hirschfeld [Fri, 2 Mar 2018 13:09:56 +0000 (15:09 +0200)]
staging: rtl8192e: Fix issues regarding blank lines

Fix multiple blank lines and blank lines after braces.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: remove unnecessary parentheses
Arushi Singhal [Sat, 3 Mar 2018 05:32:36 +0000 (11:02 +0530)]
staging: rtl8712: remove unnecessary parentheses

Remove unnecessary parentheses around variables to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: Add spaces around '|'
Arushi Singhal [Sat, 3 Mar 2018 05:32:35 +0000 (11:02 +0530)]
staging: rtl8712: Add spaces around '|'

Add spaces around '|' to conform to the Linux
kernel coding style. Issue found using checkpatch.
CHECK: spaces preferred around that '|'.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: Added spaces around '+'
Arushi Singhal [Sat, 3 Mar 2018 05:32:34 +0000 (11:02 +0530)]
staging: rtl8712: Added spaces around '+'

Add spaces around arithmetic operator '+',  to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: Remove multiple blank line(s)
Arushi Singhal [Sat, 3 Mar 2018 05:32:33 +0000 (11:02 +0530)]
staging: rtl8712: Remove multiple blank line(s)

Remove extra blank line(s) to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: match alignment with open parenthesis
Arushi Singhal [Sat, 3 Mar 2018 05:32:32 +0000 (11:02 +0530)]
staging: rtl8712: match alignment with open parenthesis

Delete/Add tabs and spaces to align the code to fix the
checkpatch issue: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: Fixed 'tabstop' coding style warning
Arushi Singhal [Sat, 3 Mar 2018 05:32:31 +0000 (11:02 +0530)]
staging: rtl8712: Fixed 'tabstop' coding style warning

Replace a mix of tabs and spaces indentation by tabs only.

Fixed checkpatch warning "Statements should start on a tabstop".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: bcm2835-audio: Change to unsigned int *
Nishka Dasgupta [Sat, 3 Mar 2018 19:12:44 +0000 (00:42 +0530)]
staging: vc04_services: bcm2835-audio: Change to unsigned int *

Change 'unsigned *' to 'unsigned int *'. Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: bcm2835-audio Format multiline comment
Nishka Dasgupta [Sat, 3 Mar 2018 18:54:28 +0000 (00:24 +0530)]
staging: vc04_services: bcm2835-audio Format multiline comment

Format multiline comment by moving '*/' to a new line. Issue found with
checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: bcm2835-audio: Add blank line after declaration
Nishka Dasgupta [Thu, 1 Mar 2018 19:38:27 +0000 (01:08 +0530)]
staging: vc04_services: bcm2835-audio: Add blank line after declaration

Add blank line after declaration. Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: Remove nonessential semicolon
Arushi Singhal [Sat, 3 Mar 2018 19:09:13 +0000 (00:39 +0530)]
staging: rtlwifi: Remove nonessential semicolon

Remove non-essential semicolon after 'else' and 'switch' statements. Issue
found using semicolon.cocci Coccinelle script.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: remove unneeded semicolon
Santha Meena Ramamoorthy [Fri, 2 Mar 2018 14:14:39 +0000 (06:14 -0800)]
staging: rtlwifi: remove unneeded semicolon

Remove unneeded semicolon after 'while' and 'switch' statements. Issue
found using semicolon.cocci Coccinelle script.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: remove condition where it has no effect
Santha Meena Ramamoorthy [Fri, 2 Mar 2018 10:34:03 +0000 (02:34 -0800)]
staging: rtlwifi: remove condition where it has no effect

Remove condition where if and else branch are identical.
Issue found using cond_no_effect.cocci Coccinelle script.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6655: Fix style violation for line ending in '('
Rinkle Jain [Sun, 4 Mar 2018 07:22:25 +0000 (12:52 +0530)]
staging: vt6655: Fix style violation for line ending in '('

Replace line ending with '(' with function parameters to resolve
style issue found by checkpath.

Signed-off-by: Rinkle Jain <rinklejain96@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6655: remove unnecessary parentheses
Santha Meena Ramamoorthy [Fri, 2 Mar 2018 14:05:52 +0000 (06:05 -0800)]
staging: vt6655: remove unnecessary parentheses

Remove unnecessary parentheses around variables to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: Replace 'unsigned' with 'unsigned int'
Dafna Hirschfeld [Sun, 4 Mar 2018 20:09:34 +0000 (22:09 +0200)]
staging: lustre: obdclass: Replace 'unsigned' with 'unsigned int'

Replace 'unsigned' with 'unsigned int' to improve readability.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: Add 'const' to char* array
Dafna Hirschfeld [Sun, 4 Mar 2018 20:09:33 +0000 (22:09 +0200)]
staging: lustre: obdclass: Add 'const' to char* array

Replace 'const char*' arrays with 'const char * const'
since the values in the arrays are not changed.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obdclass: Fix comparison to NULL
Dafna Hirschfeld [Sun, 4 Mar 2018 20:09:32 +0000 (22:09 +0200)]
staging: lustre: obdclass: Fix comparison to NULL

Replace comparison to NULL with a 'not' operator.
Issue found with checkpatch.

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Replace "dont" with "don't"
Arushi Singhal [Sun, 4 Mar 2018 14:16:08 +0000 (19:46 +0530)]
staging: lustre: Replace "dont" with "don't"

Replace "dont" with "don't".
"Dont" is not same as "Do not" or "Don't".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Replace "to to" with "to"
Arushi Singhal [Sun, 4 Mar 2018 14:16:07 +0000 (19:46 +0530)]
staging: lustre: Replace "to to" with "to"

This patch replace "to to" with "to".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Replace "be be" with "be"
Arushi Singhal [Sun, 4 Mar 2018 14:16:06 +0000 (19:46 +0530)]
staging: lustre: Replace "be be" with "be"

This patch replace "be be" with "be".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: Replace "dont" with "don't
Arushi Singhal [Mon, 5 Mar 2018 04:28:08 +0000 (09:58 +0530)]
staging: comedi: Replace "dont" with "don't

Replace "dont" with "don't".
"Dont" is not same as "Do not" or "Don't".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: speakup: match alignment with open parenthesis
Santha Meena Ramamoorthy [Mon, 5 Mar 2018 17:34:13 +0000 (09:34 -0800)]
staging: speakup: match alignment with open parenthesis

Match alignment with the open parenthesis to conform to the Linux kernel
coding style. Issue found using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: Cleanup dpbp and dpcon API
Bogdan Purcareata [Thu, 1 Mar 2018 17:47:10 +0000 (11:47 -0600)]
staging: fsl-mc: Cleanup dpbp and dpcon API

Some functions and associated structures are not used by current code,
so remove them.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Replace local frame type constants with kernel constants.
Quytelda Kahja [Thu, 1 Mar 2018 05:19:11 +0000 (21:19 -0800)]
staging: ks7010: Replace local frame type constants with kernel constants.

This driver defined constants FRAME_TYPE_* to represent frame control
field codes; however, these constants are already defined in the header
'linux/ieee80211.h' as  IEEE80211_STYPE_*.  This change removes the locally
defined constants and substitutes the kernel's constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Replace local capability constants with kernel constants.
Quytelda Kahja [Thu, 1 Mar 2018 05:19:10 +0000 (21:19 -0800)]
staging: ks7010: Replace local capability constants with kernel constants.

This driver defined constants BSS_CAP_* to represent WLAN capability
codes; however, these constants are already defined in the header
'linux/ieee80211.h' as WLAN_CAPABILITY_*.  This change removes the locally
defined constants and substitutes the kernel's constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.
Quytelda Kahja [Thu, 1 Mar 2018 05:19:09 +0000 (21:19 -0800)]
staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

The code that generates a WLAN capability mask is repeated in five
functions.  This change refactors that code into a new function, which is
called now in each of those functions.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Replace SSID_MAX_SIZE with IEEE80211_MAX_SSID_LEN.
Quytelda Kahja [Thu, 1 Mar 2018 05:19:08 +0000 (21:19 -0800)]
staging: ks7010: Replace SSID_MAX_SIZE with IEEE80211_MAX_SSID_LEN.

SSID_MAX_SIZE is a constant defined locally in ks_hostif.h, but it should
be replaced with IEEE80211_MAX_SSID_LEN from the kernel's 802.11 header,
of which it is just a copy.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Use constants from ieee80211_eid instead of literal ints.
Quytelda Kahja [Thu, 1 Mar 2018 05:19:07 +0000 (21:19 -0800)]
staging: ks7010: Use constants from ieee80211_eid instead of literal ints.

The case statement in get_ap_information() should not use literal integers
to parse information element IDs when these values are provided by name
in 'enum ieee80211_eid' in the header 'linux/ieee80211.h'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:r8188eu: use lib80211 CCMP decrypt
Ivan Safonov [Fri, 23 Feb 2018 14:57:42 +0000 (17:57 +0300)]
staging:r8188eu: use lib80211 CCMP decrypt

Custom AES decrypt implementation replaced with lib80211 library.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: fix u8 less than zero check
Colin Ian King [Fri, 23 Feb 2018 15:00:08 +0000 (15:00 +0000)]
staging: rtl8723bs: fix u8 less than zero check

The error variable ret is currently a u8 and so two comparisons
to see if an error return is less than zero will always be false
because ret is unsigned.  Fix this by making ret an int.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6655: remove unnecessary blank lines
Jeremy Fertic [Sat, 24 Feb 2018 00:55:52 +0000 (17:55 -0700)]
staging: vt6655: remove unnecessary blank lines

Remove unnecessary blank lines found using checkpatch.pl script.

Signed-off-by: Jeremy Fertic <jeremyfertic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: qbman_pull_desc_set_token() can be static
Fengguang Wu [Wed, 28 Feb 2018 02:55:50 +0000 (10:55 +0800)]
staging: fsl-mc/dpio: qbman_pull_desc_set_token() can be static

Fixes: 1628e2e4dc76 ("staging: fsl-mc/dpio: allow the driver to compile multi-arch")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Fix incorrect casts
Ioana Radulescu [Mon, 26 Feb 2018 16:28:06 +0000 (10:28 -0600)]
staging: fsl-dpaa2/eth: Fix incorrect casts

The DPAA2 Ethernet driver incorrectly assumes virtual addresses
are always 64b long, which causes compiler errors when building
for a 32b platform.

Fix this by using explicit casts to uintptr_t where necessary.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: allow the driver to compile multi-arch
Ioana Radulescu [Mon, 26 Feb 2018 16:28:05 +0000 (10:28 -0600)]
staging: fsl-mc/dpio: allow the driver to compile multi-arch

Drop dependency on ARCH_LAYERSCAPE (which in turn depends on ARM64),
thus allowing this driver to compile on all architectures supported
by the fsl-mc bus driver.

This was compile tested on:
 - powerpc (corenet_basic_defconfig, ppc64_defconfig)
 - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF)
 - arm64 (defconfig)

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: dpio: remove foolish -Werror Makefile addtion
Greg Kroah-Hartman [Thu, 1 Mar 2018 16:27:50 +0000 (17:27 +0100)]
staging: fsl-mc: dpio: remove foolish -Werror Makefile addtion

With the zillion different compilers out there, never use -Werror,
otherwise your code will end up breaking the build for odd reasons.

Like now, if this driver is enabled, it breaks the build due to a
function that could be marked static.  So it's obvious no one is even
paying attention to this driver :(

Cc: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc/dpio: Fix incorrect casts
Ioana Radulescu [Mon, 26 Feb 2018 16:28:04 +0000 (10:28 -0600)]
staging: fsl-mc/dpio: Fix incorrect casts

The DPIO driver incorrectly assumes virtual addresses are always
64b long, which causes compiler errors when building for a 32b
platform.

Fix this by using explicit casts to uintptr_t where necessary.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr
Colin Ian King [Wed, 28 Feb 2018 11:28:49 +0000 (11:28 +0000)]
staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr

Currently the allocation of priv->oldaddr is not null checked which will
lead to subsequent errors when accessing priv->oldaddr.  Fix this with
a null pointer check and a return of -ENOMEM on allocation failure.

Detected with Coccinelle:
drivers/staging/rtl8192u/r8192U_core.c:1708:2-15: alloc with no test,
possible model on line 1723

Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename WILC_WFI_mgmt_rx() to avoid camelCase
Ajay Singh [Mon, 26 Feb 2018 16:31:59 +0000 (22:01 +0530)]
staging: wilc1000: rename WILC_WFI_mgmt_rx() to avoid camelCase

Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: move multiple definition of same macro to common header
Ajay Singh [Mon, 26 Feb 2018 16:31:58 +0000 (22:01 +0530)]
staging: wilc1000: move multiple definition of same macro to common header

Move the same #define from multiple '.c' files to common header file.
Instead of having same macro in different '.c' files, now kept in
common '.h' file.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char in wilc_wlan_handle_txq()
Ajay Singh [Mon, 26 Feb 2018 16:31:57 +0000 (22:01 +0530)]
staging: wilc1000: fix line over 80 char in wilc_wlan_handle_txq()

Refactor wilc_wlan_handle_txq() to fix 'line over 80 char' issue found
by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename label _end_ in wilc_wlan_handle_txq()
Ajay Singh [Mon, 26 Feb 2018 16:31:56 +0000 (22:01 +0530)]
staging: wilc1000: rename label _end_ in wilc_wlan_handle_txq()

Rename label name starting with '_' to follow as per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unnecessary while(0) in wilc_wlan_handle_txq()
Ajay Singh [Mon, 26 Feb 2018 16:31:55 +0000 (22:01 +0530)]
staging: wilc1000: remove unnecessary while(0) in wilc_wlan_handle_txq()

Refactor wilc_wlan_handle_txq() by removing unnecessary while(0)
loop. "Line over 80 char" issues in wilc_wlan_handle_txq() are fix by
reducing extra leading tab.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: Fix missing identifier in function definition argument.
Quytelda Kahja [Sat, 24 Feb 2018 07:58:35 +0000 (23:58 -0800)]
staging: most: Fix missing identifier in function definition argument.

The function pointer 'complete' in 'struct mbo' should use an identifier
for its argument.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: Remove unnecessary OOM messages.
Quytelda Kahja [Sat, 24 Feb 2018 07:58:34 +0000 (23:58 -0800)]
staging: most: Remove unnecessary OOM messages.

It isn't necessary for the driver to log out-of-memory errors, so
these have been removed and the functions simply return -ENOMEM.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: move logical continuation to previous line
Santha Meena Ramamoorthy [Wed, 28 Feb 2018 20:40:48 +0000 (12:40 -0800)]
staging: rtl8192e: move logical continuation to previous line

Move logical continuation '&&' to the previous line to conform to the
Linux kernel coding style. Issue found using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vt6655: replace NULL comparison with variable
Santha Meena Ramamoorthy [Wed, 28 Feb 2018 22:51:12 +0000 (14:51 -0800)]
staging: vt6655: replace NULL comparison with variable

Replace NULL comparison of the variable with just the variable name to
conform to the Linux kernel coding style. Issue found using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix block comment style
Santha Meena Ramamoorthy [Wed, 28 Feb 2018 19:45:05 +0000 (11:45 -0800)]
staging: lustre: fix block comment style

Add trailing */ on a separate line for block comments to conform to
the Linux kernel coding style. Issue found using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: use kmemdup for allocation and copy
Dafna Hirschfeld [Tue, 27 Feb 2018 21:44:27 +0000 (23:44 +0200)]
staging: rtl8723bs: use kmemdup for allocation and copy

Use kmemdup instead of kzalloc and memcpy to simplify the code.
Issue found with coccicheck.

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lnet/selftest: don't ignore status from lstcon_test_add
NeilBrown [Thu, 22 Feb 2018 22:09:33 +0000 (09:09 +1100)]
staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add

If lstcon_test_add sets 'ret' (passed by reference) to 1,
then lst_test_add_ioctl() ignores the return value.
This isn't justified - the return value must be zero for 'ret'
to be meaningful.

Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lmv: correctly iput lmo_root
NeilBrown [Thu, 22 Feb 2018 22:09:33 +0000 (09:09 +1100)]
staging: lustre: lmv: correctly iput lmo_root

Commit 8f18c8a48b73 ("staging: lustre: lmv: separate master object
with master stripe") changed how lmo_root inodes were managed,
particularly when LMV_HASH_FLAG_MIGRATION is not set.
Previously lsm_md_oinfo[0].lmo_root was always a borrowed
inode reference and didn't need to by iput().
Since the change, that special case only applies when
LMV_HASH_FLAG_MIGRATION is set

In the upstream (lustre-release) version of this patch [Commit
60e07b972114 ("LU-4690 lod: separate master object with master
stripe")] the for loop in the lmv_unpack_md() was changed to count
from 0 and to ignore entry 0 if LMV_HASH_FLAG_MIGRATION is set.
In the patch that got applied to Linux, that change was missing,
so lsm_md_oinfo[0].lmo_root is never iput().
This results in a "VFS: Busy inodes" warning at unmount.

Fixes: 8f18c8a48b73 ("staging: lustre: lmv: separate master object with master stripe")
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lov: use correct env in lov_io_data_version_end()
NeilBrown [Thu, 22 Feb 2018 22:09:33 +0000 (09:09 +1100)]
staging: lustre: lov: use correct env in lov_io_data_version_end()

lov - the logical object volume manager - is responsible for
striping data across multiple volumes.

So when it is given a request, it creates one or more
sub-requests, one for each target volume.  Each sub_io
request has a sub_env environment which it operates in.

When lov_io_data_version_end() calls lov_io_end_wrapper() to
wait for and close off a sub_io, it passes the wrong
environment.

This causes an LINVRNT() to fail in cl2osc_io(), and may
cause other problems.

This patch changes the call to use ->sub_env, much like
other code in the same file.

Fixes: f0cf21abcccc ("staging: lustre: clio: add CIT_DATA_VERSION and remove IOC_LOV_GETINFO")
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoRevert "Staging: bcm2048: Fix function argument alignment in radio-bcm2048.c."
Greg Kroah-Hartman [Tue, 27 Feb 2018 13:42:14 +0000 (14:42 +0100)]
Revert "Staging: bcm2048: Fix function argument alignment in radio-bcm2048.c."

This reverts commit 444634f5ed6f0179cd63ff09bea62c03963ad0f9.

Should not be going through my tree, sorry about that.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>