uru4000: Fix unused value in sm_read_regs()

We don't need to assign urudev if we only want the size of one of its
members.

libfprint/drivers/uru4000.c:554:20: warning: Value stored to 'urudev' during its initialization is never read
        struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
                          ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Bastien Nocera 2018-12-12 16:03:35 +01:00
parent 52208a6606
commit 25d0fa42e2

View file

@ -545,16 +545,17 @@ static void sm_read_reg_cb(struct fp_img_dev *dev, int result,
}
}
#define member_size(type, member) sizeof(((type *)0)->member)
static void
sm_read_regs(fpi_ssm *ssm,
struct fp_img_dev *dev,
uint16_t reg,
uint16_t num_regs)
{
struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev));
int r;
if (num_regs > sizeof(urudev->last_reg_rd)) {
if (num_regs > member_size(struct uru4k_dev, last_reg_rd)) {
fpi_ssm_mark_failed(ssm, -EIO);
return;
}