Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea5c6af9 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

soc: qcom: smp2p: Silence warning in spinlock test



If the RTB logging wrappers aren't present this warning will
appear:

drivers/soc/qcom/smp2p_spinlock_test.c:
In function 'smp2p_ut_remote_spinlock_rpm':
drivers/soc/qcom/smp2p_spinlock_test.c:422:4:
warning: operation on 'data_ptr->apps_lock_count' may be
undefined [-Wsequence-point]

because the writel_relaxed() macro evaluates to a single 'str'
instruction that can't have any side effects (like the
pre-increment of apps_lock_count. Fix it by doing the increment
before the writel_relaxed().

Change-Id: I51ab23b6b30aa2de31bb55e1b6824644ba98fe06
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent a9b38801
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -419,7 +419,8 @@ static void smp2p_ut_remote_spinlock_rpm(struct seq_file *s)
			/* acquire spinlock */
			remote_spin_lock_irqsave(smem_spinlock, flags);
			have_lock = true;
			writel_relaxed(++data_ptr->apps_lock_count,
			data_ptr->apps_lock_count++;
			writel_relaxed(data_ptr->apps_lock_count,
				&data_ptr->apps_lock_count);
			writel_relaxed(RPM_CMD_LOCKED, &data_ptr->apps_cmd);
			/*