lkml.org 
[lkml]   [2013]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RESEND PATCH v2] mfd: twl6030: Fix endianness problem in IRQ handler
From
On 23 December 2013 19:20, Joe Perches <joe@perches.com> wrote:
> On Mon, 2013-12-23 at 19:11 +0200, Taras Kondratiuk wrote:
>> From: Danke Xie <d.xie@sta.samsung.com>
>>
>> The current TWL 6030 IRQ handler assumes little endianness.
>> This change makes it endian-neutral.
> []
>> diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
> []
>> @@ -196,8 +197,9 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data)
>> if (sts.bytes[2] & 0x10)
>> sts.bytes[2] |= 0x08;
>>
>> - for (i = 0; sts.int_sts; sts.int_sts >>= 1, i++)
>> - if (sts.int_sts & 0x1) {
>> + int_sts = le32_to_cpu(sts.int_sts);
>> + for (i = 0; int_sts; int_sts >>= 1, i++)
>> + if (int_sts & 0x1) {
>> int module_irq =
>> irq_find_mapping(pdata->irq_domain,
>> pdata->irq_mapping_tbl[i]);
>
> instead of the
>
> for (...) {
> if (foo & 1) {
>
>
> maybe using ffs would be better/faster
>
> while ((bit = ffs(int_sts))) {
>
> etc...

Makes sense, but the aim of this patch is to fix endianness issue.
This micro-optimisation can be done as a separate patch.

--
Regards,
Taras Kondratiuk


\
 
 \ /
  Last update: 2013-12-23 19:21    [W:0.058 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site