提交 63b2de12 编写于 作者: D Dan Carpenter 提交者: Lee Jones

mfd: stmfx: Fix an endian bug in stmfx_irq_handler()

It's not okay to cast a "u32 *" to "unsigned long *" when you are
doing a for_each_set_bit() loop because that will break on big
endian systems.

Fixes: 386145601b82 ("mfd: stmfx: Uninitialized variable in stmfx_irq_handler()")
Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Tested-by: NAmelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 cd49b84d
......@@ -204,6 +204,7 @@ static struct irq_chip stmfx_irq_chip = {
static irqreturn_t stmfx_irq_handler(int irq, void *data)
{
struct stmfx *stmfx = data;
unsigned long bits;
u32 pending, ack;
int n, ret;
......@@ -222,7 +223,8 @@ static irqreturn_t stmfx_irq_handler(int irq, void *data)
return IRQ_NONE;
}
for_each_set_bit(n, (unsigned long *)&pending, STMFX_REG_IRQ_SRC_MAX)
bits = pending;
for_each_set_bit(n, &bits, STMFX_REG_IRQ_SRC_MAX)
handle_nested_irq(irq_find_mapping(stmfx->irq_domain, n));
return IRQ_HANDLED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册