Return errors from raw_res_spin_lock{_irqsave}() to writelock(). This is simply to silence the unused result warning. lock_torture_writer() currently does not handle errors returned from writelock(). This aligns with the existing torture test for ww_mutex. Signed-off-by: Amery Hung --- kernel/locking/locktorture.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index ce0362f0a871..2b3686b96907 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -369,8 +369,7 @@ static rqspinlock_t rqspinlock; static int torture_raw_res_spin_write_lock(int tid __maybe_unused) { - raw_res_spin_lock(&rqspinlock); - return 0; + return raw_res_spin_lock(&rqspinlock); } static void torture_raw_res_spin_write_unlock(int tid __maybe_unused) @@ -392,8 +391,12 @@ static struct lock_torture_ops raw_res_spin_lock_ops = { static int torture_raw_res_spin_write_lock_irq(int tid __maybe_unused) { unsigned long flags; + int err; + + err = raw_res_spin_lock_irqsave(&rqspinlock, flags); + if (err) + return err; - raw_res_spin_lock_irqsave(&rqspinlock, flags); cxt.cur_ops->flags = flags; return 0; } -- 2.47.3