Todd Poynor
de3690d025
staging: gasket: common ioctl dispatcher add __user annotations
...
Add __user annotation to gasket core common ioctl pointer arguments for
sparse checking.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:36 +02:00
Todd Poynor
c13435deaa
staging: gasket: apex ioctl add __user annotations
...
Add __user annotation to ioctl pointer argument, for sparse checking.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:36 +02:00
Todd Poynor
761d8db714
staging: gasket: top ioctl handler add __user annotations
...
Add __user annotation to gasket_core top-level ioctl handling pointer
arguments, for sparse checking.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
ed74277bd8
staging: gasket: always allow root open for write
...
Always allow root to open device for writing.
Drop special-casing of ioctl permissions for root vs. owner.
Convert to bool types as appropriate.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
563f3bb51f
staging: gasket: fix multi-line comment syntax in gasket_core.h
...
Use consistent kernel-style multi-line comment syntax.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
40eb350231
staging: gasket: remove extra parens in gasket_write_mappable_regions
...
Remove unneeded parentheses around subexpressions.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
fd5d76ab69
staging: gasket: gasket_mmap use PAGE_MASK
...
gasket_mmap use PAGE_MASK, instead of performing math on PAGE_SIZE, for
simplicity and clarity.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
0b184cc865
staging: gasket: remove unnecessary parens in page table code
...
gasket_alloc_coherent_memory() extra parentheses in statement.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
4e48c29fe0
staging: gasket: fix comment syntax in apex.h
...
Use kernel-style multi-line comment syntax.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
6d8a1d564b
staging: gasket: remove else clause after return in if clause
...
Else after return is unnecessary and may cause static code checkers to
complain.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
c5172a29d7
staging: gasket: gasket page table functions use bool return type
...
Convert from int to bool return type for gasket page table functions
that return values used as booleans.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
9116223b84
staging: gasket: apex_clock_gating simplify logic, reduce indentation
...
Collapse together two checks and return immediately, avoid conditional
indentation for most of function code.
Reported-by: Guenter Roeck <groeck@chromium.org >
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
e80d8afc97
staging: gasket: gasket_mmap return error instead of valid BAR index
...
When offset to be mapped matches both a BAR region and a coherent mapped
region return an error as intended, not the BAR index.
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
ec45f01668
staging: gasket: don't treat no device reset callback as an error
...
It is not an error for a device to not have a reset callback registered.
Signed-off-by: Simon Que <sque@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
ed6e96c795
staging: gasket: remove unnecessary code in coherent allocator
...
Remove extraneous statement in gasket_config_coherent_allocator()
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
ae27b2f9f7
staging: gasket: fix class create bug handling
...
class_create() never returns NULL, and this driver should never return
PTR_ERR(NULL) anyway.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Reviewed-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
b6fdbbb743
staging: gasket: remove code for no physical device
...
gasket_enable_dev code for enabling a gasket device with no physical PCI
device registered shouldn't be necessary.
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:35 +02:00
Todd Poynor
7a013c5026
staging: gasket: gasket_enable_dev remove unnecessary variable
...
Remove unnecessary variable, pass constant param instead.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:34 +02:00
Todd Poynor
ec54d1abef
staging: gasket: allow compile for ARM64 in Kconfig
...
The gasket and apex drivers are also to be used on ARM64 architectures.
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-21 08:50:34 +02:00
Todd Poynor
d7db5843bc
staging: gasket: drop gasket_cdev_get_info, use container_of
...
Remove gasket_cdev_get_info(), use container_of() directly instead,
drop unnecessary NULL checks.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
45042402ae
staging: gasket: bail out of reset sequence on device callback error
...
If device reset callback returns an error, error out at the gasket
level.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
72a23054a9
staging: gasket: gasket_wait_with_reschedule use 32 bits of retry count
...
Don't need a 64-bit retry counter.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
a42ea3d61c
staging: gasket: gasket_wait_with_reschedule simplify logic
...
gasket_wait_with_reschedule() is a little more clear if we just return
directly when the waited-for condition is hit. This also allows the
following condition check to be removed and identation of the
conditionally-executed code to be reduced.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
c17acfdf4a
staging: gasket: gasket_wait_with_reschedule use msleep
...
Replace schedule_timeout() call with msleep() for simplicity.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
24dfee40e6
staging: gasket: fix gasket_wait_with_reschedule timeout return code
...
Return -ETIMEDOUT, not -EINVAL, on timeout, including callers.
Reported-by: Dmitry Torokhov <dtor@chromium.org >
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
e24fbaf73f
staging: gasket: convert gasket_mmap_has_permissions to bool return
...
gasket_mmap_has_permissions() should return a boolean value.
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
03c25b3ad0
staging: gasket: Remove stale pointers on error allocating attr array
...
If gasket_sysfs_create_mapping() hits errors allocating the attribute
array, remove stale pointers to device info from the mapping object.
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
cf2865a0c7
staging: gasket: Return EBUSY on mapping create when already in use
...
gasket_sysfs_create_mapping() return EBUSY if sysfs mapping already in
use, as a more appropriate error code than the current return of EINVAL,
which would indicate invalid parameters.
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
722c902aac
staging: gasket: hold mutex on gasket driver unregistration
...
Take the global mutex on driver unregistration updates for proper
ordering of updates and consistent access procedures.
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
ba6585847e
staging: gasket: remove driver registration on class creation failure
...
If class_create() fails, remove the gasket driver from the global
registration table.
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
b17cef4d08
staging: gasket: whitespace fix in gasket_page_table_init
...
Tab replaced with space.
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:47 +02:00
Todd Poynor
920953ab4e
staging: gasket: fix typo in gasket_core.h comments
...
Grammar fixup in gasket_core.h comments describing struct
gasket_interrupt_desc.
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:46 +02:00
Todd Poynor
7e8a450aa0
staging: gasket: fix typo in apex_enter_reset
...
Fix typo in log message.
Signed-off-by: Zhongze Hu <frankhu@chromium.org >
Signed-off-by: Todd Poynor <toddpoynor@google.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-19 11:39:46 +02:00
Tobias Lindskog
173a4906ae
staging: android: ashmem: Shrink directly through shmem_fallocate
...
When ashmem_shrink is called from direct reclaim on a user thread, a
call to do_fallocate will check for permissions against the security
policy of that user thread. It can thus fail by chance if called on a
thread that isn't permitted to modify the relevant ashmem areas.
Because we know that we have a shmem file underneath, call the shmem
implementation of fallocate directly instead of going through the
user-space interface for fallocate.
Signed-off-by: Tobias Lindskog <tobias.lindskog@sonymobile.com >
Signed-off-by: Jeff Vander Stoep <jeffv@google.com >
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 11:49:16 +02:00
Matthias Wolf
ab608b341b
staging: fbtft: Fix line continuation
...
Fix checkpatch warning: avoid unnecessary line continuation
to allow grepping of whole error message.
Signed-off-by: Matthias Wolf <der_wolf_@web.de >
Signed-off-by: Felix Siegel <felix.siegel@stud.uni-hannover.de >
Signed-off-by: Tim Cofala <cofala@stud.uni-hannover.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 11:47:12 +02:00
Matthias Wolf
66558395e1
staging: fbtft: Fix line over 80 characters
...
Fix checkpatch line over 80 characters where it seemed appropriate
Signed-off-by: Matthias Wolf <der_wolf_@web.de >
Signed-off-by: Felix Siegel <felix.siegel@stud.uni-hannover.de >
Signed-off-by: Tim Cofala <cofala@stud.uni-hannover.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 11:47:12 +02:00
Nishad Kamdar
642e0692be
staging: comedi: comedi_fops: Shift assignment operator '=' to previous line
...
Shift '=' assignment operator to the end of previous
line to conform to preferred kernel style line wrapping.
Issue reported by checkpatch CHECK.
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com >
Reviewed-by: Ian Abbott <abbotti@mev.co.uk >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 11:47:12 +02:00
Michael Straube
65f3264177
staging: rtl8188eu: remove redundant header file
...
Both functions declared in rtl8188e_led.h are also declared in
rtw_led.h which is included from drv_types.h. Remove rtl8188e_led.h
and it's includes.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:38:19 +02:00
Michael Straube
cfd707e2f7
staging: rtl8188eu: add spaces around '+'
...
Add spaces around '+' to follow kernel coding style.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:38:19 +02:00
Michael Straube
3cedbfb851
staging: rtl8188eu: rename variable
...
Rename variable to avoid CamelCase.
tmpV16 -> tmpv16
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:38:19 +02:00
Michael Straube
b5a870456f
staging: rtl8188eu: rename function parameters
...
Rename function parameters to avoid CamelCase.
bWrite -> write
PwrState -> pwrstate
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:38:19 +02:00
Michael Straube
c7279e34cb
staging: rtl8188eu: rename Efuse_PowerSwitch
...
Rename function to avoid CamelCase.
Efuse_PowerSwitch -> efuse_power_switch
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:38:19 +02:00
Michael Straube
8c6ade2e0c
staging: rtl8188eu: do not line break function definition
...
Do not line break function definition of Efuse_PowerSwitch().
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:38:19 +02:00
Oliver Hübers
7d6bc56932
staging: mt7621: Add SPDX license identifier
...
Signed-off-by: Oliver Hübers <oliver.huebers@web.de >
Signed-off-by: Vanessa Borgmann <nessa.x@web.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:35:59 +02:00
Michael Straube
884d5ba53f
staging: rtl8188eu: remove is_{multicast,broadcast}_mac_addr
...
Remove custom is_multicast_mac_addr() and is_broadcast_mac_addr().
Use is_multicast_ether_addr() instead.
By definition the broadcast address is also a multicast address.
is_multicast_ether_addr() returns true for broadcast addresses.
Hence checking for multicast in the conditional is sufficient.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:35:59 +02:00
Oliver Hübers
bb4e1ca9b2
staging: mt7621-pci: Include preferred headers
...
This fixes the following checkpatch warnings:
Use #include <linux/pci.h> instead of <asm/pci.h>
Use #include <linux/io.h> instead of <asm/io.h>
Signed-off-by: Oliver Hübers <oliver.huebers@web.de >
Signed-off-by: Vanessa Borgmann <nessa.x@web.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:19:14 +02:00
Cristian Kubis
9b59883c14
staging: olpc_dcon: add missing identifier names
...
Add missing function argument identifier names as suggested by
checkpatch.pl.
Signed-off-by: Cristian Kubis <cristian.kubis@tsunix.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:19:14 +02:00
Cristian Kubis
0b37913150
staging: olpc_dcon: prefer 'help' in KConfig
...
Fix for a style warning reported by checkpatch.pl in KConfig
suggesting to use 'help' instead of '---help---'.
Signed-off-by: Cristian Kubis <cristian.kubis@tsunix.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:19:14 +02:00
Ivan Safonov
515ce733e8
staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames
...
Put data to skb, decrypt with lib80211_crypt_ccmp, and place back to tx buffer.
Signed-off-by: Ivan Safonov <insafonov@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:19:14 +02:00
Ivan Safonov
0d4876f4e9
staging:r8188eu: Use lib80211 to encrypt (TKIP) tx frames
...
Put data to skb, decrypt with lib80211_crypt_tkip, and place back to tx buffer.
MIC calculation will be replaced later.
Signed-off-by: Ivan Safonov <insafonov@gmail.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-07-16 10:19:14 +02:00