Commit 25d0fa42 authored by Bastien Nocera's avatar Bastien Nocera

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));
                          ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parent 52208a66
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment