Skip to contentSkip to conversation

staging: gpib: ines driver fix and cleanup

PATCH New Dave Penkler 1 participant 4 messages May 2, 2025 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: gpib: ines driver fix and cleanup

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(-)

--
Changes V1 => V2
Patch 3 did not remove the initialization of the unused variable. Remove the asignmenst and say so in the commit message.
2.49.0

#1 lore raw

PATCH v2 1/3 staging: gpib: Fix PCMCIA config identifier

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")
---
 drivers/staging/gpib/ines/ines_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gpib/ines/ines_gpib.c +1 -1
index 49947ac30feb..5168811ee850 100644
@@ -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);
Signature · 1 line
2.49.0
#2 lore raw

PATCH v2 2/3 staging: gpib: Declare driver entry points static

In reply to 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.

---
 drivers/staging/gpib/ines/ines.h      | 44 -------------
 drivers/staging/gpib/ines/ines_gpib.c | 92 ++++++++++++++-------------
 2 files changed, 47 insertions(+), 89 deletions(-)
drivers/staging/gpib/ines/ines.h +0 -44
index 07b82f790c4b..f0210ce2470d 100644
@@ -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,
drivers/staging/gpib/ines/ines_gpib.c +47 -45

337 lines not on this page · raw message

Signature · 1 line
2.49.0
#3 lore raw

PATCH v2 3/3 staging: gpib: Avoid unused variable warning

In reply to 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 and assignment of the unused variable.

---
V1 -> V2
Remove the setting of the unused variable and say so in the commit message

 drivers/staging/gpib/ines/ines_gpib.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/gpib/ines/ines_gpib.c +0 -3
index a16219c0f7c8..c851fd014f48 100644
@@ -1112,12 +1112,9 @@ 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;
 
-	dev = link->priv;
-
 	retval = pcmcia_loop_config(link, &ines_gpib_config_iteration, NULL);
 	if (retval) {
 		dev_warn(&link->dev, "no configuration found\n");
Signature · 1 line
2.49.0