mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
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>
This commit is contained in:
parent
ad59cf382c
commit
b8989f45d1
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ enum {
|
|||
BSR = BCR,
|
||||
};
|
||||
|
||||
static const int tnt_pagein_offset = 0x11;
|
||||
enum {
|
||||
tnt_pagein_offset = 0x11,
|
||||
};
|
||||
|
||||
/*============================================================*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -1795,6 +1794,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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user