Commit graph

724208 commits

Author SHA1 Message Date
Philippe Loctaux 9d4c0c9f6a Staging: vme: vme_user: fixed an alignment coding style issue
Fixed a coding style issue.

Signed-off-by: Philippe Loctaux <loctauxphilippe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:41:36 +01:00
Xiongwei Song fb02205a18 staging: android: check the return value of register_shrinker
register_shrinker call is made in ashmem_init, it may return error code,
so we need to check it.

Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:37:18 +01:00
Xiongwei Song 47ac54e877 staging: android: check for error from register_shrinker in ion_heap_init_shrinker
The function register_shrinker in ion_heap_init_shrinker may return an
error, check it out. Meanwhile, ion_heap_init_shrinker has to a return
value.

Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:37:18 +01:00
Zhai Zhaoxuan a941f70e55 staging: android: ashmem: add procfs fdinfo helper
This print the inode number of backing file and the name in
/proc/pid/fdinfo/fd.
These information helps users to know which processes are sharing the same
ashmem.

Signed-off-by: Zhai Zhaoxuan <kxuanobj@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:37:18 +01:00
George Edward Bulmer 6724ed7f28 staging: most: convert macro to static function
This fixes checkpatch warning:
CHECK: Macro argument reuse 'buf' - possible side effects?

Signed-off-by: George Edward Bulmer <gebulmer@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:36:00 +01:00
Ravi Eluri 9917b209f8 staging: most: Fix identifiers to function parameters
fixed "function definition argument should have an identifier name",
with appropriate identifier names. Pointed out by checkpatch.

Signed-off-by: Ravi Eluri <venkataravi.e@techveda.org>
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:34:25 +01:00
Ravi Eluri 37d641ef37 staging: most: Avoid trailing semicolon for macros
Fixes checkpatch warning:
macros should not use a trailing semicolon.

Signed-off-by: Ravi Eluri <venkataravi.e@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:34:25 +01:00
Derek Robson 7b4c570ee5 Staging: pi433 - fix ccheckpatch issue, updated include line.
Updated the include of compat.h to fix checkpatch error

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:33:33 +01:00
Valentin Vidic 0b9acf7ddb staging: pi433: fix CamelCase for payload identifiers
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <payloadLength>
  CHECK: Avoid CamelCase: <payloadReady>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:32:27 +01:00
Valentin Vidic b167a524d2 staging: pi433: fix CamelCase for maxMinus variables
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <maxMinus12>
  CHECK: Avoid CamelCase: <maxMinus24>
  CHECK: Avoid CamelCase: <maxMinus36>
  CHECK: Avoid CamelCase: <maxMinus48>
  CHECK: Avoid CamelCase: <maxMinus6>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:32:23 +01:00
Marcin Ciupak 7ebee24ba1 staging: pi433: remove unused rf69_reset_flag function
Function rf69_reset_flag is unused and should be removed.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:30:47 +01:00
Marcin Ciupak 109fb18fcc staging: pi433: remove unused rf69_set_sync_tolerance function
Function rf69_set_sync_tolerance is unused and should be removed.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:30:47 +01:00
Gilad Ben-Yossef 3c464ca5b8 staging: ccree: update TODO
Update TODO to reflect work done

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:29:39 +01:00
Gilad Ben-Yossef 2392b84fb2 stating: ccree: fix allocation of void sized buf
We were allocating buffers using sizeof(*struct->field) where field was
type void.  Fix it by having a local variable with the real type.

Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:29:36 +01:00
Gilad Ben-Yossef abb8492b2a staging: ccree: put pointer next to var name
Put pointer next to var name as per coding style.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:29:36 +01:00
Gilad Ben-Yossef 28b1ad901f staging: ccree: fold common code into service func
Fold common code in hash call into service functions.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:29:36 +01:00
Gilad Ben-Yossef 0d207bd44d staging: ccree: fix indentation of func params
Fix indentation of some function params in hash code for
better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:29:36 +01:00
Gilad Ben-Yossef 2c8cdb6b5d staging: ccree: do not map bufs in ahash_init
hash_init was mapping DMA memory that were then being unmap in
hash_digest/final/finup callbacks, which is against the Crypto API
usage rules (see discussion at
https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30077.html)

Fix it by moving all buffer mapping/unmapping or each Crypto API op.

This also properly deals with hash_import() not knowing if
hash_init was called or not as it now no longer matters.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 9b3044b88e staging: ccree: allocate hash bufs inside req ctx
Move to allocating the buffers needed for requests as part of
the request structure instead of malloc'ing each one on it's
own, making for simpler (and more efficient) code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 89c2db889d staging: ccree: use array for double buffer
The ccree hash code is using a double buffer to hold data
for processing but manages the buffers and their associated
data count in two separate fields and uses a predicate to
chose which to use.

Move to using a proper 2 members array for a much cleaner code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 46856e6cf2 staging: ccree: remove unused field
Remove unused struct field.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 327256908d staging: ccree: use Makefile to include PM code
Replace ugly ifdefs with some inline macros and Makefile magic
for optionally including power management related code for
better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 6e92010b01 staging: ccree: handle end of sg list gracefully
If we are asked for number of entries of an offset bigger than the
sg list we should not crash.

Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 2f7caf6b02 staging: ccree: check DMA pool buf !NULL before free
If we ran out of DMA pool buffers, we get into the unmap
code path with a NULL before. Deal with this by checking
the virtual mapping is not NULL.

Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 5ced266469 staging: ccree: failing the suspend is not an error
PM suspend returning a none zero value is not an error. It simply
indicates a suspend is not advised right now so don't treat it as
an error.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 293edc27f8 stating: ccree: revert "staging: ccree: fix leak of import() after init()"
This reverts commit c5f39d0786 ("staging: ccree: fix leak of import()
after init()") and commit aece090244 ("staging: ccree: Uninitialized
return in ssi_ahash_import()").

This is the wrong solution and ends up relying on uninitialized memory,
although it was not obvious to me at the time.

Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:23 +01:00
Gilad Ben-Yossef 7345b14dea staging: ccree: add backlog processing
Crypto API tfm providers are required to provide a backlog
service, if so indicated, that queues up requests in the case
of the provider being busy and processing them later.

The ccree driver did not provide this facility. Add it now.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef 0f70db7033 staging: ccree: break send_request and fix ret val
The send_request() function was handling both synchronous
and asynchronous invocations, but were not handling
the asynchronous case, which may be called in an atomic
context, properly as it was sleeping.

Start to fix the problem by breaking up the two use
cases to separate functions calling a common internal
service function and return error instead of sleeping
for the asynchronous case.

The next patch will complete the fix by implementing
proper backlog handling.

Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver").
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef 266844f13e staging: ccree: remove unused leftover field
Remove the unused monitor_desc field.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef 48520f8cfa staging: ccree: tag debugfs init/exit func properly
The debugfs global init and exit functions were missing
__init and __exit tags, potentially wasting memory.
Fix it by properly tagging them.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef b070ed04c3 staging: ccree: copy larval digest from RAM
The ccree driver was using a DMA operation to copy larval digest
from the ccree SRAM to RAM. Replace it with a simple memcpy.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef 1b33fb7aed staging: ccree: pick alloc mem flags based on req flags
The ccree driver was allocating memory using GFP_KERNEL flag
always, ignoring the flags set in the crypto request. Fix it
by choosing gfp flags based on crypto request flags.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef ee70ad833a staging: ccree: remove GFP_DMA flag from mem allocs
Remove bogus GFP_DMA flag from memory allocations. ccree driver
does not operate over an ISA or similar limited bus.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef a3ddcf6604 staging: ccree: fold reg common defines into driver
Fold the 2 macro defined in dx_reg_common.h into the file they
are used in and delete the file.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef 977cd76c2d staging: ccree: fold hash defs into queue defs
Fold the two remaining enum in hash defs into the queue defs
that are using them and delete the hash defs include file.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:27:22 +01:00
Gilad Ben-Yossef 70da8241af staging: ccree: SPDXify driver
Replace verbatim GPL v2 copy with SPDX tag.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:26:15 +01:00
Arnd Bergmann c7fc46fd14 staging: ccree: mark debug_regs[] as static
The global array clashes with an existing symbol of the same name:

drivers/staging/ccree/cc_debugfs.o:(.data+0x0): multiple definition of `debug_regs'
drivers/mmc/host/s3cmci.o:(.data+0x70): first defined here

We should fix both, this one addresses the ccree driver by removing
the symbol from the global namespace.

Fixes: 9bdd203b4d ("s3cmci: add debugfs support for examining driver and hardware state")
Fixes: b3ec9a6736 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:26:15 +01:00
Alexander Kapshuk 21c0885fd1 vboxvideo: Fix incorrect type in assignment sparse warning
Sparse emitted the following warning:
../drivers/staging/vboxvideo/vbox_fb.c:173:27: warning: incorrect type in assignment (different address spaces)
../drivers/staging/vboxvideo/vbox_fb.c:173:27:    expected char [noderef] <asn:2>*screen_base
../drivers/staging/vboxvideo/vbox_fb.c:173:27:    got void *virtual

The vbox_bo buffer object kernel mapping is handled by a call
to ttm_bo_kmap() prior to the assignment of bo->kmap.virtual to
info->screen_base of type char __iomem*.
Casting bo->kmap.virtual to char __iomem* in this assignment fixes
the warning.

vboxvideo: Fix address space of expression removal sparse warning

Sparse emitted the following warning:
../drivers/staging/vboxvideo/vbox_main.c:64:25: warning: cast removes address space of expression

vbox->vbva_buffers iomapping is handled by calling vbox_accel_init()
from vbox_hw_init().
__force attribute is used in assignment to vbva to fix the warning.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
Luis Gerhorst c3738b37d8 drivers/fbtft: Remove unnecessary braces from if/else
The Linux kernel coding style states that braces should only be used
when necessary.

This fixes the checkpatch warning

WARNING: line over 80 characters
+	} else if (display->regwidth == 8 && display->buswidth == 9 && par->spi) {

introduced by patch #1.

Signed-off-by: Luis Gerhorst <linux-kernel@luisgerhorst.de>
Acked-by: Jonny Schaefer <schaefer.jonny@gmail.com>
Acked-by: Alexander Wuerstlein <arw@cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
Luis Gerhorst 17c9d1ba9a drivers/fbtft: Remove newline after else in else-if
This removes the following warning issued by checkpatch

WARNING: suspect code indent for conditional statements (8, 8)
+	} else
+	if (display->regwidth == 8 && display->buswidth == 9 && par->spi) {

Signed-off-by: Luis Gerhorst <linux-kernel@luisgerhorst.de>
Acked-by: Jonny Schaefer <schaefer.jonny@gmail.com>
Acked-by: Alexander Wuerstlein <arw@cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
Sumit Pundir e0f1fd05af Staging: lustre: Fix prefer kcalloc over kzalloc with multiply
Use kcalloc for allocating an array instead of kzalloc with
multiply. kcalloc is the preferred API. Issue reported by
checkpatch.pl

Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
Sumit Pundir c2ff176d8c Staging: lustre: Fix prefer seq_puts to seq_printf
Use seq_puts() for strings without format specifiers instead of
seq_printf(). Issue reported by checkpatch.pl

Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
Aliaksei Karaliou a8753f02eb drivers: lustre: obdclass: simplify unregister_shrinker() usage
lu_global_fini() explicitly uses knowledge about shrinker's
internals to make decision about calling of unregister_shrinker().
Now this check was integrated into unregister_shrinker(),
so it is safe to call it against unregistered shrinker.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
NeilBrown 915fd1c2d1 staging: lustre: lnet: discard CFS_ALLOC_PTR
These trivial wrappers hurt readability and
as they use kvmalloc, they are overly generic.

So discard them and use kmalloc/kfree as is
normal in Linux.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
NeilBrown ee3b1e23bd staging: lustre: lnet-lib: opencode some alloc/free functions.
These functions just call LIBCFS_ALLOC() which in-turn
calls kvmalloc().
In none of these cases is the 'vmalloc' option needed.

LIBCFS_ALLOC also produces a warning if NULL is returned,
but that can be provided with CONFIG_SLAB_DEBUG.

LIBCFS_ALLOC zeros the memory, so we need to use
__GFP_ZERO too.

So with one exception where the alloc function is not trivial,
open-code the alloc and free functions using kmalloc and kfree.

Note that the 'size' used in lnet_md_alloc() is limited and less than
a page because LNET_MAX_IOV is 256, so kvmalloc is not needed.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
NeilBrown 508d5e0f4d staging: lustre: libcfs: remove prng
The cfs prng is no longer used, so discard it.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:45 +01:00
NeilBrown e904f839cd staging: lustre: replace cfs_get_random_bytes calls with get_random_byte()
The cfs_get_random_bytes() interface adds nothing of value
to get_random_byte() (which it uses internally).  So just use the
standard interface.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:44 +01:00
NeilBrown 30f4236aaf staging: lustre: replace cfs_srand() calls with add_device_randomness().
The only places that cfs_srand is called, the random bits are
mixed with bits from get_random_bytes().  So it is equally effective
to add entropy to either pool.
So we can replace calls to cfs_srand() with calls that add the
entropy with add_device_randomness().  That function adds time-based
entropy, so we can discard the ktime_get_ts64 calls.

One location in lustre_handles.c only adds timebased
entropy.  This cannot improve the entropy provided by get_random_bytes(),
so just discard that call.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:44 +01:00
NeilBrown bcfa98a507 staging: lustre: replace cfs_rand() with prandom_u32_max()
All occurrences of
   cfs_rand() % X
are replaced with
   prandom_u32_max(X)

cfs_rand() is a simple Linear Congruential PRNG.  prandom_u32_max()
is at least as random, is seeded with more randomness, and uses
cpu-local state to avoid cross-cpu issues.

This is the first step is discarding the libcfs prng with
the standard linux prng.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:44 +01:00
NeilBrown 19ae89d325 staging: lustre: libcfs: remove wi_data from cfs_workitem
In every case, the value passed via wi_data can be determined
from the cfs_workitem pointer using container_of().

So use container_of(), and discard wi_data.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:44 +01:00