Re: [PATCH 3/3] gpio: pxa: add PXA1928 gpio type support

From: Linus Walleij
Date: Mon Mar 02 2015 - 09:46:34 EST


On Tue, Feb 3, 2015 at 2:44 PM, Rob Herring <robh@xxxxxxxxxx> wrote:
> On Tue, Feb 3, 2015 at 6:41 AM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>> On Tue, Jan 27, 2015 at 5:46 AM, Rob Herring <robh@xxxxxxxxxx> wrote:
>>
>>> Add support for PXA1928 GPIOs. The PXA1928 adds a 6th bank from previous
>>> generations.
>>>
>>> Signed-off-by: Jing Xiang <jxiang@xxxxxxxxxxx>
>>> Signed-off-by: Xiangzhan Meng <mengxzh@xxxxxxxxxxx>
>>> [robh: ported to 3.19 from vendor kernel]
>>> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
>>> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
>>> Cc: Alexandre Courbot <gnurou@xxxxxxxxx>
>>
>> Patch applied...
>>
>>> -#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
>>> +#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : ((n) > 5 ? 0x200 : 0x100) \
>>> + + (((n) % 3) << 2))
>>
>> While this is a bit convoluted.
>>
>> Someone care to send a patch converting it to something like a
>> parseable static inline?
>
> I should have looked more closely than just taking the vendor code.
> This was needlessly convoluted before and this just added on to it. It
> can be simplified down to this:
>
> #define BANK_OFF(n) (((n) / 3) << 8) + (((n) % 3) << 2)
>
> I'll send a fix unless you want to fix up this patch.

I never saw a fixup patch, so if you have time... please tend to it.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/