staging: gpib: fmh: Drop residue from fmh_gpid_fifo_read_countable()
Clang warns (or errors with CONFIG_WERROR=y):
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:970:43: error: variable 'residue' is uninitialized when used here [-Werror,-Wuninitialized]
970 | (int)(*bytes_read), (int)length, (int)residue);
| ^~~~~~~
residue is never initialized in this function and it is not used outside
of an error print. Just remove it altogether, as it is likely not
necessary in this function, as this same exact statement in present in
fmh_gpib_dma_read().
Fixes: 8e4841a088 ("staging: gpib: Add Frank Mori Hess FPGA PCI GPIB driver")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20241015-staging-gpib-fmh-fix-residue-used-uninitialized-v1-1-23ef05b099da@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
22a3703af1
commit
be11b268e5
@@ -922,7 +922,6 @@ static int fmh_gpib_fifo_read_countable(gpib_board_t *board, uint8_t *buffer,
|
||||
struct fmh_priv *e_priv = board->private_data;
|
||||
struct nec7210_priv *nec_priv = &e_priv->nec7210_priv;
|
||||
int retval = 0;
|
||||
unsigned int residue;
|
||||
|
||||
// printk("%s: enter, bus_address=0x%x, length=%i\n", __FUNCTION__,
|
||||
// (unsigned)bus_address,
|
||||
@@ -966,8 +965,8 @@ cleanup:
|
||||
unsigned int data_value;
|
||||
|
||||
if ((*bytes_read) >= length) {
|
||||
dev_err(board->dev, "unexpected extra bytes in rx fifo, discarding! bytes_read=%d length=%d residue=%d\n",
|
||||
(int)(*bytes_read), (int)length, (int)residue);
|
||||
dev_err(board->dev, "unexpected extra bytes in rx fifo, discarding! bytes_read=%d length=%d\n",
|
||||
(int)(*bytes_read), (int)length);
|
||||
break;
|
||||
}
|
||||
data_value = fifos_read(e_priv, FIFO_DATA_REG);
|
||||
@@ -976,8 +975,8 @@ cleanup:
|
||||
*end = 1;
|
||||
}
|
||||
|
||||
// printk("\tbytes_read=%i, residue=%i, end=%i, retval=%i, wait_retval=%i\n",
|
||||
// *bytes_read, residue, *end, retval, wait_retval);
|
||||
// printk("\tbytes_read=%i, end=%i, retval=%i, wait_retval=%i\n",
|
||||
// *bytes_read, *end, retval, wait_retval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user