Commit b8989f45 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241016111521.1143191-3-arnd@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ad59cf38
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)
{
+5 −3
Original line number Diff line number Diff line
@@ -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,
};
+3 −3
Original line number Diff line number Diff line
@@ -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
+3 −1
Original line number Diff line number Diff line
@@ -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)
+3 −1
Original line number Diff line number Diff line
@@ -40,7 +40,9 @@ enum {
	BSR = BCR,
};

static const int tnt_pagein_offset = 0x11;
enum {
	tnt_pagein_offset = 0x11,
};

/*============================================================*/

Loading