compiling cmipci in 2.5.10 on Alpha doesn't work
I tried to compile 2.5.10 on my Alpha, but the cmipci module won't compile:
cmipci.c:2399: elements of array `snd_cmipci_ids' have incomplete type cmipci.c:2400: warning: excess elements in struct initializer
cmipci.c:2400: warning: (near initialization for `snd_cmipci_ids[0]') cmipci.c:2400: warning: excess elements in struct initializer
cmipci.c:2400: warning: (near initialization for snd_cmipci_ids[0]') cmipci.c:2400: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2400: warning: excess elements in struct initializer
cmipci.c:2400: warning: (near initialization for snd_cmipci_ids[0]') cmipci.c:2400: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2400: warning: excess elements in struct initializer
cmipci.c:2400: warning: (near initialization for `snd_cmipci_ids[0]') cmipci.c:2400: warning: excess elements in struct initializer
cmipci.c:2400: warning: (near initialization for `snd_cmipci_ids[0]') cmipci.c:2400: warning: excess elements in struct initializer
cmipci.c:2400: warning: (near initialization for `snd_cmipci_ids[0]') cmipci.c:2400: warning: excess elements in struct initializer
cmipci.c:2400: warning: (near initialization for `snd_cmipci_ids[0]') cmipci.c:2401: warning: excess elements in struct initializer
cmipci.c:2401: warning: (near initialization for `snd_cmipci_ids[1]') cmipci.c:2401: warning: excess elements in struct initializer
cmipci.c:2401: warning: (near initialization for snd_cmipci_ids[1]') cmipci.c:2401: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2401: warning: excess elements in struct initializer
cmipci.c:2401: warning: (near initialization for snd_cmipci_ids[1]') cmipci.c:2401: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2401: warning: excess elements in struct initializer
cmipci.c:2401: warning: (near initialization for `snd_cmipci_ids[1]') cmipci.c:2401: warning: excess elements in struct initializer
cmipci.c:2401: warning: (near initialization for `snd_cmipci_ids[1]') cmipci.c:2401: warning: excess elements in struct initializer
cmipci.c:2401: warning: (near initialization for `snd_cmipci_ids[1]') cmipci.c:2401: warning: excess elements in struct initializer
cmipci.c:2401: warning: (near initialization for `snd_cmipci_ids[1]') cmipci.c:2402: warning: excess elements in struct initializer
cmipci.c:2402: warning: (near initialization for `snd_cmipci_ids[2]') cmipci.c:2402: warning: excess elements in struct initializer
cmipci.c:2402: warning: (near initialization for snd_cmipci_ids[2]') cmipci.c:2402: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2402: warning: excess elements in struct initializer
cmipci.c:2402: warning: (near initialization for snd_cmipci_ids[2]') cmipci.c:2402: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2402: warning: excess elements in struct initializer
cmipci.c:2402: warning: (near initialization for `snd_cmipci_ids[2]') cmipci.c:2402: warning: excess elements in struct initializer
cmipci.c:2402: warning: (near initialization for `snd_cmipci_ids[2]') cmipci.c:2402: warning: excess elements in struct initializer
cmipci.c:2402: warning: (near initialization for `snd_cmipci_ids[2]') cmipci.c:2402: warning: excess elements in struct initializer
cmipci.c:2402: warning: (near initialization for `snd_cmipci_ids[2]') cmipci.c:2403: warning: excess elements in struct initializer
cmipci.c:2403: warning: (near initialization for `snd_cmipci_ids[3]') cmipci.c:2403: warning: excess elements in struct initializer
cmipci.c:2403: warning: (near initialization for snd_cmipci_ids[3]') cmipci.c:2403: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2403: warning: excess elements in struct initializer
cmipci.c:2403: warning: (near initialization for snd_cmipci_ids[3]') cmipci.c:2403: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2403: warning: excess elements in struct initializer
cmipci.c:2403: warning: (near initialization for `snd_cmipci_ids[3]') cmipci.c:2403: warning: excess elements in struct initializer
cmipci.c:2403: warning: (near initialization for `snd_cmipci_ids[3]') cmipci.c:2403: warning: excess elements in struct initializer
cmipci.c:2403: warning: (near initialization for `snd_cmipci_ids[3]') cmipci.c:2403: warning: excess elements in struct initializer
cmipci.c:2403: warning: (near initialization for snd_cmipci_ids[3]') cmipci.c:2404: PCI_VENDOR_ID_AL' undeclared here (not in a function) cmipci.c:2404: warning: excess elements in struct initializer
cmipci.c:2404: warning: (near initialization for `snd_cmipci_ids[4]') cmipci.c:2404: warning: excess elements in struct initializer
cmipci.c:2404: warning: (near initialization for snd_cmipci_ids[4]') cmipci.c:2404: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2404: warning: excess elements in struct initializer
cmipci.c:2404: warning: (near initialization for snd_cmipci_ids[4]') cmipci.c:2404: PCI_ANY_ID' undeclared here (not in a function)
cmipci.c:2404: warning: excess elements in struct initializer
cmipci.c:2404: warning: (near initialization for `snd_cmipci_ids[4]') cmipci.c:2404: warning: excess elements in struct initializer
cmipci.c:2404: warning: (near initialization for `snd_cmipci_ids[4]') cmipci.c:2404: warning: excess elements in struct initializer
cmipci.c:2404: warning: (near initialization for `snd_cmipci_ids[4]') cmipci.c:2404: warning: excess elements in struct initializer
cmipci.c:2404: warning: (near initialization for `snd_cmipci_ids[4]') cmipci.c:2405: warning: excess elements in struct initializer
cmipci.c:2405: warning: (near initialization for snd_cmipci_ids[5]') cmipci.c:2406: invalid use of undefined type struct pci_device_id'cmipci.c: In function `snd_cmipci_free':
cmipci.c:2479: warning: implicit declaration of function release_resource' cmipci.c: In function snd_cmipci_create':
cmipci.c:2508: warning: implicit declaration of function `pci_enable_device' cmipci.c:2517: dereferencing pointer to incomplete type
cmipci.c:2521: warning: implicit declaration of function pci_resource_start' cmipci.c:2526: warning: implicit declaration of function request_region' cmipci.c:2526: warning: assignment makes pointer from integer without a cast cmipci.c:2531: dereferencing pointer to incomplete type
cmipci.c:2532: dereferencing pointer to incomplete type
cmipci.c:2536: dereferencing pointer to incomplete type
cmipci.c:2538: warning: implicit declaration of function `pci_set_master' cmipci.c: At top level:
cmipci.c:2668: sizeof applied to an incomplete typecmipci.c: In function `snd_cmipci_probe':
cmipci.c:2689: dereferencing pointer to incomplete type
cmipci.c:2692: warning: unreachable code at beginning of switch statement cmipci.c:2724: warning: implicit declaration of function pci_set_drvdata' cmipci.c: In function snd_cmipci_remove':
cmipci.c:2732: warning: implicit declaration of function pci_get_drvdata' cmipci.c:2732: warning: passing arg 1 of snd_card_free' makes pointer from integer without a cast cmipci.c: At top level:
cmipci.c:2737: variable driver' has initializer but incomplete type cmipci.c:2738: unknown field name' specified in initializer
cmipci.c:2738: warning: excess elements in struct initializer
cmipci.c:2738: warning: (near initialization for `driver')
cmipci.c:2739: unknown field `id_table' specified in initializer
cmipci.c:2739: warning: excess elements in struct initializer
cmipci.c:2739: warning: (near initialization for `driver')
cmipci.c:2740: unknown field `probe' specified in initializer
cmipci.c:2740: warning: excess elements in struct initializer
cmipci.c:2740: warning: (near initialization for `driver')
cmipci.c:2741: unknown field `remove' specified in initializer
cmipci.c:2741: warning: excess elements in struct initializer
cmipci.c:2741: warning: (near initialization for `driver')cmipci.c: In function `alsa_card_cmipci_init':
cmipci.c:2748: warning: implicit declaration of function pci_module_init' cmipci.c: In function alsa_card_cmipci_exit':
cmipci.c:2759: warning: implicit declaration of function `pci_unregister_driver' cmipci.c: At top level:
cmipci.c:2731: warning: `snd_cmipci_remove' defined but not used
make[2]: *** [cmipci.o] Error 1
make[1]: *** [_modsubdir_pci] Error 2
make: *** [_mod_sound] Error 2
This is debian/Alpha (testing), on a Miata-type Alpha workstation.
.config:
CONFIG_ALPHA=yCONFIG_RWSEM_XCHGADD_ALGORITHM=yCONFIG_EXPERIMENTAL=yCONFIG_NET=yCONFIG_SYSVIPC=yCONFIG_SYSCTL=yCONFIG_MODULES=yCONFIG_KMOD=yCONFIG_ALPHA_MIATA=yCONFIG_ISA=yCONFIG_EISA=yCONFIG_PCI=yCONFIG_ALPHA_EV5=yCONFIG_ALPHA_EV56=yCONFIG_ALPHA_CIA=yCONFIG_ALPHA_PYXIS=yCONFIG_PCI_NAMES=yCONFIG_KCORE_ELF=yCONFIG_BINFMT_ELF=yCONFIG_BINFMT_EM86=yCONFIG_PARPORT=mCONFIG_BLK_DEV_FD=yCONFIG_BLK_DEV_LOOP=mCONFIG_PACKET=yCONFIG_NETLINK_DEV=yCONFIG_NETFILTER=yCONFIG_UNIX=yCONFIG_INET=yCONFIG_IP_MULTICAST=yCONFIG_IP_ADVANCED_ROUTER=yCONFIG_IP_ROUTE_VERBOSE=yCONFIG_INET_ECN=yCONFIG_SYN_COOKIES=yCONFIG_IP_NF_CONNTRACK=mCONFIG_IP_NF_FTP=mCONFIG_IP_NF_IRC=mCONFIG_IP_NF_QUEUE=mCONFIG_IP_NF_IPTABLES=mCONFIG_IP_NF_FILTER=mCONFIG_IP_NF_NAT=mCONFIG_IP_NF_NAT_NEEDED=yCONFIG_IP_NF_TARGET_MASQUERADE=mCONFIG_IP_NF_NAT_IRC=mCONFIG_IP_NF_NAT_FTP=mCONFIG_IP_NF_COMPAT_IPCHAINS=yCONFIG_IP_NF_NAT_NEEDED=yCONFIG_VLAN_8021Q=mCONFIG_IDE=yCONFIG_BLK_DEV_IDE=yCONFIG_BLK_DEV_IDEDISK=yCONFIG_IDEDISK_MULTI_MODE=yCONFIG_BLK_DEV_IDECD=yCONFIG_BLK_DEV_CMD640=yCONFIG_BLK_DEV_CMD640_ENHANCED=yCONFIG_BLK_DEV_IDEPCI=yCONFIG_BLK_DEV_IDEDMA_PCI=yCONFIG_IDEDMA_PCI_AUTO=yCONFIG_BLK_DEV_IDEDMA=yCONFIG_BLK_DEV_ALI15X3=yCONFIG_BLK_DEV_CMD64X=yCONFIG_BLK_DEV_PDC202XX=yCONFIG_PDC202XX_BURST=yCONFIG_IDEDMA_AUTO=yCONFIG_SCSI=yCONFIG_BLK_DEV_SD=yCONFIG_CHR_DEV_ST=yCONFIG_BLK_DEV_SR=yCONFIG_BLK_DEV_SR_VENDOR=yCONFIG_CHR_DEV_SG=yCONFIG_SCSI_CONSTANTS=yCONFIG_SCSI_SYM53C8XX=yCONFIG_NETDEVICES=yCONFIG_DUMMY=mCONFIG_NET_ETHERNET=yCONFIG_HAPPYMEAL=yCONFIG_DEPCA=yCONFIG_HP100=yCONFIG_NET_PCI=yCONFIG_DL2K=mCONFIG_NS83820=mCONFIG_YELLOWFIN=yCONFIG_NET_TULIP=yCONFIG_DE2104X=mCONFIG_TULIP=yCONFIG_TULIP_MWI=yCONFIG_TULIP_MMIO=yCONFIG_DE4X5=yCONFIG_VT=yCONFIG_VT_CONSOLE=yCONFIG_SERIAL=yCONFIG_UNIX98_PTYS=yCONFIG_MOUSE=yCONFIG_PSMOUSE=yCONFIG_RTC=yCONFIG_DRM=yCONFIG_DRM_TDFX=yCONFIG_REISERFS_FS=yCONFIG_FAT_FS=yCONFIG_MSDOS_FS=yCONFIG_VFAT_FS=yCONFIG_TMPFS=yCONFIG_RAMFS=yCONFIG_ISO9660_FS=yCONFIG_PROC_FS=yCONFIG_DEVPTS_FS=yCONFIG_EXT2_FS=yCONFIG_UDF_FS=yCONFIG_OSF_PARTITION=yCONFIG_MSDOS_PARTITION=yCONFIG_NLS=yCONFIG_NLS_CODEPAGE_437=yCONFIG_VGA_CONSOLE=yCONFIG_FB=yCONFIG_DUMMY_CONSOLE=yCONFIG_FB_3DFX=yCONFIG_FBCON_CFB8=yCONFIG_FBCON_CFB16=yCONFIG_FBCON_CFB32=yCONFIG_FBCON_FONTS=y
CONFIG_FONT_SUN12x22=yCONFIG_PCI_CONSOLE=yCONFIG_SOUND=yCONFIG_SND=mCONFIG_SND_SEQUENCER=mCONFIG_SND_SEQ_DUMMY=mCONFIG_SND_OSSEMUL=yCONFIG_SND_MIXER_OSS=mCONFIG_SND_PCM_OSS=mCONFIG_SND_SEQUENCER_OSS=mCONFIG_SND_RTCTIMER=mCONFIG_SND_VERBOSE_PRINTK=yCONFIG_SND_CMIPCI=mCONFIG_USB=yCONFIG_USB_OHCI=mCONFIG_USB_SCANNER=mCONFIG_INPUT=yCONFIG_INPUT_KEYBDEV=yCONFIG_INPUT_MOUSEDEV=yCONFIG_SOUND_GAMEPORT=yCONFIG_SERIO=yCONFIG_SERIO_SERPORT=yCONFIG_ALPHA_LEGACY_START_ADDRESS=yCONFIG_DEBUG_KERNEL=yCONFIG_MATHEMU=yCONFIG_MAGIC_SYSRQ=yCONFIG_CRC32=y
Good luck,
Jurriaan
Signature · 5 lines
The unicorn stared unhappily at the dragon. "I don't suppose there's any chance that thing is a vegetarian?" The dragon smiled. His pointed teeth gleamed brightly in the sunlight. Simon R Green - Blue Moon Rising GNU/Linux 2.4.19p7 on Debian/Alpha 990 bogomips load:1.52 0.83 0.58
From: Jurriaan on Alpha <[email protected]>
Date: Fri, Apr 26, 2002 at 09:31:30AM +0200
Quoted 4 lines
I tried to compile 2.5.10 on my Alpha, but the cmipci module won't compile:
cmipci.c:2479: warning: implicit declaration of function `release_resource'
Just found out that this trivial patch remedies it:
driver.h Fri Apr 26 09:37:04 2002 renamed from driver.org Fri Apr 26 09:42:31 2002 +1 -1
@@ -50,7 +50,7 @@ */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) -#if defined(__i386__) || defined(__ppc__) +#if defined(__i386__) || defined(__ppc__) || defined(__alpha__) /* * Here a dirty hack for 2.4 kernels.. See kernel/memory.c. */
As for the why of this, or if it's the best way to solve it, I've no idea :-)
Jurriaan
Signature · 4 lines
"I resent it as well," said Scharde. "I am working to keep my rage under
control."
Jack Vance - Ecce and Old Earth
GNU/Linux 2.4.19p7 on Debian/Alpha 990 bogomips load:0.33 0.62 0.54Review
Quoted 5 lines · Jurriaan on Alpha
(quoted diff) +1
-1-#if defined(__i386__) || defined(__ppc__) +#if defined(__i386__) || defined(__ppc__) || defined(__alpha__) /* * Here a dirty hack for 2.4 kernels.. See kernel/memory.c. */
No, alpha doesn't need any kind of "dirty hacks". :-) We only need to get <linux/pci.h> included properly.
Ivan.
include/sound/driver.h +1 -1
@@ -50,12 +50,12 @@*/ #if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 ) +#include <linux/pci.h> #if defined(__i386__) || defined(__ppc__)/* * Here a dirty hack for 2.4 kernels.. See kernel/memory.c. */ #define HACK_PCI_ALLOC_CONSISTENT -#include <linux/pci.h> void *snd_pci_hack_alloc_consistent (struct pci_dev *hwdev,size_t size,dma_addr_t *dma_handle);#undef pci_alloc_consistent
Quoted 9 lines · Ivan Kokshaysky
include/sound/driver.h line 57
Quoted 5 lines · Jurriaan on Alpha
include/sound/driver.h +1
-1-#if defined(__i386__) || defined(__ppc__) +#if defined(__i386__) || defined(__ppc__) || defined(__alpha__)/* * Here a dirty hack for 2.4 kernels.. See kernel/memory.c. */ No, alpha doesn't need any kind of "dirty hacks". :-) We only need to get <
linux/pci.h> included properly.
The real fix is to add '#include <linux/pci.h>' line to all necessary source files (sound/pci/cmipci.c in this example). Not all source files need pci.h for compilation.
Jaroslav
Quoted 6 lines
include/sound/driver.h +0
-0@@ -50,12 +50,12 @@*/ #if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,4 ,0 )
include/sound/driver.h line 61
Quoted 10 lines
include/sound/driver.h +1
-1+#include <linux/pci.h> #if defined(__i386__) || defined(__ppc__)/* * Here a dirty hack for 2.4 kernels.. See kernel/memory.c. */ #define HACK_PCI_ALLOC_CONSISTENT -#include <linux/pci.h> void *snd_pci_hack_alloc_consistent (struct pci_dev *hwdev,size_t size,dma_addr_t *dma_handle);#undef pci_alloc_consistent
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com
Quoted 3 lines · Jaroslav Kysela
The real fix is to add '#include <
linux/pci.h>' line to all necessary source files (sound/pci/cmipci.cin this example). Not all source files needpci.hfor compilation.
You'd also need to forward-declare struct pci_dev in sound/driver.h to stop the compiler complaining about 'struct pci_dev' in function prototypes.
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
At Fri, 26 Apr 2002 10:40:17 +0100,
Quoted 9 lines · Russell King
Quoted 3 lines · Jaroslav Kysela
The real fix is to add '#include <
linux/pci.h>' line to all necessary source files (sound/pci/cmipci.cin this example). Not all source files needpci.hfor compilation.You'd also need to forward-declare struct
pci_devinsound/driver.hto stop the compiler complaining about 'structpci_dev' in function prototypes.
struct pci_dev in sound/driver.h is used only for i386 and ppc, so it's not problem.
but it's true for sound/core.h. we use the struct there, too, for general cases.
Takashi
Quoted 3 lines · Jaroslav Kysela
The real fix is to add '#include <
linux/pci.h>' line to all necessary source files (sound/pci/cmipci.cin this example). Not all source files needpci.hfor compilation.
Yes, but quite a few of them. Almost all files under sound/pci, plus isapnp stuff which needs struct pci_dev and struct pci_bus. Including <linux/pci.h> in single place would be much simpler and shouldn't break anything, no?
Ivan.
Quoted 9 lines · Ivan Kokshaysky
Quoted 3 lines · Jaroslav Kysela
The real fix is to add '#include <
linux/pci.h>' line to all necessary source files (sound/pci/cmipci.cin this example). Not all source files needpci.hfor compilation.Yes, but quite a few of them. Almost all files under
sound/pci, plus isapnp stuff which needs structpci_devand structpci_bus. Including <linux/pci.h> in single place would be much simpler and shouldn't break anything, no?
<linux/isapnp.h> already includes <linux/pci.h> and there are many files in sound/core, sound/drivers, sound/i2c which really have not anything related to PCI. I think that it's better to include only related header files to optimize compilation (although current CPUs are fast enough).
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com
Quoted 4 lines · Jaroslav Kysela
<
linux/isapnp.h> already includes <linux/pci.h> and there are many files insound/core,sound/drivers,sound/i2cwhich really have not anything related to PCI. I think that it's better to include only related header files to optimize compilation (although current CPUs are fast enough).
Ok, this makes sense.
While we are here, there is missing #include <linux/init.h> in sound/isa/ad1848/ad1848_lib.c, which also breaks compilation on alpha.
Ivan.