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 ...
|
20a351c3 | 20-Feb-2025 |
Dave Penkler <dpenkler@gmail.com> |
staging: gpib: tnt4882 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 "tnt4882_gpib" in pci_driv
staging: gpib: tnt4882 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 "tnt4882_gpib" in pci_driver struct, request_region and request_irq.
Remove unsupported chipset pr_err's
Remove messages on interrupted or timed out reads and writes.
Remove board not found messages and return -ENODEV
Remove "tnt4882:" prefix in messages as it will be printed by pr_fmt and dev_fmt.
Change pr_err to dev_err where possible.
Remove irq and chipset pr_info's.
Replace error messages with appropriate error returns.
Remove call to mite_list_devices() and the function in mite.c
Remove PCMCIA debug comments, PCMCIA_DEBUG conditional compilation symbol, the DEBUG macro definition and its uses.
Remove pr_info's in mite.c
Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250220090920.32497-3-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 ...
|
b6fe18d0 | 17-Feb-2025 |
Arnd Bergmann <arnd@arndb.de> |
staging: gpib: comment out pnp_device_id tables
This variable is not referenced in either of these two drivers driver, causing a warning when they are built-in and W=1 warnings are enabled with gcc:
staging: gpib: comment out pnp_device_id tables
This variable is not referenced in either of these two drivers driver, causing a warning when they are built-in and W=1 warnings are enabled with gcc:
drivers/staging/gpib/tnt4882/tnt4882_gpib.c:1507:35: error: 'tnt4882_pnp_table' defined but not used [-Werror=unused-const-variable=] 1507 | static const struct pnp_device_id tnt4882_pnp_table[] = { | ^~~~~~~~~~~~~~~~~ drivers/staging/gpib/hp_82341/hp_82341.c:811:35: error: 'hp_82341_pnp_table' defined but not used [-Werror=unused-const-variable=] 811 | static const struct pnp_device_id hp_82341_pnp_table[] = {
The MODULE_DEVICE_TABLE() entry does have the effect of loading the module when the PNP device is detected, so it is still needed for the modular case.
Ideally the drivers should be converted to pnp_register_driver(), which would lead to the ID table actually being used.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20250217131356.3759347-2-arnd@kernel.org 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 ...
|
6f79db02 | 08-Jan-2025 |
Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
staging: gpib: mite: remove unused global functions
The mite.c file was originally copied from the COMEDI code, and now that it is in the kernel tree, along with the comedi code, on some build confi
staging: gpib: mite: remove unused global functions
The mite.c file was originally copied from the COMEDI code, and now that it is in the kernel tree, along with the comedi code, on some build configurations there are errors due to duplicate symbols (specifically mite_dma_disarm).
Remove all of the unused functions in the gpib mite.c and .h files as they aren't needed and cause the compiler to be confused.
Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202501081239.BAPhfAHJ-lkp@intel.com/ Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/2025010809-padding-survive-91b3@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
84b172ce | 07-Jan-2025 |
Lukas Bulwahn <lukas.bulwahn@redhat.com> |
staging: gpib: refer to correct config symbol in tnt4882 Makefile
Commit 79d2e1919a27 ("staging: gpib: fix Makefiles") uses the corresponding config symbols to let Makefiles include the driver sourc
staging: gpib: refer to correct config symbol in tnt4882 Makefile
Commit 79d2e1919a27 ("staging: gpib: fix Makefiles") uses the corresponding config symbols to let Makefiles include the driver sources appropriately in the kernel build.
Unfortunately, the Makefile in the tnt4882 directory refers to the non-existing config GPIB_TNT4882. The actual config name for this driver is GPIB_NI_PCI_ISA, as can be observed in the gpib Makefile.
Probably, this is caused by the subtle differences between the config names, directory names and file names in ./drivers/staging/gpib/, where often config names and directory names are identical or at least close in naming, but in this case, it is not.
Change the reference in the tnt4882 Makefile from the non-existing config GPIB_TNT4882 to the existing config GPIB_NI_PCI_ISA.
Fixes: 79d2e1919a27 ("staging: gpib: fix Makefiles") Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com> Link: https://lore.kernel.org/r/20250107135032.34424-1-lukas.bulwahn@redhat.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 ...
|