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>
* 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)
{
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,
+};
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)
*/
AUXMR, // auxiliary mode
ADR, // address
EOSR, // end-of-string
+
+ // nec7210 has 8 registers
+ nec7210_num_registers = 8,
};
// read registers
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)
BSR = BCR,
};
-static const int tnt_pagein_offset = 0x11;
+enum {
+ tnt_pagein_offset = 0x11,
+};
/*============================================================*/
INES_T6_50us = 0x10,
};
-static const int ines_isa_iosize = 0x20;
-static const int ines_pcmcia_iosize = 0x20;
-
#endif // _INES_GPIB_H
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);
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;
#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
}
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 */
// 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)
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;
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 {
}
/* 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)
{
return 0;
}
-static const int gpib_addr_max = 30; /* max address for primary/secondary gpib addresses */
-
enum ibask_option {
IbaPAD = 0x1,
IbaSAD = 0x2,
T1_DELAY_350ns = 3
};
-static const int request_service_bit = 0x40;
+enum {
+ request_service_bit = 0x40,
+};
enum gpib_events {
EventNone = 0,