aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-01-08staging: android: check for error from register_shrinker in ↵Xiongwei Song3-5/+10
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: android: ashmem: add procfs fdinfo helperZhai Zhaoxuan1-0/+19
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: most: convert macro to static functionGeorge Edward Bulmer1-5/+7
This fixes checkpatch warning: CHECK: Macro argument reuse 'buf' - possible side effects? Signed-off-by: George Edward Bulmer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: most: Fix identifiers to function parametersRavi Eluri2-4/+4
fixed "function definition argument should have an identifier name", with appropriate identifier names. Pointed out by checkpatch. Signed-off-by: Ravi Eluri <[email protected]> Signed-off-by: Suniel Mahesh <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: most: Avoid trailing semicolon for macrosRavi Eluri1-1/+1
Fixes checkpatch warning: macros should not use a trailing semicolon. Signed-off-by: Ravi Eluri <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08Staging: pi433 - fix ccheckpatch issue, updated include line.Derek Robson1-1/+1
Updated the include of compat.h to fix checkpatch error Signed-off-by: Derek Robson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: pi433: fix CamelCase for payload identifiersValentin Vidic4-6/+6
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <payloadLength> CHECK: Avoid CamelCase: <payloadReady> Signed-off-by: Valentin Vidic <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: pi433: fix CamelCase for maxMinus variablesValentin Vidic3-17/+17
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: pi433: remove unused rf69_reset_flag functionMarcin Ciupak2-13/+0
Function rf69_reset_flag is unused and should be removed. Signed-off-by: Marcin Ciupak <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: pi433: remove unused rf69_set_sync_tolerance functionMarcin Ciupak2-13/+0
Function rf69_set_sync_tolerance is unused and should be removed. Signed-off-by: Marcin Ciupak <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: update TODOGilad Ben-Yossef1-1/+1
Update TODO to reflect work done Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08stating: ccree: fix allocation of void sized bufGilad Ben-Yossef2-8/+10
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: [email protected] Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: put pointer next to var nameGilad Ben-Yossef1-1/+1
Put pointer next to var name as per coding style. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: fold common code into service funcGilad Ben-Yossef1-223/+116
Fold common code in hash call into service functions. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: fix indentation of func paramsGilad Ben-Yossef1-26/+20
Fix indentation of some function params in hash code for better readability. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: do not map bufs in ahash_initGilad Ben-Yossef1-89/+103
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/[email protected]/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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: allocate hash bufs inside req ctxGilad Ben-Yossef2-68/+12
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: use array for double bufferGilad Ben-Yossef3-37/+46
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: remove unused fieldGilad Ben-Yossef1-1/+0
Remove unused struct field. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: use Makefile to include PM codeGilad Ben-Yossef4-32/+37
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: handle end of sg list gracefullyGilad Ben-Yossef1-1/+1
If we are asked for number of entries of an offset bigger than the sg list we should not crash. Cc: [email protected] Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: check DMA pool buf !NULL before freeGilad Ben-Yossef1-1/+2
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: [email protected] Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: failing the suspend is not an errorGilad Ben-Yossef1-7/+1
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08stating: ccree: revert "staging: ccree: fix leak of import() after init()"Gilad Ben-Yossef1-7/+4
This reverts commit c5f39d07860c ("staging: ccree: fix leak of import() after init()") and commit aece09024414 ("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: [email protected] Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: add backlog processingGilad Ben-Yossef5-42/+163
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: break send_request and fix ret valGilad Ben-Yossef5-94/+128
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: remove unused leftover fieldGilad Ben-Yossef1-1/+0
Remove the unused monitor_desc field. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: tag debugfs init/exit func properlyGilad Ben-Yossef1-2/+2
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: copy larval digest from RAMGilad Ben-Yossef3-57/+68
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: pick alloc mem flags based on req flagsGilad Ben-Yossef5-35/+54
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: remove GFP_DMA flag from mem allocsGilad Ben-Yossef2-10/+7
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: fold reg common defines into driverGilad Ben-Yossef3-17/+5
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: fold hash defs into queue defsGilad Ben-Yossef3-24/+13
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: SPDXify driverGilad Ben-Yossef31-435/+62
Replace verbatim GPL v2 copy with SPDX tag. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: ccree: mark debug_regs[] as staticArnd Bergmann1-1/+1
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: 9bdd203b4dc8 ("s3cmci: add debugfs support for examining driver and hardware state") Fixes: b3ec9a6736f2 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08vboxvideo: Fix incorrect type in assignment sparse warningAlexander Kapshuk2-2/+2
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 <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08drivers/fbtft: Remove unnecessary braces from if/elseLuis Gerhorst1-6/+5
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 <[email protected]> Acked-by: Jonny Schaefer <[email protected]> Acked-by: Alexander Wuerstlein <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08drivers/fbtft: Remove newline after else in else-ifLuis Gerhorst1-2/+1
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 <[email protected]> Acked-by: Jonny Schaefer <[email protected]> Acked-by: Alexander Wuerstlein <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08Staging: lustre: Fix prefer kcalloc over kzalloc with multiplySumit Pundir1-1/+1
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08Staging: lustre: Fix prefer seq_puts to seq_printfSumit Pundir1-3/+3
Use seq_puts() for strings without format specifiers instead of seq_printf(). Issue reported by checkpatch.pl Signed-off-by: Sumit Pundir <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08drivers: lustre: obdclass: simplify unregister_shrinker() usageAliaksei Karaliou1-2/+1
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 <[email protected]> Reviewed-by: Andreas Dilger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: lnet: discard CFS_ALLOC_PTRNeilBrown2-8/+5
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: lnet-lib: opencode some alloc/free functions.NeilBrown8-89/+28
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: libcfs: remove prngNeilBrown3-148/+1
The cfs prng is no longer used, so discard it. Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: replace cfs_get_random_bytes calls with get_random_byte()NeilBrown3-3/+3
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: replace cfs_srand() calls with add_device_randomness().NeilBrown3-26/+13
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: replace cfs_rand() with prandom_u32_max()NeilBrown4-23/+25
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: libcfs: remove wi_data from cfs_workitemNeilBrown4-14/+11
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: libcfs: use a workqueue for rehash work.NeilBrown4-75/+31
lustre has a work-item queuing scheme that provides the same functionality as linux work_queues. To make the code easier for linux devs to follow, change to use work_queues. Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-01-08staging: lustre: obd_mount: fix possible race with module unload.NeilBrown3-17/+24
lustre_fill_super() calls client_fill_super() without holding a reference to the module containing client_fill_super. If that module is unloaded at a bad time, this can crash. To be able to get a reference to the module using try_get_module(), we need a pointer to the module. So replace lustre_register_client_fill_super() and lustre_register_kill_super_cb() with a single lustre_register_super_ops() which also passed a module pointer. Then use a spinlock to ensure the module pointer isn't removed while try_module_get() is running, and use try_module_get() to ensure we have a reference before calling client_fill_super(). Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>