e8186a37 | 02-May-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Avoid unused variable warning
This addresses a warning produced by make W=1 with the configuration parameter CONFIG_GPIB_PCMCIA=y
ines/ines_gpib.c:1115:28: warning: variable 'dev' se
staging: gpib: Avoid unused variable warning
This addresses a warning produced by make W=1 with the configuration parameter CONFIG_GPIB_PCMCIA=y
ines/ines_gpib.c:1115:28: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
Remove the declaration and assignment of the unused variable.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250502072150.32714-4-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
cfa6673e | 02-May-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Declare driver entry points static
Many of this driver's entry points were unecessarily not declared static.
Remove the declarations from the include file. Make the declarations stat
staging: gpib: Declare driver entry points static
Many of this driver's entry points were unecessarily not declared static.
Remove the declarations from the include file. Make the declarations static in the .c file. Remove an uneccessary forward declaration in the .c file.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250502072150.32714-3-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
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 ...
|
0de51244 | 20-Feb-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: ines 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 "ines_gpib" in pci_request_re
staging: gpib: ines 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 "ines_gpib" in pci_request_regions, request_irq and request_region.
Remove "ines:" and "ines_gpib:" string prefixes in messages since module name printing is enabled.
Change pr_err to dev_err where possible.
Remove interrupt warnings.
Remove PCMCIA debug comments, PCMCIA_DEBUG conditional compilation symbol, the DEBUG macro definition and its uses.
Change pr_debug to dev_dbg.
Remove pr_info
Remove commented printk.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250220090920.32497-2-dpenkler@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 ...
|
3e2bcc16 | 14-Jan-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Use C99 syntax and make static
Some drivers were still using the old syntax for initializing structs: field : value;
This caused sparse to emit the following warning, for example: co
staging: gpib: Use C99 syntax and make static
Some drivers were still using the old syntax for initializing structs: field : value;
This caused sparse to emit the following warning, for example: common/gpib_os.c:2026:1: warning: obsolete struct initializer, use C99 syntax
Use C99 syntax: .field = value;
Some local structs and arrays were not declared static causing sparse to emit the following warning, for example: warning: symbol 'ib_fops' was not declared. Should it be static?
Declare the local structs and arrays as static.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250114165403.16410-5-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
b3beeeee | 14-Jan-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Avoid plain integers as NULL pointers
A number of drivers were comparing request_region() with 0, others were passing 0 instead of NULL as a pointer argument.
This led to the followi
staging: gpib: Avoid plain integers as NULL pointers
A number of drivers were comparing request_region() with 0, others were passing 0 instead of NULL as a pointer argument.
This led to the following sparse warning, for example:
cb7210/cb7210.c:1043:72: warning: Using plain integer as NULL pointer
Use !request_region() to test for NULL return and use NULL instead of 0 as pointer parameter.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250114165403.16410-4-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
77b41a93 | 14-Jan-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: Use __iomem attribute for io addresses
In a number of drivers the PCI memory pointers were declared simply as void *. This caused sparse to emit the following warning, for example:
a
staging: gpib: Use __iomem attribute for io addresses
In a number of drivers the PCI memory pointers were declared simply as void *. This caused sparse to emit the following warning, for example:
agilent_82350b/agilent_82350b.c:44:58: warning: incorrect type in argument 2 (different address spaces) agilent_82350b/agilent_82350b.c:44:58: expected void volatile [noderef] __iomem *addr
Declare the PCI memory pointers as void __iomem *addr.
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250114165403.16410-2-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 ...
|