Commit Graph

721817 Commits

Author SHA1 Message Date
Laurentiu Tudor c9d57ea0b6 staging: fsl-mc: consistently use EXPORT_SYMBOL_GPL()
The bus driver is mixing EXPORT_SYMBOL()/EXPORT_SYMBOL_GPL() usage.
Change it to consistently use EXPORT_SYMBOL_GPL().

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor a211c8170b staging: fsl-mc/dpio: remove couple of unused functions
These couple of functions are not yet used so lets remove them
for now and add them back when/if needed.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor 9e04d0e20c staging: fsl-mc/dpio: drop EXPORT_SYMBOL() for a few functions
These functions are only used within this driver so no need for
EXPORT_SYMBOL().

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Laurentiu Tudor 2b0ff43ae5 staging: fsl-mc/dpio: remove incomplete refcount implementation
There's an unfinished implementation of reference counting for dpaa2_io
structure using atomics. Since it's unused lets remove it for now and,
if needed at a later time, make use of krefs instead of rolling our
own refcounting.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Laurentiu Tudor 8ba6b44a5a staging: fsl-mc: drop unused dpcon APIs
Couple of API functions are not used so lets drop them together with
the associated structures and defines.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Colin Ian King bc4eec76e6 staging: comedi: usbdux: remove redundant initialization of val
The early initialization of val is redundant as the value is never
read and is updated inside a for-loop. Remove the initialization
and move the declaration and initialization to the for-loop scope.
Cleans up clang warning:

drivers/staging/comedi/drivers/usbdux.c:812:15: warning: Value stored
to 'val' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Gustavo A. R. Silva d69b9c3884 staging: speakup: selection: replace _manual_ swap with swap macro
Make use of the swap macro instead of _manually_ swapping values
and remove unnecessary variable tmp.

This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Arnd Bergmann f6829ad617 staging: rtlwifi: rtlwifi: use ktime_get_real_seconds() for suspend time
do_gettimeofday() is deprecated and slower than necessary for the purpose
of reading the seconds. This changes rtl_op_suspend/resume to use
ktime_get_real_seconds() instead, which is simpler and avoids confusion
about whether it is y2038-safe or not.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Colin Ian King 6b549e20b6 staging: rtlwifi: remove redundant assignments to ul_enc_algo
Variable ul_enc_algo is being initialized with a value that is never
read, it is being set again in the following switch statements in
all of the case and default paths. Hence the unitialization is
redundant and can be removed.  Cleans up two clang warnings:

Value stored to 'ul_enc_algo' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Joshua Abraham 15bfaf7777 staging: dgnc: Fix usleep_range is preferred over udelay
This patch fixes the issue:

CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt

Signed-off-by: Joshua Abraham <j.abraham1776@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Colin Ian King 217f93366e staging: ccree: fix incorrect indentation of break statement
The break statement is indented one level too many, fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Gilad Ben-Yossef d5a2a81868 staging: ccree: drop unused macro
The CC_REG_NAME macro is unused. Drop it.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Gilad Ben-Yossef c804f35992 staging: ccree: use local vars for readability
Refactor cc_map_aead_request() to use local vars for addresses
for better readability of code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Gilad Ben-Yossef d59c6d9cee staging: ccree: replace msleep with a completion
When the driver would try to queue commands to the HW FIFO but ran out of
slots it would use msleep as a delay until the FIFO would clear. This is
messy and not accurate.

Replace the msleep with a proper completion on the event of command
completion which should indicate at least one slot is free.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Gilad Ben-Yossef 5a83a3937b staging: ccree: remove unused field
Field monitor_null_cycles of struct drvdata was not being used.
Remove it.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Gilad Ben-Yossef 00fb304d63 staging: ccree: remove unneeded wrapper function
Remove unneeded wrapper function to simplify code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Gilad Ben-Yossef 37f98f8384 staging: ccree: rename long define for readability
Rename the too long  SSI_MAX_HASH_OPAD_TMP_KEYS_SIZE
to SSI_MAX_OPAD_KEYS_SIZE for better code readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef d86601600a staging: ccree: rename func for readability
Rename the insanely long ssi_ahash_get_larval_digest_sram_addr() func
to cc_larval_digest_addr() for better code readability

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 896d236f74 staging: ccree: refactor code with local vars
Refactor the queue handling loop using local variables for better
code readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 5e1de0e737 staging: ccree: remove dead defs and decls
Remove no longer definitions of enums and forward declaration of functions
dealing with sysfs interface of the long removed ccree cycle counter.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef a213e41c33 staging: ccree: trim long lines for readability
The ccree driver did not adhere to the kernel max 80 chars per line limit
making the code hard to follow. Fix this by breaking long lines and
in some cases, moving comments to a separate line from code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 07ece8b5b1 staging: ccree: replace macro with inline func
Replace GET_DMA_BUFFER_TYPE with an inline function
variant with type checking.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef f2f459ca64 staging: ccree: Replace CONFIG_PM_RUNTIME with CONFIG_PM
After commit b2b49ccbdd
("PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected")
PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 1eccfc4494 staging: ccree: fix code indent
Fix code ident not following the coding style.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 7d2e4fc239 staging: ccree: constify help string
Make help string static const

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef da4e52ac3e staging: ccree: document spinlock usage
Document spinlock usage to protect against concurrent
access to HW register which must occur a single
request at a time.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef add496c0ba staging: ccree: replace open coded loop with for
Replace open coded register writing loop with a for.
Further simplify code by using a local var to precompute
the register address for readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 2712dc7b01 staging: ccree: make mem barrier per request
The driver was issuing a write memory barrier per each
HW descriptor written but these descriptors are written
in groups and we really only need one per group.

White at it, document memory barrier reason.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 04fad5d4d7 staging: ccree: remove unneeded cast
Remove uneeded cast from writel_relaxed parameter.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef 9549afee3c staging: ccree: remove unneeded empty lines
Remove uneeded empty lines that crept in to code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:39 +01:00
Gilad Ben-Yossef b426144f4a staging: ccree: move logical cont. to 1st line
Move logical continuations to first line for readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef df33d7928c staging: ccree: remove MIN/MAX macros
The driver was using open coded MIN/MAX macros to
compute fixed defines. Remove them and use bigger
value always instead.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef e4607e7b3b staging: ccree: remove unnecessary parentheses
Remove unnecessary parentheses in if statements across the driver.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef 309700da48 staging: ccree: alloc by instance not type
Allocation by instance is preferred to allocation by type.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef ead5f963c0 staging: ccree: fix typos
Fix a bunch of comment typos.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef f9f284693a staging: ccree: remove unused cc_base parameter
Remove a common parameter named cc_base with the pointer
to the mapped command registers which was used by the
old register access macros that are not longer in use.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef 155ff091da staging: ccree: remove braces for single statement
Remove necessary braces for single statement blocks to
improve code readabilty.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef 474f75a14c staging: ccree: remove compare to none zero
The driver was full of code checking "if (x != 0)".
Replace by "if (x)" for better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef 6d7d9e7870 staging: ccree: remove unneeded cast
Remove unneeded cast of the return value of dev_get_drvdata()
to struct ssi_drvdata * for better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef da2e2d210c staging: ccree: simplify pm manager using local var
Make the code more readable by using a local variable.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef 02e6f40c34 staging: ccree: fold common code into function
Fold common code copying MAC to/from a temp. buffer
into an inline function instead of keeping multiple
open coded versions of same.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef 33bb30c3a9 staging: ccree: simplify buf mgr using local vars
Make the code more readable by using a local variables
for commonly use expressions in the buffer manager part
of the driver.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef d30a396964 staging: ccree: simplify AEAD using local var
Make the code more readable by using a local variable
for commonly use expression in the AEAD part of the driver.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:38 +01:00
Gilad Ben-Yossef e1cb54fd37 staging: ccree: make long func call sites readable
The driver was using a function naming scheme
including common prefixes for driver global
functions based on the code module they came from.

The combination of long names with long common
prefixes made the whole thing too long for a human
to parse.

Switch to simple and shorter function naming
scheme. Where required, realign parameters and
add paranthesis for better code readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00
NeilBrown 988b9ea912 staging: lustre: obdclass: simplify cl_lock_fini()
Using list_first_entry_or_null() makes this (slightly)
simpler.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00
NeilBrown dff162689a staging: lustre: simplfy lov_finish_set()
When deleting everything from a list, a while loop
is cleaner than list_for_each_safe().

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00
NeilBrown 557d001aa5 staging: lustre: ldlm: use list_for_each_entry in ldlm_lock.c
This makes some slightly-confusing code a bit clearer, and
avoids the need for 'tmp'.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00
NeilBrown ef7e70ae99 staging: lustre: ldlm: use list_first_entry in ldlm_lock
This make the code (slightly) more readable.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00
Christian Gromm 3d9c54b5f9 staging: most: usb: fix show/store function names
This patch renames the show/store functions of the USB module.
It is needed to make the module meet the established naming
convention.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00
Christian Gromm b7ed2ff0bb staging: most: add ABI documentation
This patchg adds the sysfs-bus-most.txt file to the source tree.
It is needed to have an ABI description of the driver's sysfs
interface.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00