Xin Zeng <xin.zeng@xxxxxxxxx> writes: > This message was sent from outside of Texas Instruments. > Do not click links or open attachments unless you recognize the source of this email and know the content is safe. > > From: Siming Wan <siming.wan@xxxxxxxxx> > > Add logic to save, restore, quiesce and drain a ring bank for QAT GEN4 > devices. > This allows to save and restore the state of a Virtual Function (VF) and > will be used to implement VM live migration. > > Signed-off-by: Siming Wan <siming.wan@xxxxxxxxx> > Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@xxxxxxxxx> > Reviewed-by: Xin Zeng <xin.zeng@xxxxxxxxx> > Signed-off-by: Xin Zeng <xin.zeng@xxxxxxxxx> ... > +#define CHECK_STAT(op, expect_val, name, args...) \ > +({ \ > + u32 __expect_val = (expect_val); \ > + u32 actual_val = op(args); \ > + if (__expect_val != actual_val) \ > + pr_err("QAT: Fail to restore %s register. Expected 0x%x, but actual is 0x%x\n", \ > + name, __expect_val, actual_val); \ > + (__expect_val == actual_val) ? 0 : -EINVAL; \ I was wondering if this can be done like following, saves repeat comparison. (__expect_val == actual_val) ? 0 : (pr_err("QAT: Fail to restore %s \ register. Expected 0x%x, \ but actual is 0x%x\n", \ name, __expect_val, \ actual_val), -EINVAL); \ Regards, Kamlesh > +}) ...