| ed375186 | 25-Feb-2025 |
Rodrigo Gobbi <[email protected]> |
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 0865b297 | 17-Feb-2025 |
Arnd Bergmann <[email protected]> |
static: gpib: hp82341: add MODULE_DESCRIPTION
One more description turned out to be missing
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/staging/gpib/hp_82341/hp_82341.o
Signed-off-by
static: gpib: hp82341: add MODULE_DESCRIPTION
One more description turned out to be missing
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/staging/gpib/hp_82341/hp_82341.o
Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| b6fe18d0 | 17-Feb-2025 |
Arnd Bergmann <[email protected]> |
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 03ec050c | 24-Jan-2025 |
Dave Penkler <[email protected]> |
staging: gpib: Fix pr_err format warning
This patch fixes the following compile warning:
drivers/staging/gpib/hp_82341/hp_82341.c: In function 'hp_82341_attach': ./include/linux/kern_levels.h:5:25:
staging: gpib: Fix pr_err format warning
This patch fixes the following compile warning:
drivers/staging/gpib/hp_82341/hp_82341.c: In function 'hp_82341_attach': ./include/linux/kern_levels.h:5:25: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'u32' {aka 'unsigned int'} [-Wformat=]
It was introduced in
commit baf8855c9160 ("staging: gpib: fix address space mixup")
but was not detected as the build of the driver depended on BROKEN.
Fixes: baf8855c9160 ("staging: gpib: fix address space mixup") Signed-off-by: Dave Penkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|