# Re: \[PATCH v3 01/17\] mfd: add new driver for Sharp LoCoMo

- List: linux-fbdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2015/05/8501487/t

## Re: \[PATCH v3 01/17\] mfd: add new driver for Sharp LoCoMo

- From: Russell King - ARM Linux \<hidden\>
- Date: 2015-05-19 11:21:34 
- Message: https://ratatoskr.run/linux-fbdev/2015/05/8501487.md

```text
On Tue, May 19, 2015 at 11:38:28AM +0100, Lee Jones wrote:
> On Sun, 17 May 2015, Dmitry Eremin-Solenikov wrote:
> > +static void locomo_mask_irq(struct irq_data *d)
> > +{
> > +	struct locomo *ldev = irq_data_get_irq_chip_data(d);
> > +	unsigned int mask = 0x0010 << d->hwirq;
> 
> This also needs defining.
> 
> Why not
>   BIT(d->hwirq + 1)

I think your maths is off...

0x0010 << d->hwirq != BIT(d->hwirq + 1)

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
```

## Re: \[PATCH v3 01/17\] mfd: add new driver for Sharp LoCoMo

- From: Lee Jones \<hidden\>
- Date: 2015-05-19 12:33:14 
- Message: https://ratatoskr.run/linux-fbdev/2015/05/8501488.md

```text
On Tue, 19 May 2015, Russell King - ARM Linux wrote:

> On Tue, May 19, 2015 at 11:38:28AM +0100, Lee Jones wrote:
> > On Sun, 17 May 2015, Dmitry Eremin-Solenikov wrote:
> > > +static void locomo_mask_irq(struct irq_data *d)
> > > +{
> > > +	struct locomo *ldev = irq_data_get_irq_chip_data(d);
> > > +	unsigned int mask = 0x0010 << d->hwirq;
> > 
> > This also needs defining.
> > 
> > Why not
> >   BIT(d->hwirq + 1)
> 
> I think your maths is off...
> 
> 0x0010 << d->hwirq != BIT(d->hwirq + 1)

Ah, that's hex.  I was blinded by the 1's and 0's.  Doh!

Thanks Russell.

---

Why not
  BIT(d->hwirq + 4)

... with an explanation as to why you're skipping the first 4 bits?

/me hopes that maths is right now. :)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org â”‚ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
```
