All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Marc Zyngier <maz@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-team@android.com,
	Florian Fainelli <f.fainelli@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] irqchip: Provide stronger type checking for IRQCHIP_MATCH/IRQCHIP_DECLARE
Date: Thu, 28 Oct 2021 12:01:18 -0700	[thread overview]
Message-ID: <20211028190118.GA739110@roeck-us.net> (raw)
In-Reply-To: <f1d9a7681e7bc83790782ef3e4197a82@kernel.org>

On Thu, Oct 28, 2021 at 07:43:16PM +0100, Marc Zyngier wrote:
> On 2021-10-28 18:28, Guenter Roeck wrote:
> > On Wed, Oct 20, 2021 at 11:45:27AM +0100, Marc Zyngier wrote:
> > > Both IRQCHIP_DECLARE() and IRQCHIP_MATCH() use an underlying
> > > of_device_id()
> > > structure to encode the matching property and the init callback.
> > > However, this callback is stored in as a void * pointer, which
> > > obviously
> > > defeat any attempt at stronger type checking.
> > > 
> > > Work around this by providing a new macro that builds on top of the
> > > __typecheck() primitive, and that can be used to warn when there is
> > > a discrepency between the drivers and core code.
> > > 
> > > Signed-off-by: Marc Zyngier <maz@kernel.org>
> > 
> > This patch results in:
> > 
> > In file included from include/linux/irq.h:589,
> >                  from include/linux/of_irq.h:7,
> >                  from include/linux/irqchip.h:17,
> >                  from arch/h8300/include/asm/irq.h:5,
> >                  from arch/h8300/kernel/traps.c:27:
> > include/linux/irqdesc.h:113:33: error: 'NR_IRQS' undeclared here (not
> > in a function)
> >   113 | extern struct irq_desc irq_desc[NR_IRQS];
> > 
> > and many similar errors when trying to build h8300 images.
> 
> Sigh... Please give this [1] a go.
> 
>         M.
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=irq/misc-5.16&id=0646880e517c06f0e0746665ca1e0e6dd36c406e

Yes, that does the trick.

Tested-by: Guenter Roeck <linux@roeck-us.net>

Thanks,
Guenter

  reply	other threads:[~2021-10-28 19:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 10:45 [PATCH] irqchip: Provide stronger type checking for IRQCHIP_MATCH/IRQCHIP_DECLARE Marc Zyngier
2021-10-20 18:47 ` [irqchip: irq/irqchip-next] " irqchip-bot for Marc Zyngier
2021-10-21 18:06 ` [PATCH] " Florian Fainelli
2021-10-28 17:28 ` Guenter Roeck
2021-10-28 18:43   ` Marc Zyngier
2021-10-28 19:01     ` Guenter Roeck [this message]
2021-10-28 20:15   ` [irqchip: irq/irqchip-next] h8300: Fix linux/irqchip.h include mess irqchip-bot for Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211028190118.GA739110@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=robh@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.