platform/kernel/linux-rpi.git
6 years agortl8188eu: Fix a possible sleep-in-atomic bug in set_tx_beacon_cmd
Jia-Ju Bai [Tue, 12 Dec 2017 13:08:06 +0000 (21:08 +0800)]
rtl8188eu: Fix a possible sleep-in-atomic bug in set_tx_beacon_cmd

The driver may sleep under a spinlock.
The function call path is:
update_beacon (acquire the spinlock)
  update_BCNTIM
    set_tx_beacon_cmd
      kzalloc(GFP_KERNEL) --> may sleep
      kmemdup(GFP_KERNEL) --> may sleep

To fix it, GFP_KERNEL is replaced with GFP_ATOMIC.

This bug is found by my static analysis tool(DSAC) and checked by my code review.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: Cleanup codestyle, change spaces to tabs
Neil Singh [Sun, 10 Dec 2017 04:38:35 +0000 (11:38 +0700)]
staging: rtl8712: Cleanup codestyle, change spaces to tabs

Cleanup below checkpatch issues:

ERROR:CODE_INDENT: code indent should use tabs where possible
1409: FILE: rtl871x_security.c:1409:
+                from_timer(padapter, t, securitypriv.tkip_timer);$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
1409: FILE: rtl871x_security.c:1409:
+                from_timer(padapter, t, securitypriv.tkip_timer);$

Signed-off-by: Neil Singh <neil2468@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: Cleanup codestyle, break up long line
Neil Singh [Sun, 10 Dec 2017 04:38:34 +0000 (11:38 +0700)]
staging: rtl8712: Cleanup codestyle, break up long line

Cleanup below checkpatch issue:

WARNING:LONG_LINE: line over 80 characters
1000: FILE: rtl871x_security.c:1000:
+static void construct_ctr_preload(u8 *ctr_preload, sint a4_exists, sint qc_exists,

Signed-off-by: Neil Singh <neil2468@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: comedi: drivers: serial2002 fixed a blank line coding style
Vikash Kesarwani [Fri, 8 Dec 2017 18:56:05 +0000 (00:26 +0530)]
Staging: comedi: drivers: serial2002 fixed a blank line coding style

Fixed a blank line coding style after a declaration

Signed-off-by: Vikash Kesarwani <vikash.ckiiita30@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: do not print error in case of defer probe error
Nipun Gupta [Mon, 11 Dec 2017 15:45:38 +0000 (21:15 +0530)]
staging: fsl-mc: do not print error in case of defer probe error

Devices on MC bus can be deferred because of dependencies on other modules
(such as IOMMU). Those are not the actual errors; as probing is again
done by the kernel at later stages. So this patch avoids the error print
in such case.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-mc: Allocate IRQ's before scanning DPRC objects
Nipun Gupta [Mon, 11 Dec 2017 15:45:37 +0000 (21:15 +0530)]
staging: fsl-mc: Allocate IRQ's before scanning DPRC objects

Following is the current scenario when the devices are probed:

  FSL_MC Bus probe ---> dprc probe ---> dprc devices scan --->
    probe devices in DPRC container ---> allocate IRQ's

In case the devices being probed in the DPRC container need the IRQ's;
probing of that device will fail.

In current scenario the devices which need IRQ's such as DPIO gets
deferred because they aren't registered when first time the probing
of these devices is done in the dprc scan.
So they are probed once IRQ's have been allocated.

In case where DPRC probing itself gets deferred, which does in case
IOMMU is enabled; all the devices in DPRC container gets probed before
IRQ's are allocated. This causes devices using IRQ's (such as DPIO)
to fail.

So having IRQ's allocated before any of the devices in the DPRC container
are probed is more legitimate.

After this patch following is the flow of execution:

  FSL_MC Bus probe ---> dprc probe ---> dprc devices scan --->
    allocate IRQ's ---> probe of devices in DPRC container.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Reviewed-by: Bharat Bhushan <bharat.bhushan@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix FIPS mgr naming convention
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:10 +0000 (14:53 +0000)]
staging: ccree: fix FIPS mgr naming convention

The FIPS manager files were using a naming convention which was
inconsistent (ssi vs. cc) and often too long.

Make the code more readable by switching to a simpler, consistent naming
convention.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: simplify freeing SRAM memory address
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:09 +0000 (14:53 +0000)]
staging: ccree: simplify freeing SRAM memory address

The code freeing the SRAM memory address was zeroing the address
on release although there is nothing secret about it. Simplify
the code by simply calling kfree directly.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix sram mgr naming convention
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:08 +0000 (14:53 +0000)]
staging: ccree: fix sram mgr naming convention

The SRAM manager files were using a naming convention which was
inconsistent (ssi vs. cc) and often too long.

Make the code more readable by switching to a simpler, consistent naming
convention.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix buf mgr naming convention
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:07 +0000 (14:53 +0000)]
staging: ccree: fix buf mgr naming convention

The buffer manager files were using a func naming convention which was
inconsistent (ssi vs. cc) and often too long.

Make the code more readable by switching to a simpler, consistent naming
convention.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: rename vars/structs/enums from ssi_ to cc_
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:06 +0000 (14:53 +0000)]
staging: ccree: rename vars/structs/enums from ssi_ to cc_

Unify naming convention by renaming all ssi_ vars/structs/enums
and variables to cc_*

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: rename all DX to CC
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:05 +0000 (14:53 +0000)]
staging: ccree: rename all DX to CC

Unify naming convention by renaming all DX macros to CC.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: rename all SSI to CC
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:04 +0000 (14:53 +0000)]
staging: ccree: rename all SSI to CC

Unify naming convention by renaming all SSI macros to CC.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove SSI_CC_HAS_ macros
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:03 +0000 (14:53 +0000)]
staging: ccree: remove SSI_CC_HAS_ macros

Remove macro controlling build of various features. This
needs to happen dynamically in registration time.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: drop unsupported MULTI2 mode code
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:02 +0000 (14:53 +0000)]
staging: ccree: drop unsupported MULTI2 mode code

Remove the code support for MULTI2 mode which is not supported
by the current hardware.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix ivgen func def coding style
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:01 +0000 (14:53 +0000)]
staging: ccree: fix ivgen func def coding style

Fix ivgen functions definition indentation according to coding
style guide lines for better code readability

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix ivgen naming convention
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:53:00 +0000 (14:53 +0000)]
staging: ccree: fix ivgen naming convention

The ivgen files were using a func naming convention which was
inconsistent (ssi vs. cc), included a long prefix (ssi_ivgen)
and often too long.

Make the code more readable by switching to a simpler, consistent naming
convention.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix cipher func def coding style
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:59 +0000 (14:52 +0000)]
staging: ccree: fix cipher func def coding style

Fix cipher functions definition indentation according to coding
style guide lines for better code readability

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix cipher naming convention
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:58 +0000 (14:52 +0000)]
staging: ccree: fix cipher naming convention

The blkcipher files were using a func naming convention which was
inconsistent (ssi vs. cc), included a long prefix (ssi_ablkcipher)
and often too long.

Make the code more readable by switching to a simpler, consistent naming
convention.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove cipher sync blkcipher remains
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:57 +0000 (14:52 +0000)]
staging: ccree: remove cipher sync blkcipher remains

Remove the remains of no longer existing support for running
blkcipher is sync mode.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix req mgr func def coding style
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:56 +0000 (14:52 +0000)]
staging: ccree: fix req mgr func def coding style

Fix request manager functions definition indentation according to coding
style guide lines for better code readability

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix reg mgr naming convention
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:55 +0000 (14:52 +0000)]
staging: ccree: fix reg mgr naming convention

The request manager files were using a func naming convention which was
inconsistent (ssi vs. cc), included a useless prefix (ssi_request_mgr)
and often too long.

Make the code more readable by switching to a simpler, consistent naming
convention.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix func call param indentation
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:54 +0000 (14:52 +0000)]
staging: ccree: fix func call param indentation

Fix function call parameter indentation according to coding
style guide lines.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: simplify expression with local var
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:53 +0000 (14:52 +0000)]
staging: ccree: simplify expression with local var

Simplify expression by using a local variable for better code
readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix func def and decl coding style
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:52 +0000 (14:52 +0000)]
staging: ccree: fix func def and decl coding style

Fix functions definition and declaration indentation according to
coding style guide lines for better code readability

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: shorten parameter name
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:51 +0000 (14:52 +0000)]
staging: ccree: shorten parameter name

Shorten parameter name for better code readability

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: func params should follow func name
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:50 +0000 (14:52 +0000)]
staging: ccree: func params should follow func name

Fix some call sites with func params not following func name in AEAD
code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: amend hash func def for readability
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:49 +0000 (14:52 +0000)]
staging: ccree: amend hash func def for readability

Func definitions in the hash implementation were did not adhere to
coding style. Fix them for better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix hash naming convention
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:48 +0000 (14:52 +0000)]
staging: ccree: fix hash naming convention

The hash files were using a naming convention which was inconsistent
(ssi vs. cc), included a useless prefix (ssi_hash) and often used too
long function names producing monster such as
ssi_ahash_get_initial_digest_len_sram_addr() that made the call site
hard to read.

Make the code more readable by switching to a simpler, consistent naming
convention for the file.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove ahash wrappers
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:47 +0000 (14:52 +0000)]
staging: ccree: remove ahash wrappers

Remove a no longer needed abstraction around ccree hash crypto API
internals that used to allow same ops to be used in synchronous and
asynchronous fashion.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agodrivers: lustre: obdclass: check result of register_shrinker()
Aliaksei Karaliou [Thu, 7 Dec 2017 07:25:53 +0000 (10:25 +0300)]
drivers: lustre: obdclass: check result of register_shrinker()

lu_global_init() does not check result of register_shrinker()
which was tagged __must_check recently, reported by sparse.
Patch also fixes missed cleanup of resources allocated prior to
register_shrinker() invocation and not freed after any failure.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agodrivers: lustre: ldlm: check result of register_shrinker()
Aliaksei Karaliou [Thu, 7 Dec 2017 07:25:52 +0000 (10:25 +0300)]
drivers: lustre: ldlm: check result of register_shrinker()

ldlm_pools_init() does not check result of register_shrinker()
which was tagged __must_check recently, reported by sparse.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agodrivers: lustre: ptlrpc: check result of register_shrinker()
Aliaksei Karaliou [Thu, 7 Dec 2017 07:25:51 +0000 (10:25 +0300)]
drivers: lustre: ptlrpc: check result of register_shrinker()

sptlrpc_enc_pool_init() does not check result of register_shrinker()
which was tagged __must_check recently, reported by sparse.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agodrivers: lustre: osc: check result of register_shrinker()
Aliaksei Karaliou [Thu, 7 Dec 2017 07:25:50 +0000 (10:25 +0300)]
drivers: lustre: osc: check result of register_shrinker()

osc_init() does not check result of register_shrinker()
which was tagged __must_check recently, reported by sparse.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: libcfs: discard LASSERT_CHECKED
NeilBrown [Wed, 13 Dec 2017 03:15:55 +0000 (14:15 +1100)]
staging: lustre: libcfs: discard LASSERT_CHECKED

This macro isn't used, and comment is about some earlier version
of the lustre code that never reached the mainline kernel.
Just discard it.

Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: Luis de Bethencourt <luisbg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: libcfs: discard KLASSERT()
NeilBrown [Wed, 13 Dec 2017 03:15:55 +0000 (14:15 +1100)]
staging: lustre: libcfs: discard KLASSERT()

This appears to be intended for assertions that only make
sense in the kernel, but as this code is now kernel-only,
it doesn't make sense any more.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: libcfs: discard MAX_NUMERIC_VALUE
NeilBrown [Wed, 13 Dec 2017 03:15:55 +0000 (14:15 +1100)]
staging: lustre: libcfs: discard MAX_NUMERIC_VALUE

This is unused.
drivers/staging/lustre/lnet/lnet/nidstrings.c does use the name,
but it includes its own local definition.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: libcfs: discard MKSTR() macro
NeilBrown [Wed, 13 Dec 2017 03:15:55 +0000 (14:15 +1100)]
staging: lustre: libcfs: discard MKSTR() macro

This is only used for tracing when some strings might
be NULL.  NULL strings are not a problem for tracing,
vnsprintf() will report them as "(null)" which is probably
better (easier to parse) than an empty string.

Also remove a nearby comment that doesn't relate to the
(remaining) code at all.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: libcfs: remove unused rounding functions.
NeilBrown [Wed, 13 Dec 2017 03:15:55 +0000 (14:15 +1100)]
staging: lustre: libcfs: remove unused rounding functions.

These are all unused except cfs_size_round().
So discard the others, and use the kernel-standard round_up()
function to implement cfs_size_round().

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: libcfs: simplify memory allocation.
NeilBrown [Wed, 13 Dec 2017 03:15:55 +0000 (14:15 +1100)]
staging: lustre: libcfs: simplify memory allocation.

1/ Use kvmalloc() instead of kmalloc or vmalloc
2/ Discard the _GFP() interfaces that are never used.
  We only ever do GFP_NOFS and GFP_ATOMIC allocations,
  so support each of those explicitly.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lov: use list_for_each_entry in lov_obd.c
NeilBrown [Wed, 13 Dec 2017 03:15:54 +0000 (14:15 +1100)]
staging: lustre: lov: use list_for_each_entry in lov_obd.c

Using the *_entry macro simplifies the code slightly.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ldlm: use list_for_each_entry in ldlm_resource.c
NeilBrown [Wed, 13 Dec 2017 03:15:54 +0000 (14:15 +1100)]
staging: lustre: ldlm: use list_for_each_entry in ldlm_resource.c

Having a stand-alone "list_entry()" call is often a sign
that something like "list_for_each_entry()" would
make the code clearer.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ldlm: minor list_entry improvements in ldlm_request.c
NeilBrown [Wed, 13 Dec 2017 03:15:54 +0000 (14:15 +1100)]
staging: lustre: ldlm: minor list_entry improvements in ldlm_request.c

Small clarify improvements, and one local variable avoided.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ldlm: use list_first_entry in ldlm_lockd.c
NeilBrown [Wed, 13 Dec 2017 03:15:54 +0000 (14:15 +1100)]
staging: lustre: ldlm: use list_first_entry in ldlm_lockd.c

This is only a small simplification, but it makes the code
a little clearer.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: ldlm: use list_for_each_entry in ldlm_extent_shift_kms()
NeilBrown [Wed, 13 Dec 2017 03:15:54 +0000 (14:15 +1100)]
staging: lustre: ldlm: use list_for_each_entry in ldlm_extent_shift_kms()

Using list_for_each_entry() means we don't need 'tmp'.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: use list_last_entry to simplify fld_cache_shrink
NeilBrown [Wed, 13 Dec 2017 03:15:54 +0000 (14:15 +1100)]
staging: lustre: use list_last_entry to simplify fld_cache_shrink

Using list_empty() and list_last_entry() makes the code clearer,
and allows a local variable to be discarded.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agodrivers: visorbus: move driver out of staging
David Kershner [Thu, 7 Dec 2017 17:11:07 +0000 (12:11 -0500)]
drivers: visorbus: move driver out of staging

Move the visorbus driver out of staging (drivers/staging/unisys/visorbus)
and to drivers/visorbus. Modify the configuration and makefiles so they
now reference the new location. The s-Par header file visorbus.h that is
referenced by all s-Par drivers, is being moved into include/linux.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Fix validation of rf69_get_modulation value
Marcin Ciupak [Fri, 8 Dec 2017 15:31:54 +0000 (15:31 +0000)]
staging: pi433: Fix validation of rf69_get_modulation value

Checking of modulation in rf69_set_modulation_shaping is done by
if-else and since else part covers OOK and UNDEF values it possible to
set modulation shaping for undefined modulation type.
To fix this validation should be done by switch clause and in case of
undefined modulation error returned.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Fix missing 'undefined' value in enum modulation
Marcin Ciupak [Fri, 8 Dec 2017 15:31:28 +0000 (15:31 +0000)]
staging: pi433: Fix missing 'undefined' value in enum modulation

It is possible that rf69_get_modulation() function will return
'undefined' value and this value is missing in enum modulation. Fix this
by adding appropriate entry in enum modulation.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: Fixing coding style warning
Rodrigo Zaiden [Fri, 8 Dec 2017 00:25:18 +0000 (22:25 -0200)]
staging: wlan-ng: Fixing coding style warning

    Removes following warnings found by checkpatch.pl script:
    WARNING: line over 80 characters

Signed-off-by: Rodrigo Zaiden <rodrigoffzz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: cleanup a small white space issue
Dan Carpenter [Fri, 8 Dec 2017 11:56:39 +0000 (14:56 +0300)]
staging: ccree: cleanup a small white space issue

The call to set_flow_mode() was supposed to be on the next line.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Add spaces around & and + operator
Simon Sandström [Thu, 7 Dec 2017 21:15:02 +0000 (22:15 +0100)]
staging: pi433: Add spaces around & and + operator

Fixes checkpatch warning: "spaces preferred around that '&'".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Fix ISO-8859 encoded non-english comments
Simon Sandström [Thu, 7 Dec 2017 20:49:22 +0000 (21:49 +0100)]
staging: pi433: Fix ISO-8859 encoded non-english comments

Some comments, like "without memcpy would be nice", are removed.
Other comments are just translated to english.
rf69.c is now plain ASCII.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Make Tx buffer alignment optional
Ioana Radulescu [Fri, 8 Dec 2017 12:47:58 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Make Tx buffer alignment optional

Aligning the Tx buffers at 64B is a performance optimization
recommendation, not a hard requirement.

Make optional the alignment of Tx FD buffers, without enforcing
a reallocation in case there is not enough headroom for it.

On Rx, we keep allocating buffers with enough headroom to allow
Tx alignment of forwarded frames.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Compute needed headroom per frame
Ioana Radulescu [Fri, 8 Dec 2017 12:47:57 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Compute needed headroom per frame

For non-linear skbs we build scatter-gather frames and allocate
a new buffer for the S/G table in which we reserve the required
headroom, so the actual skb headroom size doesn't matter.

Rather than use a one-size-fits-all approach, decide when to
enforce headroom requirements on a frame by frame basis.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Don't enable FAS on Tx
Ioana Radulescu [Fri, 8 Dec 2017 12:47:56 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Don't enable FAS on Tx

For Tx confirmed frames that have an error indication in the frame
descriptor, we look at the Frame Annotation Status field (in the
buffer headroom) for details on the root cause and then print
a debug message with that information.

While useful in initial development stages, it doesn't bring
enough added value to justify reserving 64B of headroom for all
Tx frames (FAS is only 8B long, but we must reserve chunks of 64B
from the hardware annotation area).

If we remove the need for FAS field from egress frames, we can
renounce hardware annotation completely, since FAS is the only
HWA field we currently use.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Add counter for skb reallocs
Ioana Radulescu [Fri, 8 Dec 2017 12:47:55 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Add counter for skb reallocs

Add a counter for the number of egress frames that need to be
realloc'ed due to insufficient headroom space.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Don't set netdev->needed_headroom
Ioana Radulescu [Fri, 8 Dec 2017 12:47:54 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Don't set netdev->needed_headroom

Commit 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX
buffers") tried to avoid the performance penalty of doing skb
reallocations in the network stack for IP forwarded frames between
two DPAA2 Ethernet interfaces. This led to a (too) complicated
formula that relies on the stack's internal implementation.

Instead, it's safer and easier to just not request any guarantee
from the stack. We already double check in the driver the required
headroom size of egress frames and realloc the skb if needed, so
we don't need to add any extra code.

On forwarding between two of our own interfaces, there is no
functional change; for traffic forwarded from a different device or
generated on the core, skb realloc operations are moved from the stack
to our driver, with no visible impact on performance.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Fix access to FAS field
Ioana Radulescu [Fri, 8 Dec 2017 12:47:53 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Fix access to FAS field

Commit 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX
buffers") removes the software annotation (SWA) area from the RX
buffer layout, as it's not used by anyone, but fails to update the
macros for accessing hardware annotation (HWA) fields, which is
right after the SWA in the buffer headroom.

This may lead to some frame annotation status fields (e.g. indication
if L3/L4 checksum is valid) to be read incorrectly.

Turn the accessor macros into inline functions and add a bool param
to specify if SWA is present or not.

Fixes: 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX buffers")

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: pi433_if.c remove SET_CHECKED macro
Nguyen Phan Quang Minh [Fri, 8 Dec 2017 10:43:19 +0000 (11:43 +0100)]
staging: pi433: pi433_if.c remove SET_CHECKED macro

The macro calls its argument -a function- twice, makes the calling
function return prematurely -skipping resource cleanup code- and hurts
understandability.

Signed-off-by: Nguyen Phan Quang Minh <minhnpq16@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: rtl8192u: Fix no spaces around '+'
Akash Kumar [Wed, 6 Dec 2017 16:02:01 +0000 (21:32 +0530)]
Staging: rtl8192u: Fix no spaces around '+'

Added spaces around '+'. Warning found using checkpatch.pl
Signed-off-by: Akash Kumar <bholuakku@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: Remove redundant else keyword
Luis de Bethencourt [Wed, 6 Dec 2017 19:17:00 +0000 (19:17 +0000)]
staging: lustre: llite: Remove redundant else keyword

There is no need to use 'else' if in main branch 'return' is present.

Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: Remove redundant else keyword
Luis de Bethencourt [Wed, 6 Dec 2017 19:16:59 +0000 (19:16 +0000)]
staging: lustre: llite: Remove redundant else keyword

There is no need to use 'else' if in main branch 'goto' is present.

Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: Remove else after goto
Luis de Bethencourt [Wed, 6 Dec 2017 19:16:58 +0000 (19:16 +0000)]
staging: lustre: llite: Remove else after goto

If an "if" branch is terminated by a "goto", there's no need to have an
"else" statement and an indented block of code.

Remove the "else" statement to simplify the code flow.

Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Remove SET_CHECKED usage from pi433_probe
Simon Sandström [Wed, 6 Dec 2017 20:42:24 +0000 (21:42 +0100)]
staging: pi433: Remove SET_CHECKED usage from pi433_probe

SET_CHECKED returns from the function on failure and in pi433_probe it is
necessary to free the GPIOs and the device on failure.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Move enum option_on_off to pi433_if.h
Simon Sandström [Wed, 6 Dec 2017 20:42:23 +0000 (21:42 +0100)]
staging: pi433: Move enum option_on_off to pi433_if.h

The enum is now only used for ioctl, so move it pi433_if.h.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Combine all rf69_set_amplifier_x()
Simon Sandström [Wed, 6 Dec 2017 20:42:22 +0000 (21:42 +0100)]
staging: pi433: Combine all rf69_set_amplifier_x()

Replaces the functions rf69_set_amplifier_1, _2, _3 with two
functions: rf69_enable_amplifier(dev, amp_mask) and
rf69_disable_amplifier(dev, amp_mask).

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Remove enum data_mode
Simon Sandström [Wed, 6 Dec 2017 20:42:21 +0000 (21:42 +0100)]
staging: pi433: Remove enum data_mode

Call rf69_set_data_mode with DATAMODUL_MODE value directly.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Split rf69_set_sync_enabled into two functions
Simon Sandström [Wed, 6 Dec 2017 20:42:20 +0000 (21:42 +0100)]
staging: pi433: Split rf69_set_sync_enabled into two functions

Splits rf69_set_sync_enabled(dev, enabled) into
rf69_enable_sync(dev) and rf69_disable_sync(dev).

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Split rf69_set_crc_enabled into two functions
Simon Sandström [Wed, 6 Dec 2017 20:42:19 +0000 (21:42 +0100)]
staging: pi433: Split rf69_set_crc_enabled into two functions

Splits rf69_set_crc_enabled(dev, enabled) into
rf69_enable_crc(dev) and rf69_disable_crc(dev).

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agodrivers: staging: remove duplicate includes
Pravin Shedge [Wed, 6 Dec 2017 17:12:08 +0000 (22:42 +0530)]
drivers: staging: remove duplicate includes

These duplicate includes have been found with scripts/checkincludes.pl but
they have been removed manually to avoid removing false positives.

Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: move dependencies from UNISYSSPAR to VISORBUS
David Kershner [Wed, 6 Dec 2017 16:05:28 +0000 (11:05 -0500)]
staging: unisys: move dependencies from UNISYSSPAR to VISORBUS

The Kconfig flag UNISYSSPAR depended on ACPI and X86, these dependencies
really belong to visorbus, so move them there.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: combine visorchannel.h and visorbus.h
David Kershner [Wed, 6 Dec 2017 16:05:27 +0000 (11:05 -0500)]
staging: unisys: combine visorchannel.h and visorbus.h

Combine the include files visorchannel.h and visorbus.h so that only one
include file is needed for the .c files.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: remove !UML flag
David Kershner [Wed, 6 Dec 2017 16:05:26 +0000 (11:05 -0500)]
staging: unisys: remove !UML flag

Remove the dependency that the drivers are not built during UML.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: fix dependencies with UNISYSSPAR Kconfig flag
David Kershner [Wed, 6 Dec 2017 16:05:25 +0000 (11:05 -0500)]
staging: unisys: fix dependencies with UNISYSSPAR Kconfig flag

The Kconfig file for UNISYSSPAR uses select ACPI and select PCI instead of
depends on ACPI. This patch fixes the problem.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Rename enum modShaping in rf69_enum.h
Simon Sandström [Tue, 5 Dec 2017 22:08:43 +0000 (23:08 +0100)]
staging: pi433: Rename enum modShaping in rf69_enum.h

Renames enum modShaping and its values to get rid of checkpatch.pl
warnings: "Avoid CamelCase: <modShaping>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: rf69.c: Replace macros READ_REG and WRITE_REG with smarter functions
Marcus Wolf [Mon, 4 Dec 2017 21:45:16 +0000 (23:45 +0200)]
staging: pi433: rf69.c: Replace macros READ_REG and WRITE_REG with smarter functions

To increase the readability of the register accesses, the abstraction
of the helpers was increased from simple read and write to set bit,
clear bit and read modify write bit.

Annotation: This patch contains a lot of long lines and camel case
var names. These long lines and camel case vars weren't introduced
by this patch, but were long and camel cased before.

Signed-off-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Rename enum optionOnOff in rf69_enum.h
Simon Sandström [Tue, 5 Dec 2017 22:08:42 +0000 (23:08 +0100)]
staging: pi433: Rename enum optionOnOff in rf69_enum.h

Renames the enum optionOnOff and its values optionOn, optionOff to enum
option_on_off and OPTION_ON, OPTION_OFF. Fixes checkpatch.pl warnings:
"Avoid CamelCase: <optionOnOff>, <optionOn>, <optionOff>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Rename variable in struct pi433_rx_cfg
Simon Sandström [Tue, 5 Dec 2017 22:08:41 +0000 (23:08 +0100)]
staging: pi433: Rename variable in struct pi433_rx_cfg

Renames variable thresholdDecrement in struct pi433_rx_cfg to
threshold_decrement to get rid of checkpatch.pl warning
"Avoid CamelCase: <thresholdDecrement>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Capitalize constant definitions
Simon Sandström [Tue, 5 Dec 2017 22:08:40 +0000 (23:08 +0100)]
staging: pi433: Capitalize constant definitions

Fixes checkpatch.pl warnings "Avoid CamelCase <DIO_x>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: Fix indentation in rf69_enum.h
Simon Sandström [Tue, 5 Dec 2017 22:08:39 +0000 (23:08 +0100)]
staging: pi433: Fix indentation in rf69_enum.h

Basically just 's/    /\t/', to fix checkpatch.pl warnings:
"please, no spaces at the start of a line".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()
Andrii [Wed, 6 Dec 2017 09:33:10 +0000 (11:33 +0200)]
staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()

Change 0 to NULL in lov_object_fiemap() in order to fix warning produced by
sparse

Signed-off-by: Andrii Vladyka <tulup@mail.ru>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge Linus's staging merge point into staging-next
Greg Kroah-Hartman [Wed, 6 Dec 2017 14:27:17 +0000 (15:27 +0100)]
Merge Linus's staging merge point into staging-next

This resolves the merge issue pointed out by Stephen in
drivers/iio/adc/meson_saradc.c.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: dgnc: add identifiers to function parameters
Ashish Kalra [Fri, 1 Dec 2017 17:26:29 +0000 (22:56 +0530)]
staging: dgnc: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: add identifiers to function parameters
Ashish Kalra [Sat, 2 Dec 2017 17:29:27 +0000 (22:59 +0530)]
staging: android: add identifiers to function parameters

Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: Fix checkpatch.pl error
Ashish Kalra [Sat, 2 Dec 2017 17:21:05 +0000 (22:51 +0530)]
staging: android: Fix checkpatch.pl error

fixed CHECK: Lines should not end with a '('
reported by checkpatch.pl

Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: olpc_dcon: Line up parentheses in func calls and defs
Zebulon McCorkle [Tue, 21 Nov 2017 20:51:15 +0000 (14:51 -0600)]
staging: olpc_dcon: Line up parentheses in func calls and defs

Line up arguments to opening parentheses and ensure lines stay under 80
columns, since checkpatch.pl was complaining about incorrect indentation
in function calls and definitions.

Signed-off-by: Zebulon McCorkle <zebmccorkle@zeb.fun>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: olpc_dcon: Change bitshifts to BIT macro
Zebulon McCorkle [Tue, 21 Nov 2017 20:51:14 +0000 (14:51 -0600)]
staging: olpc_dcon: Change bitshifts to BIT macro

checkpatch.pl reported the bitshifts (1<<x) as a style violation, so
change them to the BIT macro (BIT(x)).

Signed-off-by: Zebulon McCorkle <zebmccorkle@zeb.fun>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: xgifb: remove macros with hidden variable
Joshua Abraham [Sat, 2 Dec 2017 01:39:09 +0000 (20:39 -0500)]
staging: xgifb: remove macros with hidden variable

This patch removes macros in XGI_main.h that contain a xgifb_info
variable.  These macros hurt readability by hiding said variable
behind a define.  It also uses a temporary variable to keep the
replaced code from getting too long.

Signed-off-by: Joshua Abraham <j.abraham1776@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: amend aead func def for readability
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:21 +0000 (13:58 +0000)]
staging: ccree: amend aead func def for readability

Func definitions in the aead implementation were did not adhere to
coding style. Fix them for better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix AEAD func naming convention
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:20 +0000 (13:58 +0000)]
staging: ccree: fix AEAD func naming convention

The aead files was using a func naming convention which was inconsistent
(ssi vs. cc), included a useless prefix (ssi_aead) and often used
too long function names producing monster func names such as
ssi_aead_gcm_setup_ghash_desc() that made the call site code hard
to read.

Make the code more readable by switching to a simpler, consistent naming
conventionfor all the function defined in the file.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: NULLify backup_info when unused
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:19 +0000 (13:58 +0000)]
staging: ccree: NULLify backup_info when unused

backup_info field is only allocated for decrypt code path.
The field was not nullified when not used causing a kfree
in an error handling path to attempt to free random
addresses as uncovered in stress testing.

Fixes: 737aed947f9b ("staging: ccree: save ciphertext for CTS IV")
Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: update TODO list
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:18 +0000 (13:58 +0000)]
staging: ccree: update TODO list

Update the ccree staging TODO list in light of recent work.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove interim DT docs
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:17 +0000 (13:58 +0000)]
staging: ccree: remove interim DT docs

As proper DT bindings doc where submitted and ACKed,
remove the interim one.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove braces for single statement blocks
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:16 +0000 (13:58 +0000)]
staging: ccree: remove braces for single statement blocks

Remove braces from single statement if clause.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: fix indentation of var assignment
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:15 +0000 (13:58 +0000)]
staging: ccree: fix indentation of var assignment

Fix indentation of var assignment split across lines for
better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove more unnecessary parentheses
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:14 +0000 (13:58 +0000)]
staging: ccree: remove more unnecessary parentheses

The removal of likely/unlikely unearthed some more
unnecessary parentheses. Remove them for better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove unproven likely/unlikely
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:13 +0000 (13:58 +0000)]
staging: ccree: remove unproven likely/unlikely

The ccree code made a lot of use of likely/unlikely qualifiers without
proven measurements showing any benefits. Remove them all until we
see what is justified and what is not.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ccree: remove inline qualifiers
Gilad Ben-Yossef [Sun, 3 Dec 2017 13:58:12 +0000 (13:58 +0000)]
staging: ccree: remove inline qualifiers

The ccree drivers was marking a lot of big functions in C file as
static inline for no good reason. Remove the inline qualifier from
any but the few truly single line functions.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Use __func__
Genki Sky [Wed, 6 Dec 2017 00:09:55 +0000 (19:09 -0500)]
staging: vc04_services: Use __func__

This was found using checkpatch.pl's EMBEDDED_FUNCTION_NAME warning.
It is easier to be consistent and always use __func__ instead of having
to remember to update any hardcoded references to the original name.

Signed-off-by: Genki Sky <sky@genki.is>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>