Remove nested functions from PCI iterators.

* grub-core/bus/pci.c (grub_pci_iterate): Add hook_data argument,
passed to hook.  Update all callers to pass appropriate hook data.
* grub-core/bus/emu/pci.c (grub_pci_iterate): Likewise.
* include/grub/pci.h (grub_pci_iteratefunc_t): Add data argument.
Remove NESTED_FUNC_ATTR from here and from all users.
(grub_pci_iterate): Update prototype.
* grub-core/bus/cs5536.c (grub_cs5536_find: hook): Make static
instead of nested.  Rename to ...
(grub_cs5536_find_iter): ... this.
* grub-core/kern/efi/mm.c (stop_broadcom: find_card): Likewise.
* grub-core/kern/mips/loongson/init.c (init_pci: set_card):
Likewise.
* grub-core/kern/vga_init.c (grub_qemu_init_cirrus: find_card):
Likewise.
* grub-core/video/bochs.c (grub_video_bochs_setup: find_card):
Likewise.
* grub-core/video/cirrus.c (grub_video_cirrus_setup: find_card):
Likewise.
* grub-core/video/efi_uga.c (find_framebuf: find_card): Likewise.
* grub-core/video/radeon_fuloong2e.c
(grub_video_radeon_fuloong2e_setup: find_card): Likewise.
* grub-core/video/sis315pro.c (grub_video_sis315pro_setup:
find_card): Likewise.
* grub-core/video/sm712.c (grub_video_sm712_setup: find_card):
Likewise.
This commit is contained in:
Colin Watson 2013-01-13 01:10:41 +00:00
parent f8e98fee04
commit ca3a74469a
22 changed files with 411 additions and 327 deletions

View file

@ -22,6 +22,7 @@
#include <grub/misc.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/mm.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -126,8 +127,9 @@ static const struct grub_arg_option options[] =
static int iospace;
static int NESTED_FUNC_ATTR
grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
static int
grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
void *data __attribute__ ((unused)))
{
grub_uint32_t class;
const char *sclass;
@ -218,7 +220,7 @@ grub_cmd_lspci (grub_extcmd_context_t ctxt,
char **args __attribute__ ((unused)))
{
iospace = ctxt->state[0].set;
grub_pci_iterate (grub_lspci_iter);
grub_pci_iterate (grub_lspci_iter, NULL);
return GRUB_ERR_NONE;
}