From: David Daney <ddaney.cavm@gmail.com>
To: Kevin Cernekee <cernekee@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Wu Zhangjin <wuzhangjin@gmail.com>,
linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: Squash pci_fixup_irqs() compiler warning
Date: Mon, 18 Apr 2011 10:27:53 -0700 [thread overview]
Message-ID: <4DAC7499.5000602@gmail.com> (raw)
In-Reply-To: <cb01d61712b1374a8c62bc765094ea7e@localhost>
On 04/17/2011 12:01 PM, Kevin Cernekee wrote:
> MIPS Linux is unique in that it uses a "const struct pci_dev *" argument
> to discourage bad coding practices in pcibios_map_irq(). Add a cast so
> that this warning goes away:
>
> arch/mips/pci/pci.c: In function 'pcibios_init':
> arch/mips/pci/pci.c:165:45: warning: passing argument 2 of 'pci_fixup_irqs' from incompatible pointer type
> include/linux/pci.h:856:6: note: expected 'int (*)(struct pci_dev *, u8, u8)' but argument is of type 'struct pci_dev *'
>
> Signed-off-by: Kevin Cernekee<cernekee@gmail.com>
> ---
>
> Reference:
>
> http://www.mail-archive.com/gnewsense-dev@nongnu.org/msg00706.html
>
> It's been two years since the original discussion, and the warning is
> still there. It is now the only warning left in my kernel build.
>
> I was hoping we could get this resolved for good (one way or another).
>
> arch/mips/pci/pci.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
> index 33bba7b..9a35cd6 100644
> --- a/arch/mips/pci/pci.c
> +++ b/arch/mips/pci/pci.c
> @@ -157,7 +157,8 @@ static int __init pcibios_init(void)
> for (hose = hose_head; hose; hose = hose->next)
> pcibios_scanbus(hose);
>
> - pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);
> + pci_fixup_irqs(pci_common_swizzle,
> + (int (*)(struct pci_dev *, u8, u8))pcibios_map_irq);
>
NAK.
I think Ralf's idea in the e-mail you referenced is the proper approach.
Change pci_fixup_irqs(...) to take a 'const struct pci_dev *' instead.
There is a lot of work going on in the kernel to constify things. This
should be fairly easy to get accepted.
The alternative is to change all the pcibios_map_irq to match what is
expected by pci_fixup_irqs().
David Daney
> pci_initialized = 1;
>
next prev parent reply other threads:[~2011-04-18 17:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-17 19:01 [PATCH] MIPS: Squash pci_fixup_irqs() compiler warning Kevin Cernekee
2011-04-18 17:27 ` David Daney [this message]
2011-05-13 10:17 ` Ralf Baechle
2011-05-19 13:15 ` [PATCH] PCI: Make the struct pci_dev * argument of map_irq const Ralf Baechle
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=4DAC7499.5000602@gmail.com \
--to=ddaney.cavm@gmail.com \
--cc=cernekee@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=wuzhangjin@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox