ed375186 | 25-Feb-2025 |
Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com> |
staging: gpib: change return type of t1_delay function to report errors
The current code returns "unsigned int" and it doesn't handle errors correctly if it happens during ioctl call for t1 delay co
staging: gpib: change return type of t1_delay function to report errors
The current code returns "unsigned int" and it doesn't handle errors correctly if it happens during ioctl call for t1 delay configuration.
The ni_usb_t1_delay(), from NI, is the only function returning -1 at this point. The caller, t1_delay_ioctl(), doesn't check for errors and sets board->t1_nano_sec to -1 and returns success. The board->t1_nano_sec value is also used in ni_usb_setup_t1_delay() besides the ioctl call and a value of -1 is treated as being above 1100ns. It may or may not have a noticeable effect, but it's obviously not right considering the content of ni_usb_setup_t1_delay().
Typical delays are in the 200-2000 range, but definitely not more than INT_MAX so we can fix this code by changing the return type to int and adding a check for errors. While we're at it, lets change the error code in ni_usb_t1_delay() from -1 and instead propagate the error from ni_usb_write_registers().
Fixes: 4e127de14fa7 ("staging: gpib: Add National Instruments USB GPIB driver") Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com> Link: https://lore.kernel.org/r/20250225014811.77995-1-rodrigo.gobbi.7@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
990f25c6 | 19-Mar-2025 |
Michael Rubin <matchstick@neverthere.org> |
staging: gpib: cb7210: struct gpib_board
Using Linux code style for struct gpib_board.
Adhering to Linux code style.
In general, a pointer, or a struct that has elements that can reasonably be dir
staging: gpib: cb7210: struct gpib_board
Using Linux code style for struct gpib_board.
Adhering to Linux code style.
In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef.
Signed-off-by: Michael Rubin <matchstick@neverthere.org> Acked-By: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250319215924.19387-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
82e35080 | 20-Feb-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: cb7210 console messaging cleanup
Enable module name to be printed in pr_xxx and dev_xxx Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded string "cb7210" everywhere.
Remov
staging: gpib: cb7210 console messaging cleanup
Enable module name to be printed in pr_xxx and dev_xxx Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded string "cb7210" everywhere.
Remove "cb7210:" string prefix in messages since module name printing is enabled.
Change pr_err to dev_err where possible.
Remove interrupt warnings.
Return consistent error codes with error messages: -EBUSY when resources are busy -ENODEV when device is not present -EIO for others.
Return -ENOMEM for failed kmalloc (no message in driver)
Remove PCMCIA debug comments, PCMCIA_DEBUG conditional compilation symbol, the DEBUG macro definition and its uses.
Change pr_warn to dev_warn and pr_err to dev_err where possible.
Remove commented printk.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250220090920.32497-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
99ed5f69 | 14-Feb-2025 |
Gaston Gonzalez <gascoar@gmail.com> |
staging: gpib: cb7210: remove unused variable
Remove unused variable 'nec_priv' in function 'cb7210_line_status'.
This removes the following warning found compiling with W=1:
warning: variable ‘ne
staging: gpib: cb7210: remove unused variable
Remove unused variable 'nec_priv' in function 'cb7210_line_status'.
This removes the following warning found compiling with W=1:
warning: variable ‘nec_priv’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20250214195456.104075-3-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
3c9a0cf6 | 10-Feb-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging:gpib: Remove GPIB_PCMCIA in Makefiles
This symbol is no longer needed since it is being replaced directly by its Kconfig equivalent CONFIG_GPIB_PCMCIA in the drivers providing optional suppo
staging:gpib: Remove GPIB_PCMCIA in Makefiles
This symbol is no longer needed since it is being replaced directly by its Kconfig equivalent CONFIG_GPIB_PCMCIA in the drivers providing optional support for the PCMCIA bus.
Remove the definition of GPIB_PCMCIA from the Makefiles.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250210151022.4358-3-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
c1baf652 | 13-Feb-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Fix cb7210 pcmcia Oops
The pcmcia_driver struct was still only using the old .name initialization in the drv field. This led to a NULL pointer deref Oops in strcmp called from pcmcia
staging: gpib: Fix cb7210 pcmcia Oops
The pcmcia_driver struct was still only using the old .name initialization in the drv field. This led to a NULL pointer deref Oops in strcmp called from pcmcia_register_driver.
Initialize the pcmcia_driver struct name field.
Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202502131453.cb6d2e4a-lkp@intel.com Fixes: e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver") Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250213103112.4415-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
95cfc752 | 11-Jan-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Modernize gpib_interface_t initialization and make static
All interface drivers were using the old style initialization of this struct
field : value;
This generated the followng spa
staging: gpib: Modernize gpib_interface_t initialization and make static
All interface drivers were using the old style initialization of this struct
field : value;
This generated the followng sparse warning, for example: agilent_82357a/agilent_82357a.c:1492:1: warning: obsolete struct initializer, use C99 syntax
Change the initialization to use the C99 syntax
.field = value;
This also resolves the checkpatch constraint of no indentation
These structs were also not declared as static, unnecessarily polluting the symbol namespace and generating the following sparse warnings, for example:
agilent_82357a/agilent_82357a.c:1465:18: warning: symbol 'agilent_82357a_gpib_interface' was not declared. Should it be static?
Declare them as static and remove any conflicting extern declarations in the corresponding include files.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250111160514.26954-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
baf8855c | 13-Dec-2024 |
Arnd Bergmann <arnd@arndb.de> |
staging: gpib: fix address space mixup
Throughout the gpib drivers, a 'void *' struct member is used in place of either port numbers or __iomem pointers, which leads to lots of extra type casts, spa
staging: gpib: fix address space mixup
Throughout the gpib drivers, a 'void *' struct member is used in place of either port numbers or __iomem pointers, which leads to lots of extra type casts, sparse warnings and less portable code.
Split the struct member in two separate ones with the correct types, so each driver can pick which one to use.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/all/f10e976e-7a04-4454-b38d-39cd18f142da@roeck-us.net/ Link: https://lore.kernel.org/r/20241213064959.1045243-3-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|