[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1807040841080.1816@nanos.tec.linutronix.de>
Date: Wed, 4 Jul 2018 08:43:29 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Guo Ren <ren_guo@...ky.com>
cc: linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
daniel.lezcano@...aro.org, jason@...edaemon.net, arnd@...db.de,
c-sky_gcc_upstream@...ky.com, gnu-csky@...tor.com,
thomas.petazzoni@...tlin.com, wbx@...ibc-ng.org, green.hu@...il.com
Subject: Re: [PATCH V2 19/19] irqchip: add C-SKY irqchip drivers
On Wed, 4 Jul 2018, Guo Ren wrote:
> On Tue, Jul 03, 2018 at 11:28:03AM +0200, Thomas Gleixner wrote:
> That's Ok. And here is my implementation:
>
> static inline u32 build_intc_ctrl(u32 idx)
> {
> /*
> * One channel is one byte in a word-width register, so
> * there are four channels in a word-width register.
> *
> * Set the same index for each channel and it will make
> * "irq num = channel num".
> */
> return (idx | ((idx + 1) << 8) |
> ((idx + 2) << 16) | ((idx + 3) << 24));
> }
> Hmm? (No magic number)
Ok :)
> > > + static void __iomem *reg_base;
> > > + irq_hw_number_t hwirq;
> > > +
> > > + reg_base = *this_cpu_ptr(&intcl_reg);
> >
> > Wheee!
> >
> > static void __iomem *reg_base = this_cpu_read(intcl_reg);
> > irq_hw_number_t hwirq;
> >
> > Hmm?
> Thx for the tips and I'll use this_cpu_read() without static.
> void __iomem *reg_base = this_cpu_read(intcl_reg);
Yeah, I surely missed to drop the static ...
> >
> > Aside of that the whole thing might share the code with the other one, but
> > it might not be worth it. At least this wants to be documented in the
> > changelog why sharing the code is not useful...
>
> Do you mean merge irq-csky-v1.c irq-csky-v2.c irq-nationalchip.c into
> one file eg: irq-csky.c?
Yes, but only if there is enough code to share without creating an ifdef
mess. But that looks doable
Thanks,
tglx
Powered by blists - more mailing lists