* [PATCH 0/3] staging: gpib: ines driver fix and cleanup
@ 2025-04-27 9:10 Dave Penkler
2025-04-27 9:10 ` [PATCH 1/3] staging: gpib: Fix PCMCIA config identifier Dave Penkler
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Dave Penkler @ 2025-04-27 9:10 UTC (permalink / raw)
To: gregkh, linux-staging, linux-kernel; +Cc: Dave Penkler
These patches address some outstanding issues with the ines driver.
The issue addressed by patch 1 was exposed after the entry points
were declared static (patch 2).
Patch 1: Fixes an invalid ifdef config identifier
Patch 2: Changes the driver entry points as static
Patch 3: Corrects an unused variable warning
Dave Penkler (3):
staging: gpib: Fix PCMCIA config identifier
staging: gpib: Declare driver entry points static
staging: gpib: Avoid unused variable warning
drivers/staging/gpib/ines/ines.h | 44 -------------
drivers/staging/gpib/ines/ines_gpib.c | 95 ++++++++++++++-------------
2 files changed, 48 insertions(+), 91 deletions(-)
--
2.49.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/3] staging: gpib: Fix PCMCIA config identifier 2025-04-27 9:10 [PATCH 0/3] staging: gpib: ines driver fix and cleanup Dave Penkler @ 2025-04-27 9:10 ` Dave Penkler 2025-04-27 9:10 ` [PATCH 2/3] staging: gpib: Declare driver entry points static Dave Penkler 2025-04-27 9:10 ` [PATCH 3/3] staging: gpib: Avoid unused variable warning Dave Penkler 2 siblings, 0 replies; 6+ messages in thread From: Dave Penkler @ 2025-04-27 9:10 UTC (permalink / raw) To: gregkh, linux-staging, linux-kernel; +Cc: Dave Penkler The PCMCIA config identifier in the ines_exit_module function was never changed because it was misspelled in the original commit. Update the config parameter to use the correct identifier from gpib/Kconfig Fixes: bb1bd92fa0f2 ("staging: gpib: Add ines GPIB driver") Signed-off-by: Dave Penkler <dpenkler@gmail.com> --- drivers/staging/gpib/ines/ines_gpib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index 49947ac30feb..5168811ee850 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -1487,7 +1487,7 @@ static void __exit ines_exit_module(void) gpib_unregister_driver(&ines_pci_unaccel_interface); gpib_unregister_driver(&ines_pci_accel_interface); gpib_unregister_driver(&ines_isa_interface); -#ifdef GPIB__PCMCIA +#ifdef CONFIG_GPIB_PCMCIA gpib_unregister_driver(&ines_pcmcia_interface); gpib_unregister_driver(&ines_pcmcia_unaccel_interface); gpib_unregister_driver(&ines_pcmcia_accel_interface); -- 2.49.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] staging: gpib: Declare driver entry points static 2025-04-27 9:10 [PATCH 0/3] staging: gpib: ines driver fix and cleanup Dave Penkler 2025-04-27 9:10 ` [PATCH 1/3] staging: gpib: Fix PCMCIA config identifier Dave Penkler @ 2025-04-27 9:10 ` Dave Penkler 2025-04-27 9:10 ` [PATCH 3/3] staging: gpib: Avoid unused variable warning Dave Penkler 2 siblings, 0 replies; 6+ messages in thread From: Dave Penkler @ 2025-04-27 9:10 UTC (permalink / raw) To: gregkh, linux-staging, linux-kernel; +Cc: Dave Penkler 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> --- drivers/staging/gpib/ines/ines.h | 44 ------------- drivers/staging/gpib/ines/ines_gpib.c | 92 ++++++++++++++------------- 2 files changed, 47 insertions(+), 89 deletions(-) diff --git a/drivers/staging/gpib/ines/ines.h b/drivers/staging/gpib/ines/ines.h index 07b82f790c4b..f0210ce2470d 100644 --- a/drivers/staging/gpib/ines/ines.h +++ b/drivers/staging/gpib/ines/ines.h @@ -35,45 +35,6 @@ struct ines_priv { u8 extend_mode_bits; }; -// interface functions -int ines_read(struct gpib_board *board, u8 *buffer, size_t length, - int *end, size_t *bytes_read); -int ines_write(struct gpib_board *board, u8 *buffer, size_t length, - int send_eoi, size_t *bytes_written); -int ines_accel_read(struct gpib_board *board, u8 *buffer, size_t length, - int *end, size_t *bytes_read); -int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, - int send_eoi, size_t *bytes_written); -int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written); -int ines_take_control(struct gpib_board *board, int synchronous); -int ines_go_to_standby(struct gpib_board *board); -int ines_request_system_control(struct gpib_board *board, int request_control); -void ines_interface_clear(struct gpib_board *board, int assert); -void ines_remote_enable(struct gpib_board *board, int enable); -int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits); -void ines_disable_eos(struct gpib_board *board); -unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask); -int ines_primary_address(struct gpib_board *board, unsigned int address); -int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable); -int ines_parallel_poll(struct gpib_board *board, u8 *result); -void ines_parallel_poll_configure(struct gpib_board *board, u8 config); -void ines_parallel_poll_response(struct gpib_board *board, int ist); -void ines_serial_poll_response(struct gpib_board *board, u8 status); -u8 ines_serial_poll_status(struct gpib_board *board); -int ines_line_status(const struct gpib_board *board); -int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec); -void ines_return_to_local(struct gpib_board *board); - -// interrupt service routines -irqreturn_t ines_pci_interrupt(int irq, void *arg); -irqreturn_t ines_interrupt(struct gpib_board *board); - -// utility functions -void ines_free_private(struct gpib_board *board); -int ines_generic_attach(struct gpib_board *board); -void ines_online(struct ines_priv *priv, const struct gpib_board *board, int use_accel); -void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count); - /* inb/outb wrappers */ static inline unsigned int ines_inb(struct ines_priv *priv, unsigned int register_number) { @@ -88,11 +49,6 @@ static inline void ines_outb(struct ines_priv *priv, unsigned int value, register_number * priv->nec7210_priv.offset); } -// pcmcia init/cleanup - -int ines_pcmcia_init_module(void); -void ines_pcmcia_cleanup_module(void); - enum ines_regs { // read FIFO_STATUS = 0x8, diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index 5168811ee850..a16219c0f7c8 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -25,7 +25,9 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for Ines iGPIB 72010"); -int ines_line_status(const struct gpib_board *board) +static irqreturn_t ines_interrupt(struct gpib_board *board); + +static int ines_line_status(const struct gpib_board *board) { int status = VALID_ALL; int bcm_bits; @@ -55,7 +57,7 @@ int ines_line_status(const struct gpib_board *board) return status; } -void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) +static void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) { if (count > 0xffff) { pr_err("bug! tried to set xfer counter > 0xffff\n"); @@ -65,7 +67,7 @@ void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) ines_outb(priv, count & 0xff, XFER_COUNT_LOWER); } -int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec) +static int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv = &ines_priv->nec7210_priv; @@ -133,8 +135,8 @@ static ssize_t pio_read(struct gpib_board *board, struct ines_priv *ines_priv, u return retval; } -int ines_accel_read(struct gpib_board *board, u8 *buffer, - size_t length, int *end, size_t *bytes_read) +static int ines_accel_read(struct gpib_board *board, u8 *buffer, + size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; struct ines_priv *ines_priv = board->private_data; @@ -213,8 +215,8 @@ static int ines_write_wait(struct gpib_board *board, struct ines_priv *ines_priv return 0; } -int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, - int send_eoi, size_t *bytes_written) +static int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, + int send_eoi, size_t *bytes_written) { size_t count = 0; ssize_t retval = 0; @@ -264,7 +266,7 @@ int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, return retval; } -irqreturn_t ines_pci_interrupt(int irq, void *arg) +static irqreturn_t ines_pci_interrupt(int irq, void *arg) { struct gpib_board *board = arg; struct ines_priv *priv = board->private_data; @@ -281,7 +283,7 @@ irqreturn_t ines_pci_interrupt(int irq, void *arg) return ines_interrupt(board); } -irqreturn_t ines_interrupt(struct gpib_board *board) +static irqreturn_t ines_interrupt(struct gpib_board *board) { struct ines_priv *priv = board->private_data; struct nec7210_priv *nec_priv = &priv->nec7210_priv; @@ -393,8 +395,8 @@ static struct ines_pci_id pci_ids[] = { static const int num_pci_chips = ARRAY_SIZE(pci_ids); // wrappers for interface functions -int ines_read(struct gpib_board *board, u8 *buffer, size_t length, - int *end, size_t *bytes_read) +static int ines_read(struct gpib_board *board, u8 *buffer, size_t length, + int *end, size_t *bytes_read) { struct ines_priv *priv = board->private_data; struct nec7210_priv *nec_priv = &priv->nec7210_priv; @@ -412,127 +414,127 @@ int ines_read(struct gpib_board *board, u8 *buffer, size_t length, return retval; } -int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, - size_t *bytes_written) +static int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, + size_t *bytes_written) { struct ines_priv *priv = board->private_data; return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) +static int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct ines_priv *priv = board->private_data; return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_written); } -int ines_take_control(struct gpib_board *board, int synchronous) +static int ines_take_control(struct gpib_board *board, int synchronous) { struct ines_priv *priv = board->private_data; return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } -int ines_go_to_standby(struct gpib_board *board) +static int ines_go_to_standby(struct gpib_board *board) { struct ines_priv *priv = board->private_data; return nec7210_go_to_standby(board, &priv->nec7210_priv); } -int ines_request_system_control(struct gpib_board *board, int request_control) +static int ines_request_system_control(struct gpib_board *board, int request_control) { struct ines_priv *priv = board->private_data; return nec7210_request_system_control(board, &priv->nec7210_priv, request_control); } -void ines_interface_clear(struct gpib_board *board, int assert) +static void ines_interface_clear(struct gpib_board *board, int assert) { struct ines_priv *priv = board->private_data; nec7210_interface_clear(board, &priv->nec7210_priv, assert); } -void ines_remote_enable(struct gpib_board *board, int enable) +static void ines_remote_enable(struct gpib_board *board, int enable) { struct ines_priv *priv = board->private_data; nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) +static int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct ines_priv *priv = board->private_data; return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8_bits); } -void ines_disable_eos(struct gpib_board *board) +static void ines_disable_eos(struct gpib_board *board) { struct ines_priv *priv = board->private_data; nec7210_disable_eos(board, &priv->nec7210_priv); } -unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask) +static unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask) { struct ines_priv *priv = board->private_data; return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } -int ines_primary_address(struct gpib_board *board, unsigned int address) +static int ines_primary_address(struct gpib_board *board, unsigned int address) { struct ines_priv *priv = board->private_data; return nec7210_primary_address(board, &priv->nec7210_priv, address); } -int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable) +static int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable) { struct ines_priv *priv = board->private_data; return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -int ines_parallel_poll(struct gpib_board *board, u8 *result) +static int ines_parallel_poll(struct gpib_board *board, u8 *result) { struct ines_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -void ines_parallel_poll_configure(struct gpib_board *board, u8 config) +static void ines_parallel_poll_configure(struct gpib_board *board, u8 config) { struct ines_priv *priv = board->private_data; nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config); } -void ines_parallel_poll_response(struct gpib_board *board, int ist) +static void ines_parallel_poll_response(struct gpib_board *board, int ist) { struct ines_priv *priv = board->private_data; nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -void ines_serial_poll_response(struct gpib_board *board, u8 status) +static void ines_serial_poll_response(struct gpib_board *board, u8 status) { struct ines_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -u8 ines_serial_poll_status(struct gpib_board *board) +static u8 ines_serial_poll_status(struct gpib_board *board) { struct ines_priv *priv = board->private_data; return nec7210_serial_poll_status(board, &priv->nec7210_priv); } -void ines_return_to_local(struct gpib_board *board) +static void ines_return_to_local(struct gpib_board *board) { struct ines_priv *priv = board->private_data; @@ -664,13 +666,13 @@ static int ines_allocate_private(struct gpib_board *board) return 0; } -void ines_free_private(struct gpib_board *board) +static void ines_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data = NULL; } -int ines_generic_attach(struct gpib_board *board) +static int ines_generic_attach(struct gpib_board *board) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -690,7 +692,7 @@ int ines_generic_attach(struct gpib_board *board) return 0; } -void ines_online(struct ines_priv *ines_priv, const struct gpib_board *board, int use_accel) +static void ines_online(struct ines_priv *ines_priv, const struct gpib_board *board, int use_accel) { struct nec7210_priv *nec_priv = &ines_priv->nec7210_priv; @@ -852,7 +854,7 @@ static int ines_common_pci_attach(struct gpib_board *board, const struct gpib_bo return 0; } -int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -867,7 +869,7 @@ int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *co return 0; } -int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -884,7 +886,7 @@ int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_conf static const int ines_isa_iosize = 0x20; -int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -915,7 +917,7 @@ int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *co return 0; } -void ines_pci_detach(struct gpib_board *board) +static void ines_pci_detach(struct gpib_board *board) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv; @@ -949,7 +951,7 @@ void ines_pci_detach(struct gpib_board *board) ines_free_private(board); } -void ines_isa_detach(struct gpib_board *board) +static void ines_isa_detach(struct gpib_board *board) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv; @@ -1005,7 +1007,6 @@ static int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_ static int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_config *config); static void ines_pcmcia_detach(struct gpib_board *board); -static irqreturn_t ines_pcmcia_interrupt(int irq, void *arg); static int ines_common_pcmcia_attach(struct gpib_board *board); /* * A linked list of "instances" of the gpib device. Each actual @@ -1213,7 +1214,7 @@ static struct pcmcia_driver ines_gpib_cs_driver = { .resume = ines_gpib_resume, }; -void ines_pcmcia_cleanup_module(void) +static void ines_pcmcia_cleanup_module(void) { pcmcia_unregister_driver(&ines_gpib_cs_driver); } @@ -1302,14 +1303,14 @@ static struct gpib_interface ines_pcmcia_interface = { .return_to_local = ines_return_to_local, }; -irqreturn_t ines_pcmcia_interrupt(int irq, void *arg) +static irqreturn_t ines_pcmcia_interrupt(int irq, void *arg) { struct gpib_board *board = arg; return ines_interrupt(board); } -int ines_common_pcmcia_attach(struct gpib_board *board) +static int ines_common_pcmcia_attach(struct gpib_board *board) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -1348,7 +1349,7 @@ int ines_common_pcmcia_attach(struct gpib_board *board) return 0; } -int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -1363,7 +1364,8 @@ int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config return 0; } -int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pcmcia_accel_attach(struct gpib_board *board, + const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -1378,7 +1380,7 @@ int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_c return 0; } -void ines_pcmcia_detach(struct gpib_board *board) +static void ines_pcmcia_detach(struct gpib_board *board) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv; -- 2.49.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] staging: gpib: Avoid unused variable warning 2025-04-27 9:10 [PATCH 0/3] staging: gpib: ines driver fix and cleanup Dave Penkler 2025-04-27 9:10 ` [PATCH 1/3] staging: gpib: Fix PCMCIA config identifier Dave Penkler 2025-04-27 9:10 ` [PATCH 2/3] staging: gpib: Declare driver entry points static Dave Penkler @ 2025-04-27 9:10 ` Dave Penkler 2025-04-27 10:32 ` kernel test robot 2025-04-27 10:42 ` kernel test robot 2 siblings, 2 replies; 6+ messages in thread From: Dave Penkler @ 2025-04-27 9:10 UTC (permalink / raw) To: gregkh, linux-staging, linux-kernel; +Cc: Dave Penkler 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 of the unused variable. Signed-off-by: Dave Penkler <dpenkler@gmail.com> --- drivers/staging/gpib/ines/ines_gpib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index a16219c0f7c8..3f79d3c850d5 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -1112,7 +1112,6 @@ static int ines_gpib_config_iteration(struct pcmcia_device *link, void *priv_dat */ static int ines_gpib_config(struct pcmcia_device *link) { - struct local_info *dev; int retval; void __iomem *virt; -- 2.49.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] staging: gpib: Avoid unused variable warning 2025-04-27 9:10 ` [PATCH 3/3] staging: gpib: Avoid unused variable warning Dave Penkler @ 2025-04-27 10:32 ` kernel test robot 2025-04-27 10:42 ` kernel test robot 1 sibling, 0 replies; 6+ messages in thread From: kernel test robot @ 2025-04-27 10:32 UTC (permalink / raw) To: Dave Penkler, gregkh, linux-staging, linux-kernel Cc: llvm, oe-kbuild-all, Dave Penkler Hi Dave, kernel test robot noticed the following build errors: [auto build test ERROR on staging/staging-testing] url: https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Fix-PCMCIA-config-identifier/20250427-171209 base: staging/staging-testing patch link: https://lore.kernel.org/r/20250427091018.13705-4-dpenkler%40gmail.com patch subject: [PATCH 3/3] staging: gpib: Avoid unused variable warning config: arm-randconfig-001-20250427 (https://download.01.org/0day-ci/archive/20250427/202504271837.SgHoiLBt-lkp@intel.com/config) compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250427/202504271837.SgHoiLBt-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202504271837.SgHoiLBt-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/staging/gpib/ines/ines_gpib.c:1118:2: error: use of undeclared identifier 'dev' 1118 | dev = link->priv; | ^ 1 error generated. vim +/dev +1118 drivers/staging/gpib/ines/ines_gpib.c bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1107 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1108 /* bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1109 * gpib_config() is scheduled to run after a CARD_INSERTION event bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1110 * is received, to configure the PCMCIA socket, and to make the bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1111 * device available to the system. bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1112 */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1113 static int ines_gpib_config(struct pcmcia_device *link) bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1114 { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1115 int retval; 77b41a9342f610 Dave Penkler 2025-01-14 1116 void __iomem *virt; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1117 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 @1118 dev = link->priv; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1119 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1120 retval = pcmcia_loop_config(link, &ines_gpib_config_iteration, NULL); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1121 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1122 dev_warn(&link->dev, "no configuration found\n"); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1123 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1124 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1125 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1126 0de51244e7b7e3 Dave Penkler 2025-02-20 1127 dev_dbg(&link->dev, "ines_cs: manufacturer: 0x%x card: 0x%x\n", bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1128 link->manf_id, link->card_id); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1129 2de3fa2c3f4e25 Paul Retourné 2025-04-11 1130 /* 2de3fa2c3f4e25 Paul Retourné 2025-04-11 1131 * for the ines card we have to setup the configuration registers in bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1132 * attribute memory here bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1133 */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1134 link->resource[2]->flags |= WIN_MEMORY_TYPE_AM | WIN_DATA_WIDTH_8 | WIN_ENABLE; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1135 link->resource[2]->end = 0x1000; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1136 retval = pcmcia_request_window(link, link->resource[2], 250); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1137 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1138 dev_warn(&link->dev, "pcmcia_request_window failed\n"); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1139 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1140 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1141 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1142 retval = pcmcia_map_mem_page(link, link->resource[2], 0); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1143 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1144 dev_warn(&link->dev, "pcmcia_map_mem_page failed\n"); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1145 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1146 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1147 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1148 virt = ioremap(link->resource[2]->start, resource_size(link->resource[2])); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1149 writeb((link->resource[2]->start >> 2) & 0xff, virt + 0xf0); // IOWindow base 77b41a9342f610 Dave Penkler 2025-01-14 1150 iounmap(virt); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1151 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1152 /* bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1153 * This actually configures the PCMCIA socket -- setting up bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1154 * the I/O windows and the interrupt mapping. bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1155 */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1156 retval = pcmcia_enable_device(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1157 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1158 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1159 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1160 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1161 return 0; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1162 } /* gpib_config */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1163 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] staging: gpib: Avoid unused variable warning 2025-04-27 9:10 ` [PATCH 3/3] staging: gpib: Avoid unused variable warning Dave Penkler 2025-04-27 10:32 ` kernel test robot @ 2025-04-27 10:42 ` kernel test robot 1 sibling, 0 replies; 6+ messages in thread From: kernel test robot @ 2025-04-27 10:42 UTC (permalink / raw) To: Dave Penkler, gregkh, linux-staging, linux-kernel Cc: oe-kbuild-all, Dave Penkler Hi Dave, kernel test robot noticed the following build errors: [auto build test ERROR on staging/staging-testing] url: https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Fix-PCMCIA-config-identifier/20250427-171209 base: staging/staging-testing patch link: https://lore.kernel.org/r/20250427091018.13705-4-dpenkler%40gmail.com patch subject: [PATCH 3/3] staging: gpib: Avoid unused variable warning config: x86_64-buildonly-randconfig-002-20250427 (https://download.01.org/0day-ci/archive/20250427/202504271805.WmPdV7YW-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250427/202504271805.WmPdV7YW-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202504271805.WmPdV7YW-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/staging/gpib/ines/ines_gpib.c: In function 'ines_gpib_config': >> drivers/staging/gpib/ines/ines_gpib.c:1118:9: error: 'dev' undeclared (first use in this function); did you mean 'cdev'? 1118 | dev = link->priv; | ^~~ | cdev drivers/staging/gpib/ines/ines_gpib.c:1118:9: note: each undeclared identifier is reported only once for each function it appears in vim +1118 drivers/staging/gpib/ines/ines_gpib.c bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1107 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1108 /* bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1109 * gpib_config() is scheduled to run after a CARD_INSERTION event bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1110 * is received, to configure the PCMCIA socket, and to make the bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1111 * device available to the system. bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1112 */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1113 static int ines_gpib_config(struct pcmcia_device *link) bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1114 { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1115 int retval; 77b41a9342f610 Dave Penkler 2025-01-14 1116 void __iomem *virt; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1117 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 @1118 dev = link->priv; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1119 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1120 retval = pcmcia_loop_config(link, &ines_gpib_config_iteration, NULL); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1121 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1122 dev_warn(&link->dev, "no configuration found\n"); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1123 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1124 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1125 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1126 0de51244e7b7e3 Dave Penkler 2025-02-20 1127 dev_dbg(&link->dev, "ines_cs: manufacturer: 0x%x card: 0x%x\n", bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1128 link->manf_id, link->card_id); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1129 2de3fa2c3f4e25 Paul Retourné 2025-04-11 1130 /* 2de3fa2c3f4e25 Paul Retourné 2025-04-11 1131 * for the ines card we have to setup the configuration registers in bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1132 * attribute memory here bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1133 */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1134 link->resource[2]->flags |= WIN_MEMORY_TYPE_AM | WIN_DATA_WIDTH_8 | WIN_ENABLE; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1135 link->resource[2]->end = 0x1000; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1136 retval = pcmcia_request_window(link, link->resource[2], 250); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1137 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1138 dev_warn(&link->dev, "pcmcia_request_window failed\n"); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1139 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1140 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1141 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1142 retval = pcmcia_map_mem_page(link, link->resource[2], 0); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1143 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1144 dev_warn(&link->dev, "pcmcia_map_mem_page failed\n"); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1145 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1146 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1147 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1148 virt = ioremap(link->resource[2]->start, resource_size(link->resource[2])); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1149 writeb((link->resource[2]->start >> 2) & 0xff, virt + 0xf0); // IOWindow base 77b41a9342f610 Dave Penkler 2025-01-14 1150 iounmap(virt); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1151 bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1152 /* bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1153 * This actually configures the PCMCIA socket -- setting up bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1154 * the I/O windows and the interrupt mapping. bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1155 */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1156 retval = pcmcia_enable_device(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1157 if (retval) { bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1158 ines_gpib_release(link); bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1159 return -ENODEV; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1160 } bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1161 return 0; bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1162 } /* gpib_config */ bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1163 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-04-27 10:43 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-04-27 9:10 [PATCH 0/3] staging: gpib: ines driver fix and cleanup Dave Penkler 2025-04-27 9:10 ` [PATCH 1/3] staging: gpib: Fix PCMCIA config identifier Dave Penkler 2025-04-27 9:10 ` [PATCH 2/3] staging: gpib: Declare driver entry points static Dave Penkler 2025-04-27 9:10 ` [PATCH 3/3] staging: gpib: Avoid unused variable warning Dave Penkler 2025-04-27 10:32 ` kernel test robot 2025-04-27 10:42 ` kernel test robot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox