Commit Graph

1309500 Commits

Author SHA1 Message Date
Dominik Karol Piątkowski
b8fa1677c3 staging: gpib: Add TODO file
Add a TODO file for the gpib driver.

Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
Link: https://lore.kernel.org/r/20241017190732.82176-1-dominik.karol.piatkowski@protonmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-04 00:50:53 +01:00
Umang Jain
0ef2fbdf7d staging: vchiq_dev: Drop userdata local pointer
The 'userdata' local pointer can be dropped which is set to bulk_waiter.
We can directly pass the waiter->bulk_waiter pointer to
vchiq_bulk_xfer_waiting().

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20241017133629.216672-7-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:04:06 +02:00
Umang Jain
643f2e8a6a staging: vchiq_core: Simplify bulk transfer queue message function
vchiq_bulk_xfer_queue_msg_killable() is a common function between
various bulk transfer code paths (blocking, callback and no-callback).
These code paths were simplified earlier by passing a populated
struct vchiq_bulk pointer in order to avoid open-coding the parameters
required to initiate a bulk transfer.

Now simplify the vchiq_bulk_xfer_queue_msg_killable() in a similar way
i.e. avoid open-coding the function parameters and pass the struct
vchiq_bulk pointer directly, coming from the various bulk transfer code
paths.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20241017133629.216672-6-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:04:06 +02:00
Umang Jain
b7a0b11170 staging: vc04_services: Simplify (no)callback bulk transfer code paths
The (no)callback mode bulk transfer tends to open-code every function
parameter needed to initiate the bulk transfer. Instead of doing that,
simply pass a populated struct vchiq_bulk down the function chain.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20241017133629.216672-5-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:04:06 +02:00
Umang Jain
72406c8a7a staging: vc04_services: Simplify block bulk transfer code paths
Blocking bulk transfer functions tend to open-code every function
parameter needed to initiate the bulk transfer. Instead of doing
that, simply pass a populated struct vchiq_bulk down the function
chain.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20241017133629.216672-4-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:04:06 +02:00
Umang Jain
53cc1e2549 staging: vchiq_core: Simplify bulk data preparatory functions
Two functions create_pagelist() and vchiq_prepare_bulk_data()
open code bulk data arguments ('size' and 'dir') in their function
signatures which can easily be obtained by struct vchiq_bulk pointer.

Retrieve the arguments from vchiq_bulk pointer instead and reduce
the number of arguments passed in create_pagelist() and
vchiq_bulk_prepare_data().

No functional changes intended in this patch.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20241017133629.216672-3-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:04:06 +02:00
Umang Jain
0d2df8b10b staging: vchiq_core: Subsume 'offset' in struct vchiq_bulk
Subsume offset and uoffset inside struct vchiq_bulk instead of
open-coding them in vchiq_prepare_bulk_data() function. It helps in
reducing function parameters and can be easily retrieved from the
struct vchiq_bulk pointer for creating pagelist.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20241017133629.216672-2-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:04:06 +02:00
Everest K.C.
039beaa5ac staging: gpib: Change return type and error code of fmh_gpib_get_dma_residue()
fmh_gpib_get_dma_residue() returns unsigned int with -1 as error code.
This error cannot be caught.
Fix this by changing the return type of the function to int and
returning the error code, that was captured. Also, change the data
type of variable residue to int in the function fmh_gpib_dma_read().

Fixes: 8e4841a088 ("staging: gpib: Add Frank Mori Hess FPGA PCI GPIB driver")
Reported-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
Link: https://lore.kernel.org/r/20241017220740.30370-1-everestkc@everestkc.com.np
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:03:33 +02:00
Dan Carpenter
1f6bfe18d0 staging: gpib: fix uninitialized variable in usb_gpib_command()
The number of bytes written is supposed to be zero at the start of this
function but only one caller, ibcmd(), initializes it to zero.  For the
other three callers, setup_serial_poll(), read_serial_poll_byte() and
cleanup_serial_poll(), it's an uninitialized variable.

Fixes: fce79512a9 ("staging: gpib: Add LPVO DIY USB GPIB driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/a7fed100-ea4d-4dd8-97c6-3fbd2c15f795@stanley.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:02:31 +02:00
Kees Bakker
cbf821e689 staging: gpib: replace dump function by print_hex_dump
It is better to use a standard (proven in use) in-kernel function that does
the same. This also solves two buffer overflow problems.

Signed-off-by: Kees Bakker <kees@ijzerbout.nl>
Link: https://lore.kernel.org/r/20241017191433.2E7BD18DAFE@bout3.ijzerbout.nl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:02:08 +02:00
Dominik Karol Piątkowski
0edaa545af staging: gpib: fmh_gpib: Fix typo
This patch fixes a typo: scenerio -> scenario.

Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
Link: https://lore.kernel.org/r/20241017192056.85570-1-dominik.karol.piatkowski@protonmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:02:06 +02:00
Everest K.C.
14bcf831f0 staging: gpib: Change return type and error code of fluke_get_dma_residue
fluke_get_dma_residue() returns unsigned int with -1 as error code.
This error cannot be caught.
Fix this by changing the return type of the function to int and
returning the error code, that was captured. Also, change the data
type of variable residue to int in the function fluke_dma_read().

Fixes: 55936779f4 ("staging: gpib: Add Fluke cda based cards GPIB driver")
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241017092511.17621-1-everestkc@everestkc.com.np
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 10:00:42 +02:00
Arnd Bergmann
0ed8194ae4 staging: gpib: cb7210: select NEC7210 library
The nec7210 library module is required to build cb7210:

ERROR: modpost: "nec7210_write" [drivers/staging/gpib/cb7210/cb7210.ko] undefined!
ERROR: modpost: "nec7210_read" [drivers/staging/gpib/cb7210/cb7210.ko] undefined!
ERROR: modpost: "nec7210_command" [drivers/staging/gpib/cb7210/cb7210.ko] undefined!
ERROR: modpost: "nec7210_take_control" [drivers/staging/gpib/cb7210/cb7210.ko] undefined!

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-8-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 09:57:04 +02:00
Arnd Bergmann
d76e1402ec staging: gpib: use proper format string in request_module
Using a string variable as a format causes a -Wformat-security
warning. Since the only use of the temporary module_string[] is to hold
the sprintf() output, just pass the format string and argument directly
to request_module().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-7-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 09:57:04 +02:00
Arnd Bergmann
2c9f5d8c6e staging: gpib: add bus specific Kconfig dependencies
A number of GPIB drivers fail to build when CONFIG_HAS_IOPORT is disabled,
which can be avoided with a CONFIG_ISA_BUS or CONFIG_PCMCIA dependency.

For completeness, mark all of the new device drivers with a dependency
on whichever bus they use, and hide the symbols for chip drivers that
are already selected by teh device drivers using them.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-6-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 09:57:03 +02:00
Arnd Bergmann
78ecb03756 staging: gpib: make port I/O code conditional
A few of the helper modules contain functions for both IORESOURCE_MEM
and IORESOURCE_IO type access, with the latter not being supported
on all architectures but also not used by all the drivers.

Add #ifdef checks around these to allow building the library code
and use it on MMIO-only configurations.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-5-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 09:57:03 +02:00
Arnd Bergmann
e282c89bea staging: gpib: pc2: avoid calling undefined dma_free()
On architectures that don't support the ISA DMA API, this causes a build
failure. The corresponding dma_alloc() call is already in an #ifdef,
so use the same one for dma_free().

Note that nothing seems to set PC2_DMA, so parts of this driver
are likely unused. ISA DMA usually does not work on PCI or PCMCIA
devices, only on physical ISA slots.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-4-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 09:57:03 +02:00
Arnd Bergmann
b8989f45d1 staging: gpib: avoid unused const variables
Variables that are 'static const' but not used anywhere cause a warning
with "gcc -Wunused-const-variable", which we may want to enable by default
in the future.

The gpib code already has a mix of 'enum' and 'static const' variables
for named constants, so convert the ones that are causing problems to
enums as well, or move them closer to the only users where possible.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-3-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 09:57:03 +02:00
Arnd Bergmann
ad59cf382c staging: gpib: add module descriptions
Every loadable module should have a description, and not having one
causes a W=1 build warning, so add these to the newly added modules.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-2-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19 09:57:03 +02:00
Rohit Chavan
c47adc2dfc staging: gpib: Replace kmalloc/memset with kzalloc.
This patch replaces kmalloc + memset with kzalloc in the GPIB driver.

Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
Reviewed-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20241016103406.1618448-1-roheetchavan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-17 16:08:38 +02:00
Rohit Chavan
0dee28115b staging: gpib: Remove unneeded semicolon.
This patch cleans up the GPIB driver by removing unneeded semicolons.

Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
Reviewed-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20241016113010.1619275-1-roheetchavan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-17 16:08:03 +02:00
Everest K.C.
fef10146de staging: gpib: Remove unused value
The variable `complement_count` is assigned a value which is again
overwritten in the next statement.
Fix this by removing the first value assigning statement

This issue was reported by Coverity Scan.
Report:
CID 1600790: (#1 of 1): Unused value (UNUSED_VALUE)
assigned_value: Assigning value from length to complement_count here,
but that stored value is overwritten before it can be used.

Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241016075544.4125-1-everestkc@everestkc.com.np
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-16 10:04:49 +02:00
Philipp Hortmann
214c2754fb staging: olpc_dcon: Remove driver marked as broken since 2022
Andres Salomon contributed this driver in 2010.

The following reasons lead to the removal:
- This driver generates maintenance workload
- Kconfig still depends on BROKEN since 2022.

Link: https://lore.kernel.org/all/Yqw4DynMEtAcZVim@kroah.com/
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20241013172759.7524-1-philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-16 10:01:30 +02:00
Rodrigo Gobbi
ea5e911e14 staging: rtl8723bs: remove unused debug statements
Remove both commented printk() and commented DEBUG_ERR()
statements around the driver.

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Link: https://lore.kernel.org/r/20241015014738.41685-3-rodrigo.gobbi.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-16 10:00:27 +02:00
Nathan Chancellor
be11b268e5 staging: gpib: fmh: Drop residue from fmh_gpid_fifo_read_countable()
Clang warns (or errors with CONFIG_WERROR=y):

  drivers/staging/gpib/fmh_gpib/fmh_gpib.c:970:43: error: variable 'residue' is uninitialized when used here [-Werror,-Wuninitialized]
    970 |                                 (int)(*bytes_read), (int)length, (int)residue);
        |                                                                       ^~~~~~~

residue is never initialized in this function and it is not used outside
of an error print. Just remove it altogether, as it is likely not
necessary in this function, as this same exact statement in present in
fmh_gpib_dma_read().

Fixes: 8e4841a088 ("staging: gpib: Add Frank Mori Hess FPGA PCI GPIB driver")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20241015-staging-gpib-fmh-fix-residue-used-uninitialized-v1-1-23ef05b099da@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-16 09:58:56 +02:00