[PATCH 02/13] staging: gasket: sysfs: hold reference to device while in use

2018-07-29 Thread Todd Poynor
From: Todd Poynor Hold a reference to the struct device while a gasket sysfs mapping exists for the device and a pointer to the struct is kept in the mapping data structures. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 11 +-- 1 file changed, 5 insertions

[PATCH 03/13] staging: gasket: page table: hold references to device and pci_dev

2018-07-29 Thread Todd Poynor
From: Todd Poynor Hold references to the struct device and the pci_dev for the page table while the data structures contian pointers to these. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a

[PATCH 11/13] staging: gasket: TODO: remove entry for static function kernel docs

2018-07-29 Thread Todd Poynor
From: Todd Poynor Remove the TODO entry for simplifying kernel doc style comments for static functions, now that this has been addressed. Signed-off-by: Todd Poynor --- drivers/staging/gasket/TODO | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gasket/TODO b/drivers/staging

[PATCH 08/13] staging: gasket: page table: simplify comments for static functions

2018-07-29 Thread Todd Poynor
From: Todd Poynor Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 323 +++-- 1 file changed, 48 inser

[PATCH 13/13] staging: gasket: apex: fix function param line continuation style

2018-07-29 Thread Todd Poynor
From: Todd Poynor Fix multi-line alignment formatting to look like: int ret = long_function_name(device, VARIABLE1, VARIABLE2, VARIABLE3, VARIABLE4); Many of these TODO items were previously cleaned up during the conversion to standard logging functions

[PATCH 10/13] staging: gasket: sysfs: simplify comments for static functions

2018-07-29 Thread Todd Poynor
From: Todd Poynor Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 28 --- 1 file changed, 4 inser

[PATCH 07/13] staging: gasket: ioctl: simplify comments for static functions

2018-07-29 Thread Todd Poynor
From: Todd Poynor Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 51 +-- 1 file changed, 9 inser

[PATCH 12/13] staging: gasket: apex: remove static function forward declarations

2018-07-29 Thread Todd Poynor
From: Todd Poynor Remove forward declarations of static functions, move code to avoid forward references, for kernel style. Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 416 --- 1 file changed, 190 insertions(+), 226 deletions(-) diff --git a

[PATCH 00/13] staging: gasket: fixes and cleanups

2018-07-29 Thread Todd Poynor
From: Todd Poynor Fixes for device reference counting and root access based on user namespace for containers, plus cleanups of comments, forward declarations for static functions (more forthcoming) and multi-line continuation style (more to come). Todd Poynor (13): staging: gasket: core: hold

[PATCH 05/13] staging: gasket: apex: simplify comments for static functions

2018-07-29 Thread Todd Poynor
From: Todd Poynor Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 64 +--- 1 file changed, 10 inser

[PATCH 06/13] staging: gasket: core: simplify comments for static functions

2018-07-29 Thread Todd Poynor
From: Todd Poynor Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 151 ++- 1 file changed, 31 inser

[PATCH 09/13] staging: gasket: interrupt: simplify comments for static functions

2018-07-29 Thread Todd Poynor
From: Todd Poynor Static functions don't need kernel doc formatting, can be simplified. Reformat comments that can be single-line. Remove extraneous text. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_interrupt.c | 18 +- 1 file changed, 1 insertion(+

[PATCH 04/13] staging: gasket: core: allow root access based on user namespace

2018-07-29 Thread Todd Poynor
From: Todd Poynor Use user namespace to determine whether gasket device file opener is root, allowing root access to containers, if necessary. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH 1/1] staging: gasket: core: hold reference on device while in use

2018-07-28 Thread Todd Poynor
From: Todd Poynor Hold a reference on the struct device while a pointer to that device is in use by gasket. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 0/1 v2] staging: gasket: fixes and cleanups

2018-07-28 Thread Todd Poynor
From: Todd Poynor The fun continues with gasket+apex: remove dead code and unnecessary stuff, fixup apex PCI class for devices that advertise class 0 (undefined), and make sure the struct device doesn't go away on us. Most of these from review comments of previous patch series. Changed pa

[PATCH 3/5] staging: gasket: sysfs: remove unnecessary NULL check on device ptr

2018-07-27 Thread Todd Poynor
From: Todd Poynor The device pointer passed into get_mapping() will never be NULL; the check is unnecessary. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/gasket

[PATCH 1/5] staging: gasket: sysfs: remove check for refcount already zero

2018-07-27 Thread Todd Poynor
From: Todd Poynor Remove the check for refcount already zero, which shouldn't be necessary. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/gasket/gasket_sysfs.c b/drivers/staging/gasket/gasket_sy

[PATCH 0/5] staging: gasket: fixes and cleanups

2018-07-27 Thread Todd Poynor
From: Todd Poynor The fun continues with gasket+apex: remove dead code and unnecessary stuff, fixup apex PCI class for devices that advertise class 0 (undefined), and make sure the struct device doesn't go away on us. Most of these from review comments of previous patch series. Todd Poyn

[PATCH 2/5] staging: gasket: apex: fixup undefined PCI class

2018-07-27 Thread Todd Poynor
From: Todd Poynor Apex chips with class 0 (PCI_CLASS_NOT_DEFINED) fixed up to PCI_CLASS_SYSTEM_OTHER to enable PCI resource assignments. Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/gasket

[PATCH 4/5] staging: gasket: page table: remove code for "no dma_ops"

2018-07-27 Thread Todd Poynor
From: Todd Poynor Remove code with TODOs on it for working around apparent problems previously seen in a qemu environment where dma_ops was not set correctly. There is no user of this in the current code. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2

[PATCH 5/5] staging: gasket: core: hold reference on device kobj while in use

2018-07-27 Thread Todd Poynor
From: Todd Poynor Hold a reference on the struct device kobject while a pointer to that device is in use by gasket. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH 01/10] staging: gasket: save struct device for a gasket device

2018-07-27 Thread Todd Poynor
On Fri, Jul 27, 2018 at 8:09 AM Greg Kroah-Hartman wrote: > > On Thu, Jul 26, 2018 at 08:07:28PM -0700, Todd Poynor wrote: > > From: Todd Poynor > > > > Save the struct device pointer to a gasket device in gasket's metadata, > > to facilitate use of standard l

Re: [PATCH 06/10] staging: gasket: sysfs: convert to standard logging

2018-07-27 Thread Todd Poynor
On Fri, Jul 27, 2018 at 8:07 AM Greg Kroah-Hartman wrote: > > On Thu, Jul 26, 2018 at 08:07:33PM -0700, Todd Poynor wrote: > > From: Todd Poynor > > > > Drop gasket logging calls in favor of standard logging. > > > > Signed-off-by: Todd Poynor > > ---

[PATCH 00/10] staging: gasket: logging cleanups

2018-07-26 Thread Todd Poynor
From: Todd Poynor Kill off gasket logging functions, convert to standard. Fixup a few formatting/style problems in the process. Todd Poynor (10): staging: gasket: save struct device for a gasket device staging: gasket: core: convert to standard logging staging: gasket: interrupt: convert

[PATCH 05/10] staging: gasket: page table: convert to standard logging

2018-07-26 Thread Todd Poynor
From: Todd Poynor Replace gasket logging calls with standard logging calls. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 131 + 1 file changed, 54 insertions(+), 77 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b

[PATCH 10/10] staging: gasket: don't print device addresses as kernel pointers

2018-07-26 Thread Todd Poynor
From: Todd Poynor Print device addresses as unsigned long, not as kernel pointers. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers

[PATCH 03/10] staging: gasket: interrupt: convert to standard logging

2018-07-26 Thread Todd Poynor
From: Todd Poynor Convert gasket logging calls to standard functions. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_interrupt.c | 67 +++ 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/gasket/gasket_interrupt.c b/drivers

[PATCH 04/10] staging: gasket: ioctl: convert to standard logging

2018-07-26 Thread Todd Poynor
From: Todd Poynor Replace gasket logging calls with standard logging calls. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/staging/gasket/gasket_ioctl.c b/drivers

[PATCH 07/10] staging: gasket: apex: convert to standard logging

2018-07-26 Thread Todd Poynor
From: Todd Poynor Drop gasket logging calls in favor of standard logging. Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 61 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/drivers/staging/gasket/apex_driver.c b/drivers

[PATCH 08/10] staging: gasket: remove gasket logging header

2018-07-26 Thread Todd Poynor
From: Todd Poynor Gasket logging functions no longer used. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_logging.h | 64 - 1 file changed, 64 deletions(-) delete mode 100644 drivers/staging/gasket/gasket_logging.h diff --git a/drivers/staging/gasket

[PATCH 06/10] staging: gasket: sysfs: convert to standard logging

2018-07-26 Thread Todd Poynor
From: Todd Poynor Drop gasket logging calls in favor of standard logging. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 73 +-- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/drivers/staging/gasket/gasket_sysfs.c b/drivers

[PATCH 09/10] staging: gasket: TODO: remove entry for convert to standard logging

2018-07-26 Thread Todd Poynor
From: Todd Poynor Gasket/apex drivers now use standard logging, remove TODO entry for this. Signed-off-by: Todd Poynor --- drivers/staging/gasket/TODO | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gasket/TODO b/drivers/staging/gasket/TODO index d3c44ca4fda25

[PATCH 02/10] staging: gasket: core: convert to standard logging

2018-07-26 Thread Todd Poynor
From: Todd Poynor Use standard logging functions, drop use of gasket log functions. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 295 --- 1 file changed, 134 insertions(+), 161 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c b

[PATCH 01/10] staging: gasket: save struct device for a gasket device

2018-07-26 Thread Todd Poynor
From: Todd Poynor Save the struct device pointer to a gasket device in gasket's metadata, to facilitate use of standard logging calls and in anticipation of non-PCI gasket devices in the future. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 5 +++-- drivers/st

[PATCH 00/14] staging: gasket: more assorted cleanups

2018-07-21 Thread Todd Poynor
From: Todd Poynor More fixups arising from the chromium review of the gasket and apex drivers. Todd Poynor (14): staging: gasket: fix check_and_invoke_callback log param staging: gasket: remove duplicate call to retrieve device callback staging: gasket: gasket_handle_ioctl fix ioctl exit

[PATCH 09/14] staging: gasket: core: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 04/14] staging: gasket: avoid copy to user on error in coherent alloc config

2018-07-21 Thread Todd Poynor
From: Todd Poynor gasket_config_coherent_allocator() on error return the error to caller without copying a possibly-update DMA address back to userspace. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 4 +++- 1 file changed, 3 insertions

[PATCH 07/14] staging: gasket: gasket_get_device drop check for NULL pci_dev

2018-07-21 Thread Todd Poynor
From: Todd Poynor The pci_dev field of a struct gasket_dev can never be NULL, there's no need to check for this in gasket_get_device(). Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 dele

[PATCH 03/14] staging: gasket: gasket_handle_ioctl fix ioctl exit trace param

2018-07-21 Thread Todd Poynor
From: Todd Poynor Pass the return value from the device ioctl permissions callback to the tracepoint when the callback returns an error. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 06/14] staging: gasket: remove unnecessary NULL checks on calls from VFS

2018-07-21 Thread Todd Poynor
From: Todd Poynor Remove unneeded checks for NULL pointers in struct file pointers passed from the VFS layer or the private_data that must have been properly set at file open time. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 15

[PATCH 13/14] staging: gasket: page table: remove unnecessary logs

2018-07-21 Thread Todd Poynor
From: Todd Poynor Some error logs in page table handling code could only be hit in cases of programming errors not expected in the current code base, and aren't likely to be useful on their own. Remove these. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c

[PATCH 08/14] staging: gasket: apex return error on sysfs show of missing attribute

2018-07-21 Thread Todd Poynor
From: Todd Poynor Apex sysfs show function return -ENODEV if the attribute is not present, rather than silently failing from the standpoint of the userspace accessor. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 4 ++-- 1 file changed, 2

[PATCH 11/14] staging: gasket: ioctl common: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 14/14] staging: gasket: apex: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 12/14] staging: gasket: page table: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 05/14] staging: gasket: print mmap starting address as unsigned long

2018-07-21 Thread Todd Poynor
From: Todd Poynor Page alignment error log should print the offending value as an unsigned long, not as a kernel pointer. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH 10/14] staging: gasket: interrupts: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 02/14] staging: gasket: remove duplicate call to retrieve device callback

2018-07-21 Thread Todd Poynor
From: Todd Poynor gasket_handle_ioctl() calls gasket_get_ioctl_permissions_cb() twice; simplify the code and avoid duplicated work by fetching the callback pointer only once. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 7 --- 1 file

[PATCH 01/14] staging: gasket: fix check_and_invoke_callback log param

2018-07-21 Thread Todd Poynor
From: Todd Poynor The message should be passed the callback function pointer, not the pointer to the gasket device. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH 00/14] staging: gasket: assorted cleanups

2018-07-21 Thread Todd Poynor
On Sat, Jul 21, 2018 at 6:30 AM Todd Poynor wrote: > > On Sat, Jul 21, 2018 at 6:17 AM Greg Kroah-Hartman > wrote: > > > > On Sat, Jul 21, 2018 at 05:56:39AM -0700, Todd Poynor wrote: > > > From: Todd Poynor > > > > > > Various fixups arising

Re: [PATCH 00/14] staging: gasket: assorted cleanups

2018-07-21 Thread Todd Poynor
On Sat, Jul 21, 2018 at 6:17 AM Greg Kroah-Hartman wrote: > > On Sat, Jul 21, 2018 at 05:56:39AM -0700, Todd Poynor wrote: > > From: Todd Poynor > > > > Various fixups arising from the chromium review of the gasket and apex > > drivers. > > Didn't I jus

[PATCH 02/14] staging: gasket: remove duplicate call to retrieve device callback

2018-07-21 Thread Todd Poynor
From: Todd Poynor gasket_handle_ioctl() calls gasket_get_ioctl_permissions_cb() twice; simplify the code and avoid duplicated work by fetching the callback pointer only once. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 7 --- 1 file

[PATCH 03/20] staging: gasket: remove code for no physical device

2018-07-21 Thread Todd Poynor
From: Todd Poynor gasket_enable_dev code for enabling a gasket device with no physical PCI device registered shouldn't be necessary. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 12 +--- 1 file changed, 1 insertion(+

[PATCH 03/14] staging: gasket: gasket_handle_ioctl fix ioctl exit trace param

2018-07-21 Thread Todd Poynor
From: Todd Poynor Pass the return value from the device ioctl permissions callback to the tracepoint when the callback returns an error. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 02/20] staging: gasket: gasket_enable_dev remove unnecessary variable

2018-07-21 Thread Todd Poynor
From: Todd Poynor Remove unnecessary variable, pass constant param instead. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging

[PATCH 05/20] staging: gasket: remove unnecessary code in coherent allocator

2018-07-21 Thread Todd Poynor
From: Todd Poynor Remove extraneous statement in gasket_config_coherent_allocator() Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers

[PATCH 05/14] staging: gasket: print mmap starting address as unsigned long

2018-07-21 Thread Todd Poynor
From: Todd Poynor Page alignment error log should print the offending value as an unsigned long, not as a kernel pointer. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH 10/20] staging: gasket: remove else clause after return in if clause

2018-07-21 Thread Todd Poynor
From: Todd Poynor Else after return is unnecessary and may cause static code checkers to complain. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH 09/14] staging: gasket: core: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 08/14] staging: gasket: apex return error on sysfs show of missing attribute

2018-07-21 Thread Todd Poynor
From: Todd Poynor Apex sysfs show function return -ENODEV if the attribute is not present, rather than silently failing from the standpoint of the userspace accessor. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 4 ++-- 1 file changed, 2

[PATCH 10/14] staging: gasket: interrupts: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 06/14] staging: gasket: remove unnecessary NULL checks on calls from VFS

2018-07-21 Thread Todd Poynor
From: Todd Poynor Remove unneeded checks for NULL pointers in struct file pointers passed from the VFS layer or the private_data that must have been properly set at file open time. Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 15

[PATCH 08/20] staging: gasket: apex_clock_gating simplify logic, reduce indentation

2018-07-21 Thread Todd Poynor
From: Todd Poynor Collapse together two checks and return immediately, avoid conditional indentation for most of function code. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 43 +--- 1 file

[PATCH 04/20] staging: gasket: fix class create bug handling

2018-07-21 Thread Todd Poynor
From: Todd Poynor class_create() never returns NULL, and this driver should never return PTR_ERR(NULL) anyway. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Reviewed-by: Dmitry Torokhov --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1

[PATCH 07/20] staging: gasket: gasket_mmap return error instead of valid BAR index

2018-07-21 Thread Todd Poynor
From: Todd Poynor 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 Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 07/14] staging: gasket: gasket_get_device drop check for NULL pci_dev

2018-07-21 Thread Todd Poynor
From: Todd Poynor The pci_dev field of a struct gasket_dev can never be NULL, there's no need to check for this in gasket_get_device(). Reported-by: Guenter Roeck Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 dele

[PATCH 14/14] staging: gasket: apex: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 12/20] staging: gasket: remove unnecessary parens in page table code

2018-07-21 Thread Todd Poynor
From: Todd Poynor gasket_alloc_coherent_memory() extra parentheses in statement. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH 11/20] staging: gasket: fix comment syntax in apex.h

2018-07-21 Thread Todd Poynor
From: Todd Poynor Use kernel-style multi-line comment syntax. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gasket/apex.h b/drivers

[PATCH 14/20] staging: gasket: remove extra parens in gasket_write_mappable_regions

2018-07-21 Thread Todd Poynor
From: Todd Poynor Remove unneeded parentheses around subexpressions. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 12/14] staging: gasket: page table: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 13/14] staging: gasket: page table: remove unnecessary logs

2018-07-21 Thread Todd Poynor
From: Todd Poynor Some error logs in page table handling code could only be hit in cases of programming errors not expected in the current code base, and aren't likely to be useful on their own. Remove these. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c

[PATCH 15/20] staging: gasket: fix multi-line comment syntax in gasket_core.h

2018-07-21 Thread Todd Poynor
From: Todd Poynor Use consistent kernel-style multi-line comment syntax. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 20/20] staging: gasket: common ioctls add __user annotations

2018-07-21 Thread Todd Poynor
From: Todd Poynor Add __user annotation to gasket common ioctl pointer arguments for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 102 ++ 1 file changed, 55 insertions

[PATCH 19/20] staging: gasket: common ioctl dispatcher add __user annotations

2018-07-21 Thread Todd Poynor
From: Todd Poynor Add __user annotation to gasket core common ioctl pointer arguments for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 8 +--- drivers/staging/gasket/gasket_ioctl.h | 4

[PATCH 16/20] staging: gasket: always allow root open for write

2018-07-21 Thread Todd Poynor
From: Todd Poynor 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 Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c

[PATCH 06/20] staging: gasket: don't treat no device reset callback as an error

2018-07-21 Thread Todd Poynor
From: Todd Poynor It is not an error for a device to not have a reset callback registered. Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gasket

[PATCH 17/20] staging: gasket: top ioctl handler add __user annotations

2018-07-21 Thread Todd Poynor
From: Todd Poynor Add __user annotation to gasket_core top-level ioctl handling pointer arguments, for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 6 -- drivers/staging/gasket/gasket_core.h

[PATCH 18/20] staging: gasket: apex ioctl add __user annotations

2018-07-21 Thread Todd Poynor
From: Todd Poynor Add __user annotation to ioctl pointer argument, for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff

[PATCH 04/14] staging: gasket: avoid copy to user on error in coherent alloc config

2018-07-21 Thread Todd Poynor
From: Todd Poynor gasket_config_coherent_allocator() on error return the error to caller without copying a possibly-update DMA address back to userspace. Reported-by: Dmitry Torokhov Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 4 +++- 1 file changed, 3 insertions

[PATCH 00/14] staging: gasket: assorted cleanups

2018-07-21 Thread Todd Poynor
From: Todd Poynor Various fixups arising from the chromium review of the gasket and apex drivers. Todd Poynor (14): staging: gasket: fix check_and_invoke_callback log param staging: gasket: remove duplicate call to retrieve device callback staging: gasket: gasket_handle_ioctl fix ioctl

[PATCH 13/20] staging: gasket: gasket_mmap use PAGE_MASK

2018-07-21 Thread Todd Poynor
From: Todd Poynor gasket_mmap use PAGE_MASK, instead of performing math on PAGE_SIZE, for simplicity and clarity. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 11/14] staging: gasket: ioctl common: convert various logs to debug level

2018-07-21 Thread Todd Poynor
From: Todd Poynor Debugging information is improperly logged at non-debug log level in a number of places, and some logs regarding error conditions may be generated too frequently, such that these could cause performance problems and/or obscure other logs. Convert these to debug log level

[PATCH 01/14] staging: gasket: fix check_and_invoke_callback log param

2018-07-21 Thread Todd Poynor
From: Todd Poynor The message should be passed the callback function pointer, not the pointer to the gasket device. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 09/20] staging: gasket: gasket page table functions use bool return type

2018-07-21 Thread Todd Poynor
From: Todd Poynor Convert from int to bool return type for gasket page table functions that return values used as booleans. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 58 +++--- drivers

[PATCH 01/20] staging: gasket: allow compile for ARM64 in Kconfig

2018-07-21 Thread Todd Poynor
From: Todd Poynor The gasket and apex drivers are also to be used on ARM64 architectures. Signed-off-by: Todd Poynor --- drivers/staging/gasket/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/Kconfig b/drivers/staging/gasket/Kconfig index

[PATCH 01/20] staging: gasket: allow compile for ARM64 in Kconfig

2018-07-19 Thread Todd Poynor
From: Todd Poynor The gasket and apex drivers are also to be used on ARM64 architectures. Signed-off-by: Todd Poynor --- drivers/staging/gasket/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/Kconfig b/drivers/staging/gasket/Kconfig index

[PATCH 03/20] staging: gasket: remove code for no physical device

2018-07-19 Thread Todd Poynor
From: Todd Poynor gasket_enable_dev code for enabling a gasket device with no physical PCI device registered shouldn't be necessary. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 12 +--- 1 file changed, 1 insertion(+

[PATCH 09/20] staging: gasket: gasket page table functions use bool return type

2018-07-19 Thread Todd Poynor
From: Todd Poynor Convert from int to bool return type for gasket page table functions that return values used as booleans. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 58 +++--- drivers

[PATCH 08/20] staging: gasket: apex_clock_gating simplify logic, reduce indentation

2018-07-19 Thread Todd Poynor
From: Todd Poynor Collapse together two checks and return immediately, avoid conditional indentation for most of function code. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 43 +--- 1 file

[PATCH 06/20] staging: gasket: don't treat no device reset callback as an error

2018-07-19 Thread Todd Poynor
From: Todd Poynor It is not an error for a device to not have a reset callback registered. Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gasket

[PATCH 05/20] staging: gasket: remove unnecessary code in coherent allocator

2018-07-19 Thread Todd Poynor
From: Todd Poynor Remove extraneous statement in gasket_config_coherent_allocator() Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers

[PATCH 17/20] staging: gasket: top ioctl handler add __user annotations

2018-07-19 Thread Todd Poynor
From: Todd Poynor Add __user annotation to gasket_core top-level ioctl handling pointer arguments, for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 6 -- drivers/staging/gasket/gasket_core.h

[PATCH 15/20] staging: gasket: fix multi-line comment syntax in gasket_core.h

2018-07-19 Thread Todd Poynor
From: Todd Poynor Use consistent kernel-style multi-line comment syntax. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 14/20] staging: gasket: remove extra parens in gasket_write_mappable_regions

2018-07-19 Thread Todd Poynor
From: Todd Poynor Remove unneeded parentheses around subexpressions. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 12/20] staging: gasket: remove unnecessary parens in page table code

2018-07-19 Thread Todd Poynor
From: Todd Poynor gasket_alloc_coherent_memory() extra parentheses in statement. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH 13/20] staging: gasket: gasket_mmap use PAGE_MASK

2018-07-19 Thread Todd Poynor
From: Todd Poynor gasket_mmap use PAGE_MASK, instead of performing math on PAGE_SIZE, for simplicity and clarity. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 16/20] staging: gasket: always allow root open for write

2018-07-19 Thread Todd Poynor
From: Todd Poynor 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 Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c

[PATCH 20/20] staging: gasket: common ioctls add __user annotations

2018-07-19 Thread Todd Poynor
From: Todd Poynor Add __user annotation to gasket common ioctl pointer arguments for sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 102 ++ 1 file changed, 55 insertions

[PATCH 07/20] staging: gasket: gasket_mmap return error instead of valid BAR index

2018-07-19 Thread Todd Poynor
From: Todd Poynor 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 Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

<    1   2   3   4   >