If cpu has not allowed unaligned access, this code maybe
has a problem. This patch is prevent above problem.
Change-Id: I4df50f6e7079a32801ba749654f1c8930bc4d142
Signed-off-by: Soohyun Kim <soohyuni.kim@samsung.com>
Signed-off-by: Seokju Yoon <sukju.yoon@samsung.com>
struct dma_pl330_desc *desc;
};
+static inline u32 get_unaligned_le32(u8 *p)
+{
+ return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
+}
+
static inline bool _queue_full(struct pl330_thread *thrd)
{
return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL;
}
writel(val, regs + DBGINST0);
- val = le32_to_cpu(*((__le32 *)&insn[2]));
+ val = get_unaligned_le32(&insn[2]);
writel(val, regs + DBGINST1);
/* If timed out due to halted state-machine */