* [PATCH 0/7] staging: gpib: randconfig build fixes
@ 2024-10-16 11:15 Arnd Bergmann
2024-10-16 11:15 ` [PATCH 1/7] staging: gpib: add module descriptions Arnd Bergmann
` (7 more replies)
0 siblings, 8 replies; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
The newly added drivers added a few build failures on my randconfig
setup. Some of these only happen with extra warnings enabled, or with
the pending series to allow CONFIG_HAS_IOPORT to be disabled.
Arnd
Arnd Bergmann (7):
staging: gpib: add module descriptions
staging: gpib: avoid unused const variables
staging: gpib: pc2: avoid calling undefined dma_free()
staging: gpib: make port I/O code conditional
staging: gpib: add bus specific Kconfig dependencies
staging: gpib: use proper format string in request_module
staging: gpib: cb7210: select NEC7210 library
drivers/staging/gpib/Kconfig | 18 ++++++++-
.../gpib/agilent_82350b/agilent_82350b.c | 1 +
.../gpib/agilent_82357a/agilent_82357a.c | 1 +
drivers/staging/gpib/cb7210/cb7210.c | 1 +
drivers/staging/gpib/cec/cec_gpib.c | 1 +
drivers/staging/gpib/common/gpib_os.c | 9 +++--
drivers/staging/gpib/eastwood/fluke_gpib.c | 1 +
drivers/staging/gpib/eastwood/fluke_gpib.h | 8 ++--
drivers/staging/gpib/gpio/gpib_bitbang.c | 1 +
drivers/staging/gpib/hp_82335/hp82335.c | 1 +
.../staging/gpib/include/nec7210_registers.h | 6 +--
drivers/staging/gpib/include/tms9914.h | 4 +-
.../staging/gpib/include/tnt4882_registers.h | 4 +-
drivers/staging/gpib/ines/ines.h | 3 --
drivers/staging/gpib/ines/ines_gpib.c | 7 +++-
.../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 1 +
drivers/staging/gpib/nec7210/nec7210.c | 39 ++++++++++---------
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 1 +
drivers/staging/gpib/pc2/pc2_gpib.c | 5 +++
drivers/staging/gpib/tms9914/tms9914.c | 6 +--
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 4 +-
drivers/staging/gpib/uapi/gpib_user.h | 20 +++++-----
22 files changed, 93 insertions(+), 49 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/7] staging: gpib: add module descriptions
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
@ 2024-10-16 11:15 ` Arnd Bergmann
2024-10-16 11:15 ` [PATCH 2/7] staging: gpib: avoid unused const variables Arnd Bergmann
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
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>
---
drivers/staging/gpib/agilent_82350b/agilent_82350b.c | 1 +
drivers/staging/gpib/agilent_82357a/agilent_82357a.c | 1 +
drivers/staging/gpib/cb7210/cb7210.c | 1 +
drivers/staging/gpib/cec/cec_gpib.c | 1 +
drivers/staging/gpib/common/gpib_os.c | 1 +
drivers/staging/gpib/eastwood/fluke_gpib.c | 1 +
drivers/staging/gpib/gpio/gpib_bitbang.c | 1 +
drivers/staging/gpib/hp_82335/hp82335.c | 1 +
drivers/staging/gpib/ines/ines_gpib.c | 1 +
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 1 +
drivers/staging/gpib/nec7210/nec7210.c | 1 +
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 1 +
drivers/staging/gpib/pc2/pc2_gpib.c | 1 +
drivers/staging/gpib/tms9914/tms9914.c | 1 +
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 1 +
15 files changed, 15 insertions(+)
diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
index 1296db4d47c6..3ed5ee91d5f1 100644
--- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
+++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
@@ -18,6 +18,7 @@
#include <linux/wait.h>
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for Agilent 82350b");
int agilent_82350b_accel_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end,
size_t *bytes_read)
diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c
index bbc7e8866872..53ec10729905 100644
--- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c
+++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c
@@ -15,6 +15,7 @@
#include "tms9914.h"
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for Agilent 82357A/B usb adapter");
#define MAX_NUM_82357A_INTERFACES 128
static struct usb_interface *agilent_82357a_driver_interfaces[MAX_NUM_82357A_INTERFACES];
diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c
index 59f6dde3d966..36fdfd97133e 100644
--- a/drivers/staging/gpib/cb7210/cb7210.c
+++ b/drivers/staging/gpib/cb7210/cb7210.c
@@ -21,6 +21,7 @@
#include "quancom_pci.h"
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver Measurement Computing boards using cb7210.2 and cbi488.2");
static inline int have_fifo_word(const struct cb7210_priv *cb_priv)
{
diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec/cec_gpib.c
index 692bf98b37e2..3dc933deb401 100644
--- a/drivers/staging/gpib/cec/cec_gpib.c
+++ b/drivers/staging/gpib/cec/cec_gpib.c
@@ -13,6 +13,7 @@
#include <linux/slab.h>
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for CEC PCI and PCMCIA boards");
/*
* GPIB interrupt service routines
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index d5860a0a131f..01efe99adeb3 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -20,6 +20,7 @@
#include <linux/uaccess.h>
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB base support");
MODULE_ALIAS_CHARDEV_MAJOR(GPIB_CODE);
static int board_type_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board, unsigned long arg);
diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c
index f9f149db222d..651d73e1533a 100644
--- a/drivers/staging/gpib/eastwood/fluke_gpib.c
+++ b/drivers/staging/gpib/eastwood/fluke_gpib.c
@@ -18,6 +18,7 @@
#include <linux/slab.h>
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB Driver for Fluke cda devices");
static int fluke_attach_holdoff_all(gpib_board_t *board, const gpib_board_config_t *config);
static int fluke_attach_holdoff_end(gpib_board_t *board, const gpib_board_config_t *config);
diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c
index 81a952beee0d..ca079070ce97 100644
--- a/drivers/staging/gpib/gpio/gpib_bitbang.c
+++ b/drivers/staging/gpib/gpio/gpib_bitbang.c
@@ -368,6 +368,7 @@ static inline void SET_DIR_READ(struct bb_priv *priv);
#define DIR_WRITE 1
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB helper functions for bitbanging I/O");
/**** global variables ****/
#ifdef CONFIG_GPIB_DEBUG
diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c
index 4e277997684b..a7b1634f96e8 100644
--- a/drivers/staging/gpib/hp_82335/hp82335.c
+++ b/drivers/staging/gpib/hp_82335/hp82335.c
@@ -17,6 +17,7 @@
#include <linux/init.h>
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for HP 82335 interface cards");
static int hp82335_attach(gpib_board_t *board, const gpib_board_config_t *config);
diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c
index 9dbbdb048b9f..1e43fab32eaf 100644
--- a/drivers/staging/gpib/ines/ines_gpib.c
+++ b/drivers/staging/gpib/ines/ines_gpib.c
@@ -19,6 +19,7 @@
#include "gpib_pci_ids.h"
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for Ines iGPIB 72010");
int ines_line_status(const gpib_board_t *board)
{
diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
index aa7af352e709..2a8f127de427 100644
--- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
+++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
@@ -31,6 +31,7 @@
#include "gpibP.h"
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for LPVO usb devices");
#define NAME "lpvo_usb_gpib"
diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/nec7210/nec7210.c
index 5c27185b97b0..632322799ed2 100644
--- a/drivers/staging/gpib/nec7210/nec7210.c
+++ b/drivers/staging/gpib/nec7210/nec7210.c
@@ -19,6 +19,7 @@
#include <linux/delay.h>
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB library code for NEC uPD7210");
int nec7210_enable_eos(gpib_board_t *board, struct nec7210_priv *priv, uint8_t eos_byte,
int compare_8_bits)
diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
index 1da263676f2a..b42a8d5cd05f 100644
--- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
+++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
@@ -14,6 +14,7 @@
#include "tnt4882_registers.h"
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for National Instruments USB devices");
#define MAX_NUM_NI_USB_INTERFACES 128
static struct usb_interface *ni_usb_driver_interfaces[MAX_NUM_NI_USB_INTERFACES];
diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c
index 1a4480e4b668..cd70cedb4899 100644
--- a/drivers/staging/gpib/pc2/pc2_gpib.c
+++ b/drivers/staging/gpib/pc2/pc2_gpib.c
@@ -47,6 +47,7 @@ static inline unsigned int CLEAR_INTR_REG(unsigned int irq)
}
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for PC2/PC2a and compatible devices");
static int pc2_attach(gpib_board_t *board, const gpib_board_config_t *config);
static int pc2a_attach(gpib_board_t *board, const gpib_board_config_t *config);
diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c
index aa2308cf5477..052d5e3acc91 100644
--- a/drivers/staging/gpib/tms9914/tms9914.c
+++ b/drivers/staging/gpib/tms9914/tms9914.c
@@ -22,6 +22,7 @@
#include "tms9914.h"
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB library for tms9914");
static unsigned int update_status_nolock(gpib_board_t *board, struct tms9914_priv *priv);
diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
index ef4b9ce36741..f14d3ce937ba 100644
--- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
+++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
@@ -191,6 +191,7 @@ static inline void tnt_writeb(struct tnt4882_priv *priv, unsigned short value, u
}
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("GPIB driver for National Instruments boards using tnt4882 or compatible chips");
int tnt4882_line_status(const gpib_board_t *board)
{
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/7] staging: gpib: avoid unused const variables
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
2024-10-16 11:15 ` [PATCH 1/7] staging: gpib: add module descriptions Arnd Bergmann
@ 2024-10-16 11:15 ` Arnd Bergmann
2024-10-16 11:15 ` [PATCH 3/7] staging: gpib: pc2: avoid calling undefined dma_free() Arnd Bergmann
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
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>
---
drivers/staging/gpib/common/gpib_os.c | 2 ++
drivers/staging/gpib/eastwood/fluke_gpib.h | 8 +++++---
.../staging/gpib/include/nec7210_registers.h | 6 +++---
drivers/staging/gpib/include/tms9914.h | 4 +++-
.../staging/gpib/include/tnt4882_registers.h | 4 +++-
drivers/staging/gpib/ines/ines.h | 3 ---
drivers/staging/gpib/ines/ines_gpib.c | 6 ++++--
drivers/staging/gpib/tms9914/tms9914.c | 3 ---
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 3 ++-
drivers/staging/gpib/uapi/gpib_user.h | 20 ++++++++++---------
10 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index 01efe99adeb3..e9dd7b2d1569 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -523,6 +523,8 @@ int serial_poll_all(gpib_board_t *board, unsigned int usec_timeout)
* SPD and UNT are sent at the completion of the poll.
*/
+static const int gpib_addr_max = 30; /* max address for primary/secondary gpib addresses */
+
int dvrsp(gpib_board_t *board, unsigned int pad, int sad,
unsigned int usec_timeout, uint8_t *result)
{
diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.h b/drivers/staging/gpib/eastwood/fluke_gpib.h
index d6c5b0124c7e..fcbd42f8f9af 100644
--- a/drivers/staging/gpib/eastwood/fluke_gpib.h
+++ b/drivers/staging/gpib/eastwood/fluke_gpib.h
@@ -136,6 +136,8 @@ enum cb7210_aux_cmds {
AUX_HI_SPEED = 0x41,
};
-static const int fluke_reg_offset = 4;
-static const int fluke_num_regs = 8;
-static const unsigned int write_transfer_counter_mask = 0x7ff;
+enum {
+ fluke_reg_offset = 4,
+ fluke_num_regs = 8,
+ write_transfer_counter_mask = 0x7ff,
+};
diff --git a/drivers/staging/gpib/include/nec7210_registers.h b/drivers/staging/gpib/include/nec7210_registers.h
index 2ad512c372c4..888803dd97f9 100644
--- a/drivers/staging/gpib/include/nec7210_registers.h
+++ b/drivers/staging/gpib/include/nec7210_registers.h
@@ -17,9 +17,6 @@ enum nec7210_chipset {
TNT5004, // NI (minor differences to TNT4882)
};
-// nec7210 has 8 registers
-static const int nec7210_num_registers = 8;
-
/* nec7210 register numbers (might need to be multiplied by
* a board-dependent offset to get actually io address offset)
*/
@@ -33,6 +30,9 @@ enum nec7210_write_regs {
AUXMR, // auxiliary mode
ADR, // address
EOSR, // end-of-string
+
+ // nec7210 has 8 registers
+ nec7210_num_registers = 8,
};
// read registers
diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/include/tms9914.h
index 1cbba02c3581..456b488212d2 100644
--- a/drivers/staging/gpib/include/tms9914.h
+++ b/drivers/staging/gpib/include/tms9914.h
@@ -132,7 +132,9 @@ irqreturn_t tms9914_interrupt_have_status(gpib_board_t *board, struct tms9914_pr
int status1, int status2);
// tms9914 has 8 registers
-static const int tms9914_num_registers = 8;
+enum {
+ ms9914_num_registers = 8,
+};
/* tms9914 register numbers (might need to be multiplied by
* a board-dependent offset to get actually io address offset)
diff --git a/drivers/staging/gpib/include/tnt4882_registers.h b/drivers/staging/gpib/include/tnt4882_registers.h
index f0a719772f41..1b1441cd03d5 100644
--- a/drivers/staging/gpib/include/tnt4882_registers.h
+++ b/drivers/staging/gpib/include/tnt4882_registers.h
@@ -40,7 +40,9 @@ enum {
BSR = BCR,
};
-static const int tnt_pagein_offset = 0x11;
+enum {
+ tnt_pagein_offset = 0x11,
+};
/*============================================================*/
diff --git a/drivers/staging/gpib/ines/ines.h b/drivers/staging/gpib/ines/ines.h
index ae7d042e9f04..7e8302619998 100644
--- a/drivers/staging/gpib/ines/ines.h
+++ b/drivers/staging/gpib/ines/ines.h
@@ -212,7 +212,4 @@ enum ines_auxd_bits {
INES_T6_50us = 0x10,
};
-static const int ines_isa_iosize = 0x20;
-static const int ines_pcmcia_iosize = 0x20;
-
#endif // _INES_GPIB_H
diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c
index 1e43fab32eaf..382c9e579a6d 100644
--- a/drivers/staging/gpib/ines/ines_gpib.c
+++ b/drivers/staging/gpib/ines/ines_gpib.c
@@ -88,8 +88,6 @@ unsigned int ines_t1_delay(gpib_board_t *board, unsigned int nano_sec)
return retval;
}
-static const int in_fifo_size = 0xff;
-
static inline unsigned short num_in_fifo_bytes(struct ines_priv *ines_priv)
{
return ines_inb(ines_priv, IN_FIFO_COUNT);
@@ -885,6 +883,8 @@ int ines_pci_accel_attach(gpib_board_t *board, const gpib_board_config_t *config
return 0;
}
+static const int ines_isa_iosize = 0x20;
+
int ines_isa_attach(gpib_board_t *board, const gpib_board_config_t *config)
{
struct ines_priv *ines_priv;
@@ -995,6 +995,8 @@ static int pc_debug = PCMCIA_DEBUG;
#define DEBUG(args...)
#endif
+static const int ines_pcmcia_iosize = 0x20;
+
/* The event() function is this driver's Card Services event handler.
* It will be called by Card Services when an appropriate card status
* event is received. The config() and release() entry points are
diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c
index 052d5e3acc91..a85a796de024 100644
--- a/drivers/staging/gpib/tms9914/tms9914.c
+++ b/drivers/staging/gpib/tms9914/tms9914.c
@@ -816,9 +816,6 @@ irqreturn_t tms9914_interrupt_have_status(gpib_board_t *board, struct tms9914_pr
}
EXPORT_SYMBOL(tms9914_interrupt_have_status);
-// size of modbus pci memory io region
-static const int iomem_size = 0x2000;
-
void tms9914_board_reset(struct tms9914_priv *priv)
{
/* chip reset */
diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
index f14d3ce937ba..466da4c6f3fc 100644
--- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
+++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
@@ -100,7 +100,6 @@ static const int atgpib_reg_offset = 2;
// number of ioports used
static const int atgpib_iosize = 32;
-static const int pcmcia_gpib_iosize = 32;
/* paged io */
static inline unsigned int tnt_paged_readb(struct tnt4882_priv *priv, unsigned long offset)
@@ -1796,6 +1795,8 @@ void __exit exit_ni_gpib_cs(void)
pcmcia_unregister_driver(&ni_gpib_cs_driver);
}
+static const int pcmcia_gpib_iosize = 32;
+
int ni_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t *config)
{
struct local_info_t *info;
diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h
index 4348bb69c933..0896a55a758f 100644
--- a/drivers/staging/gpib/uapi/gpib_user.h
+++ b/drivers/staging/gpib/uapi/gpib_user.h
@@ -46,12 +46,12 @@ enum ibsta_bits {
SRQI = (1 << SRQI_NUM), /* SRQ is asserted */
END = (1 << END_NUM), /* EOI or EOS encountered */
TIMO = (1 << TIMO_NUM), /* Time limit on I/O or wait function exceeded */
- ERR = (1 << ERR_NUM) /* Function call terminated on error */
-};
+ ERR = (1 << ERR_NUM), /* Function call terminated on error */
-static const int device_status_mask = ERR | TIMO | END | CMPL | RQS;
-static const int board_status_mask = ERR | TIMO | END | CMPL | SPOLL |
- EVENT | LOK | REM | CIC | ATN | TACS | LACS | DTAS | DCAS | SRQI;
+ device_status_mask = ERR | TIMO | END | CMPL | RQS,
+ board_status_mask = ERR | TIMO | END | CMPL | SPOLL |
+ EVENT | LOK | REM | CIC | ATN | TACS | LACS | DTAS | DCAS | SRQI,
+};
/* IBERR error codes */
enum iberr_code {
@@ -209,7 +209,9 @@ static inline uint8_t CFGn(unsigned int meters)
}
/* mask of bits that actually matter in a command byte */
-static const uint8_t gpib_command_mask = 0x7f;
+enum {
+ gpib_command_mask = 0x7f,
+};
static inline int is_PPE(uint8_t command)
{
@@ -261,8 +263,6 @@ static inline int gpib_address_equal(unsigned int pad1, int sad1, unsigned int p
return 0;
}
-static const int gpib_addr_max = 30; /* max address for primary/secondary gpib addresses */
-
enum ibask_option {
IbaPAD = 0x1,
IbaSAD = 0x2,
@@ -341,7 +341,9 @@ enum t1_delays {
T1_DELAY_350ns = 3
};
-static const int request_service_bit = 0x40;
+enum {
+ request_service_bit = 0x40,
+};
enum gpib_events {
EventNone = 0,
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/7] staging: gpib: pc2: avoid calling undefined dma_free()
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
2024-10-16 11:15 ` [PATCH 1/7] staging: gpib: add module descriptions Arnd Bergmann
2024-10-16 11:15 ` [PATCH 2/7] staging: gpib: avoid unused const variables Arnd Bergmann
@ 2024-10-16 11:15 ` Arnd Bergmann
2024-10-16 11:15 ` [PATCH 4/7] staging: gpib: make port I/O code conditional Arnd Bergmann
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
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>
---
drivers/staging/gpib/pc2/pc2_gpib.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c
index cd70cedb4899..7b3b34f47341 100644
--- a/drivers/staging/gpib/pc2/pc2_gpib.c
+++ b/drivers/staging/gpib/pc2/pc2_gpib.c
@@ -462,8 +462,10 @@ void pc2_detach(gpib_board_t *board)
if (pc2_priv) {
nec_priv = &pc2_priv->nec7210_priv;
+#ifdef PC2_DMA
if (nec_priv->dma_channel)
free_dma(nec_priv->dma_channel);
+#endif
gpib_free_pseudo_irq(board);
if (pc2_priv->irq)
free_irq(pc2_priv->irq, board);
@@ -596,8 +598,10 @@ static void pc2a_common_detach(gpib_board_t *board, unsigned int num_registers)
if (pc2_priv) {
nec_priv = &pc2_priv->nec7210_priv;
+#ifdef PC2_DMA
if (nec_priv->dma_channel)
free_dma(nec_priv->dma_channel);
+#endif
gpib_free_pseudo_irq(board);
if (pc2_priv->irq)
free_irq(pc2_priv->irq, board);
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/7] staging: gpib: make port I/O code conditional
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
` (2 preceding siblings ...)
2024-10-16 11:15 ` [PATCH 3/7] staging: gpib: pc2: avoid calling undefined dma_free() Arnd Bergmann
@ 2024-10-16 11:15 ` Arnd Bergmann
2024-11-08 19:29 ` Nathan Chancellor
2024-10-16 11:15 ` [PATCH 5/7] staging: gpib: add bus specific Kconfig dependencies Arnd Bergmann
` (3 subsequent siblings)
7 siblings, 1 reply; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
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>
---
drivers/staging/gpib/common/gpib_os.c | 2 ++
drivers/staging/gpib/nec7210/nec7210.c | 38 ++++++++++++++------------
drivers/staging/gpib/tms9914/tms9914.c | 2 ++
3 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index e9dd7b2d1569..e93a45132a40 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -140,6 +140,7 @@ unsigned int readw_wrapper(void *address)
};
EXPORT_SYMBOL(readw_wrapper);
+#ifdef CONFIG_HAS_IOPORT
void outb_wrapper(unsigned int value, void *address)
{
outb(value, (unsigned long)(address));
@@ -163,6 +164,7 @@ unsigned int inw_wrapper(void *address)
return inw((unsigned long)(address));
};
EXPORT_SYMBOL(inw_wrapper);
+#endif
/* this is a function instead of a constant because of Suse
* defining HZ to be a function call to get_hz()
diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/nec7210/nec7210.c
index 632322799ed2..1330743d05fd 100644
--- a/drivers/staging/gpib/nec7210/nec7210.c
+++ b/drivers/staging/gpib/nec7210/nec7210.c
@@ -1031,6 +1031,7 @@ void nec7210_board_online(struct nec7210_priv *priv, const gpib_board_t *board)
}
EXPORT_SYMBOL(nec7210_board_online);
+#ifdef CONFIG_HAS_IOPORT
/* wrappers for io */
uint8_t nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num)
{
@@ -1050,24 +1051,6 @@ void nec7210_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned
}
EXPORT_SYMBOL(nec7210_ioport_write_byte);
-uint8_t nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num)
-{
- return readb(priv->iobase + register_num * priv->offset);
-}
-EXPORT_SYMBOL(nec7210_iomem_read_byte);
-
-void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num)
-{
- if (register_num == AUXMR)
- /* locking makes absolutely sure noone accesses the
- * AUXMR register faster than once per microsecond
- */
- nec7210_locking_iomem_write_byte(priv, data, register_num);
- else
- writeb(data, priv->iobase + register_num * priv->offset);
-}
-EXPORT_SYMBOL(nec7210_iomem_write_byte);
-
/* locking variants of io wrappers, for chips that page-in registers */
uint8_t nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num)
{
@@ -1093,6 +1076,25 @@ void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, uint8_t data,
spin_unlock_irqrestore(&priv->register_page_lock, flags);
}
EXPORT_SYMBOL(nec7210_locking_ioport_write_byte);
+#endif
+
+uint8_t nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num)
+{
+ return readb(priv->iobase + register_num * priv->offset);
+}
+EXPORT_SYMBOL(nec7210_iomem_read_byte);
+
+void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num)
+{
+ if (register_num == AUXMR)
+ /* locking makes absolutely sure noone accesses the
+ * AUXMR register faster than once per microsecond
+ */
+ nec7210_locking_iomem_write_byte(priv, data, register_num);
+ else
+ writeb(data, priv->iobase + register_num * priv->offset);
+}
+EXPORT_SYMBOL(nec7210_iomem_write_byte);
uint8_t nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num)
{
diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c
index a85a796de024..b4a8ab55c5ec 100644
--- a/drivers/staging/gpib/tms9914/tms9914.c
+++ b/drivers/staging/gpib/tms9914/tms9914.c
@@ -862,6 +862,7 @@ void tms9914_online(gpib_board_t *board, struct tms9914_priv *priv)
}
EXPORT_SYMBOL_GPL(tms9914_online);
+#ifdef CONFIG_HAS_IOPORT
// wrapper for inb
uint8_t tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num)
{
@@ -877,6 +878,7 @@ void tms9914_ioport_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned
udelay(1);
}
EXPORT_SYMBOL_GPL(tms9914_ioport_write_byte);
+#endif
// wrapper for readb
uint8_t tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num)
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/7] staging: gpib: add bus specific Kconfig dependencies
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
` (3 preceding siblings ...)
2024-10-16 11:15 ` [PATCH 4/7] staging: gpib: make port I/O code conditional Arnd Bergmann
@ 2024-10-16 11:15 ` Arnd Bergmann
2024-10-16 11:15 ` [PATCH 6/7] staging: gpib: use proper format string in request_module Arnd Bergmann
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
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>
---
drivers/staging/gpib/Kconfig | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/Kconfig b/drivers/staging/gpib/Kconfig
index f5541624eaa7..8c550f669958 100644
--- a/drivers/staging/gpib/Kconfig
+++ b/drivers/staging/gpib/Kconfig
@@ -34,6 +34,7 @@ config GPIB_COMMON
config GPIB_AGILENT_82350B
tristate "Agilent 8235xx PCI(e) adapters"
+ depends on PCI
select GPIB_COMMON
select GPIB_TMS9914
help
@@ -57,6 +58,8 @@ config GPIB_AGILENT_82357A
config GPIB_CEC_PCI
tristate "CEC PCI board"
+ depends on PCI
+ depends on HAS_IOPORT
select GPIB_COMMON
select GPIB_NEC7210
help
@@ -68,6 +71,7 @@ config GPIB_CEC_PCI
config GPIB_NI_PCI_ISA
tristate "NI PCI/ISA compatible boards"
+ depends on ISA_BUS
select GPIB_COMMON
select GPIB_NEC7210
help
@@ -89,6 +93,8 @@ config GPIB_NI_PCI_ISA
config GPIB_CB7210
tristate "Measurement Computing compatible boards"
+ depends on HAS_IOPORT
+ depends on ISA_BUS || PCI || PCMCIA
select GPIB_COMMON
help
Enable support for Measurement Computing (Computer Boards):
@@ -118,6 +124,7 @@ config GPIB_NI_USB
config GPIB_FLUKE
tristate "Fluke"
+ depends on OF
select GPIB_COMMON
select GPIB_NEC7210
help
@@ -140,6 +147,7 @@ config GPIB_FMH
config GPIB_GPIO
tristate "RPi GPIO bitbang"
+ depends on ARCH_BCM2835 || COMPIlE_TEST
select GPIB_COMMON
help
GPIB bitbang driver Raspberry Pi GPIO adapters
@@ -149,6 +157,7 @@ config GPIB_GPIO
config GPIB_HP82335
tristate "HP82335/HP27209"
+ depends on ISA_BUS
select GPIB_COMMON
select GPIB_TMS9914
help
@@ -172,6 +181,8 @@ config GPIB_HP82341
config GPIB_INES
tristate "INES"
+ depends on PCI || ISA_BUS || PCMCIA
+ depends on HAS_IOPORT
select GPIB_COMMON
select GPIB_NEC7210
help
@@ -210,6 +221,8 @@ config GPIB_LPVO
config GPIB_PC2
tristate "PC2 PC2a"
+ depends on ISA_BUS
+ depends on HAS_IOPORT
select GPIB_COMMON
select GPIB_NEC7210
help
@@ -227,7 +240,7 @@ config GPIB_PC2
config GPIB_TMS9914
- tristate "TMS 9914 GPIB Chip driver"
+ tristate
select GPIB_COMMON
help
Enable support for TMS 9914 chip.
@@ -236,7 +249,7 @@ config GPIB_TMS9914
called tms9914
config GPIB_NEC7210
- tristate "NEC 7210 GPIB Chip driver"
+ tristate
select GPIB_COMMON
help
Enable support for NEC 7210 compatible chips.
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/7] staging: gpib: use proper format string in request_module
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
` (4 preceding siblings ...)
2024-10-16 11:15 ` [PATCH 5/7] staging: gpib: add bus specific Kconfig dependencies Arnd Bergmann
@ 2024-10-16 11:15 ` Arnd Bergmann
2024-10-16 11:15 ` [PATCH 7/7] staging: gpib: cb7210: select NEC7210 library Arnd Bergmann
2024-10-16 12:33 ` [PATCH 0/7] staging: gpib: randconfig build fixes Dave Penkler
7 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
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>
---
drivers/staging/gpib/common/gpib_os.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index e93a45132a40..6b12404efe7d 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -599,11 +599,9 @@ int ibopen(struct inode *inode, struct file *filep)
GPIB_DPRINTK("pid %i, gpib: opening minor %d\n", current->pid, minor);
if (board->use_count == 0) {
- char module_string[32];
int retval;
- snprintf(module_string, sizeof(module_string), "gpib%i", minor);
- retval = request_module(module_string);
+ retval = request_module("gpib%i", minor);
if (retval) {
GPIB_DPRINTK("pid %i, gpib: request module returned %i\n",
current->pid, retval);
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/7] staging: gpib: cb7210: select NEC7210 library
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
` (5 preceding siblings ...)
2024-10-16 11:15 ` [PATCH 6/7] staging: gpib: use proper format string in request_module Arnd Bergmann
@ 2024-10-16 11:15 ` Arnd Bergmann
2024-10-16 12:33 ` [PATCH 0/7] staging: gpib: randconfig build fixes Dave Penkler
7 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2024-10-16 11:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Dave Penkler; +Cc: linux-staging, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
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>
---
drivers/staging/gpib/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/gpib/Kconfig b/drivers/staging/gpib/Kconfig
index 8c550f669958..60743200a0de 100644
--- a/drivers/staging/gpib/Kconfig
+++ b/drivers/staging/gpib/Kconfig
@@ -96,6 +96,7 @@ config GPIB_CB7210
depends on HAS_IOPORT
depends on ISA_BUS || PCI || PCMCIA
select GPIB_COMMON
+ select GPIB_NEC7210
help
Enable support for Measurement Computing (Computer Boards):
CPCI_GPIB, ISA-GPIB, ISA-GPIB/LC, PCI-GPIB/1M, PCI-GPIB/300K and
--
2.39.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/7] staging: gpib: randconfig build fixes
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
` (6 preceding siblings ...)
2024-10-16 11:15 ` [PATCH 7/7] staging: gpib: cb7210: select NEC7210 library Arnd Bergmann
@ 2024-10-16 12:33 ` Dave Penkler
7 siblings, 0 replies; 10+ messages in thread
From: Dave Penkler @ 2024-10-16 12:33 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Greg Kroah-Hartman, linux-staging, Arnd Bergmann
On Wed, Oct 16, 2024 at 11:15:14AM +0000, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly added drivers added a few build failures on my randconfig
> setup. Some of these only happen with extra warnings enabled, or with
> the pending series to allow CONFIG_HAS_IOPORT to be disabled.
>
> Arnd
>
> Arnd Bergmann (7):
> staging: gpib: add module descriptions
> staging: gpib: avoid unused const variables
> staging: gpib: pc2: avoid calling undefined dma_free()
> staging: gpib: make port I/O code conditional
> staging: gpib: add bus specific Kconfig dependencies
> staging: gpib: use proper format string in request_module
> staging: gpib: cb7210: select NEC7210 library
>
> drivers/staging/gpib/Kconfig | 18 ++++++++-
> .../gpib/agilent_82350b/agilent_82350b.c | 1 +
> .../gpib/agilent_82357a/agilent_82357a.c | 1 +
> drivers/staging/gpib/cb7210/cb7210.c | 1 +
> drivers/staging/gpib/cec/cec_gpib.c | 1 +
> drivers/staging/gpib/common/gpib_os.c | 9 +++--
> drivers/staging/gpib/eastwood/fluke_gpib.c | 1 +
> drivers/staging/gpib/eastwood/fluke_gpib.h | 8 ++--
> drivers/staging/gpib/gpio/gpib_bitbang.c | 1 +
> drivers/staging/gpib/hp_82335/hp82335.c | 1 +
> .../staging/gpib/include/nec7210_registers.h | 6 +--
> drivers/staging/gpib/include/tms9914.h | 4 +-
> .../staging/gpib/include/tnt4882_registers.h | 4 +-
> drivers/staging/gpib/ines/ines.h | 3 --
> drivers/staging/gpib/ines/ines_gpib.c | 7 +++-
> .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 1 +
> drivers/staging/gpib/nec7210/nec7210.c | 39 ++++++++++---------
> drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 1 +
> drivers/staging/gpib/pc2/pc2_gpib.c | 5 +++
> drivers/staging/gpib/tms9914/tms9914.c | 6 +--
> drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 4 +-
> drivers/staging/gpib/uapi/gpib_user.h | 20 +++++-----
> 22 files changed, 93 insertions(+), 49 deletions(-)
>
> --
> 2.39.5
>
Hi Arnd,
Thanks for this. I will test the drivers for which I have hardware
and get back to you.
-Dave
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/7] staging: gpib: make port I/O code conditional
2024-10-16 11:15 ` [PATCH 4/7] staging: gpib: make port I/O code conditional Arnd Bergmann
@ 2024-11-08 19:29 ` Nathan Chancellor
0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2024-11-08 19:29 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Greg Kroah-Hartman, Dave Penkler, linux-staging, Arnd Bergmann
Hi Arnd,
On Wed, Oct 16, 2024 at 11:15:18AM +0000, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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>
> ---
> drivers/staging/gpib/common/gpib_os.c | 2 ++
> drivers/staging/gpib/nec7210/nec7210.c | 38 ++++++++++++++------------
> drivers/staging/gpib/tms9914/tms9914.c | 2 ++
> 3 files changed, 24 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
> index e9dd7b2d1569..e93a45132a40 100644
> --- a/drivers/staging/gpib/common/gpib_os.c
> +++ b/drivers/staging/gpib/common/gpib_os.c
> @@ -140,6 +140,7 @@ unsigned int readw_wrapper(void *address)
> };
> EXPORT_SYMBOL(readw_wrapper);
>
> +#ifdef CONFIG_HAS_IOPORT
> void outb_wrapper(unsigned int value, void *address)
> {
> outb(value, (unsigned long)(address));
> @@ -163,6 +164,7 @@ unsigned int inw_wrapper(void *address)
> return inw((unsigned long)(address));
> };
> EXPORT_SYMBOL(inw_wrapper);
> +#endif
>
> /* this is a function instead of a constant because of Suse
> * defining HZ to be a function call to get_hz()
> diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/nec7210/nec7210.c
> index 632322799ed2..1330743d05fd 100644
> --- a/drivers/staging/gpib/nec7210/nec7210.c
> +++ b/drivers/staging/gpib/nec7210/nec7210.c
> @@ -1031,6 +1031,7 @@ void nec7210_board_online(struct nec7210_priv *priv, const gpib_board_t *board)
> }
> EXPORT_SYMBOL(nec7210_board_online);
>
> +#ifdef CONFIG_HAS_IOPORT
> /* wrappers for io */
> uint8_t nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num)
> {
> @@ -1050,24 +1051,6 @@ void nec7210_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned
> }
> EXPORT_SYMBOL(nec7210_ioport_write_byte);
>
> -uint8_t nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num)
> -{
> - return readb(priv->iobase + register_num * priv->offset);
> -}
> -EXPORT_SYMBOL(nec7210_iomem_read_byte);
> -
> -void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num)
> -{
> - if (register_num == AUXMR)
> - /* locking makes absolutely sure noone accesses the
> - * AUXMR register faster than once per microsecond
> - */
> - nec7210_locking_iomem_write_byte(priv, data, register_num);
> - else
> - writeb(data, priv->iobase + register_num * priv->offset);
> -}
> -EXPORT_SYMBOL(nec7210_iomem_write_byte);
> -
> /* locking variants of io wrappers, for chips that page-in registers */
> uint8_t nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num)
> {
> @@ -1093,6 +1076,25 @@ void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, uint8_t data,
> spin_unlock_irqrestore(&priv->register_page_lock, flags);
> }
> EXPORT_SYMBOL(nec7210_locking_ioport_write_byte);
> +#endif
> +
> +uint8_t nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num)
> +{
> + return readb(priv->iobase + register_num * priv->offset);
> +}
> +EXPORT_SYMBOL(nec7210_iomem_read_byte);
> +
> +void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num)
> +{
> + if (register_num == AUXMR)
> + /* locking makes absolutely sure noone accesses the
> + * AUXMR register faster than once per microsecond
> + */
> + nec7210_locking_iomem_write_byte(priv, data, register_num);
> + else
> + writeb(data, priv->iobase + register_num * priv->offset);
> +}
> +EXPORT_SYMBOL(nec7210_iomem_write_byte);
>
> uint8_t nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num)
> {
> diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c
> index a85a796de024..b4a8ab55c5ec 100644
> --- a/drivers/staging/gpib/tms9914/tms9914.c
> +++ b/drivers/staging/gpib/tms9914/tms9914.c
> @@ -862,6 +862,7 @@ void tms9914_online(gpib_board_t *board, struct tms9914_priv *priv)
> }
> EXPORT_SYMBOL_GPL(tms9914_online);
>
> +#ifdef CONFIG_HAS_IOPORT
> // wrapper for inb
> uint8_t tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num)
> {
> @@ -877,6 +878,7 @@ void tms9914_ioport_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned
> udelay(1);
> }
> EXPORT_SYMBOL_GPL(tms9914_ioport_write_byte);
> +#endif
>
> // wrapper for readb
> uint8_t tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num)
> --
> 2.39.5
>
Now that this change is in -next, I think it might be incorrect or
incomplete, as hexagon and s390 allmodconfig error with
ERROR: modpost: "inb_wrapper" [drivers/staging/gpib/tnt4882/tnt4882.ko] undefined!
ERROR: modpost: "inw_wrapper" [drivers/staging/gpib/tnt4882/tnt4882.ko] undefined!
ERROR: modpost: "nec7210_locking_ioport_write_byte" [drivers/staging/gpib/tnt4882/tnt4882.ko] undefined!
ERROR: modpost: "nec7210_locking_ioport_read_byte" [drivers/staging/gpib/tnt4882/tnt4882.ko] undefined!
ERROR: modpost: "outb_wrapper" [drivers/staging/gpib/tnt4882/tnt4882.ko] undefined!
ERROR: modpost: "outw_wrapper" [drivers/staging/gpib/tnt4882/tnt4882.ko] undefined!
and it is not immediately obvious to me what the fix is.
Cheers,
Nathan
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-11-08 19:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16 11:15 [PATCH 0/7] staging: gpib: randconfig build fixes Arnd Bergmann
2024-10-16 11:15 ` [PATCH 1/7] staging: gpib: add module descriptions Arnd Bergmann
2024-10-16 11:15 ` [PATCH 2/7] staging: gpib: avoid unused const variables Arnd Bergmann
2024-10-16 11:15 ` [PATCH 3/7] staging: gpib: pc2: avoid calling undefined dma_free() Arnd Bergmann
2024-10-16 11:15 ` [PATCH 4/7] staging: gpib: make port I/O code conditional Arnd Bergmann
2024-11-08 19:29 ` Nathan Chancellor
2024-10-16 11:15 ` [PATCH 5/7] staging: gpib: add bus specific Kconfig dependencies Arnd Bergmann
2024-10-16 11:15 ` [PATCH 6/7] staging: gpib: use proper format string in request_module Arnd Bergmann
2024-10-16 11:15 ` [PATCH 7/7] staging: gpib: cb7210: select NEC7210 library Arnd Bergmann
2024-10-16 12:33 ` [PATCH 0/7] staging: gpib: randconfig build fixes Dave Penkler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox