2002-04-26 07:31:58

by jurriaan

[permalink] [raw]
Subject: 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 type
cmipci.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=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_EXPERIMENTAL=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
CONFIG_MODULES=y
CONFIG_KMOD=y
CONFIG_ALPHA_MIATA=y
CONFIG_ISA=y
CONFIG_EISA=y
CONFIG_PCI=y
CONFIG_ALPHA_EV5=y
CONFIG_ALPHA_EV56=y
CONFIG_ALPHA_CIA=y
CONFIG_ALPHA_PYXIS=y
CONFIG_PCI_NAMES=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_EM86=y
CONFIG_PARPORT=m
CONFIG_BLK_DEV_FD=y
CONFIG_BLK_DEV_LOOP=m
CONFIG_PACKET=y
CONFIG_NETLINK_DEV=y
CONFIG_NETFILTER=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_INET_ECN=y
CONFIG_SYN_COOKIES=y
CONFIG_IP_NF_CONNTRACK=m
CONFIG_IP_NF_FTP=m
CONFIG_IP_NF_IRC=m
CONFIG_IP_NF_QUEUE=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_NAT_IRC=m
CONFIG_IP_NF_NAT_FTP=m
CONFIG_IP_NF_COMPAT_IPCHAINS=y
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_VLAN_8021Q=m
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_IDEDISK_MULTI_MODE=y
CONFIG_BLK_DEV_IDECD=y
CONFIG_BLK_DEV_CMD640=y
CONFIG_BLK_DEV_CMD640_ENHANCED=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_BLK_DEV_ALI15X3=y
CONFIG_BLK_DEV_CMD64X=y
CONFIG_BLK_DEV_PDC202XX=y
CONFIG_PDC202XX_BURST=y
CONFIG_IDEDMA_AUTO=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SYM53C8XX=y
CONFIG_NETDEVICES=y
CONFIG_DUMMY=m
CONFIG_NET_ETHERNET=y
CONFIG_HAPPYMEAL=y
CONFIG_DEPCA=y
CONFIG_HP100=y
CONFIG_NET_PCI=y
CONFIG_DL2K=m
CONFIG_NS83820=m
CONFIG_YELLOWFIN=y
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_TULIP=y
CONFIG_TULIP_MWI=y
CONFIG_TULIP_MMIO=y
CONFIG_DE4X5=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UNIX98_PTYS=y
CONFIG_MOUSE=y
CONFIG_PSMOUSE=y
CONFIG_RTC=y
CONFIG_DRM=y
CONFIG_DRM_TDFX=y
CONFIG_REISERFS_FS=y
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_RAMFS=y
CONFIG_ISO9660_FS=y
CONFIG_PROC_FS=y
CONFIG_DEVPTS_FS=y
CONFIG_EXT2_FS=y
CONFIG_UDF_FS=y
CONFIG_OSF_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_VGA_CONSOLE=y
CONFIG_FB=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_FB_3DFX=y
CONFIG_FBCON_CFB8=y
CONFIG_FBCON_CFB16=y
CONFIG_FBCON_CFB32=y
CONFIG_FBCON_FONTS=y
CONFIG_FONT_SUN12x22=y
CONFIG_PCI_CONSOLE=y
CONFIG_SOUND=y
CONFIG_SND=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_SEQUENCER_OSS=m
CONFIG_SND_RTCTIMER=m
CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_CMIPCI=m
CONFIG_USB=y
CONFIG_USB_OHCI=m
CONFIG_USB_SCANNER=m
CONFIG_INPUT=y
CONFIG_INPUT_KEYBDEV=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_SOUND_GAMEPORT=y
CONFIG_SERIO=y
CONFIG_SERIO_SERPORT=y
CONFIG_ALPHA_LEGACY_START_ADDRESS=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MATHEMU=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_CRC32=y

Good luck,
Jurriaan
--
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


2002-04-26 07:44:27

by jurriaan

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

From: Jurriaan on Alpha <[email protected]>
Date: Fri, Apr 26, 2002 at 09:31:30AM +0200
> 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.org Fri Apr 26 09:42:31 2002
+++ driver.h Fri Apr 26 09:37:04 2002
@@ -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
--
"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.54

2002-04-26 09:05:33

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

On Fri, Apr 26, 2002 at 09:44:16AM +0200, Jurriaan on Alpha wrote:
> -#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.

--- 2.5.10/include/sound/driver.h Mon Mar 18 23:37:12 2002
+++ linux/include/sound/driver.h Tue Mar 26 23:47:32 2002
@@ -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

2002-04-26 09:17:45

by Jaroslav Kysela

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

On Fri, 26 Apr 2002, Ivan Kokshaysky wrote:

> On Fri, Apr 26, 2002 at 09:44:16AM +0200, Jurriaan on Alpha wrote:
> > -#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

> --- 2.5.10/include/sound/driver.h Mon Mar 18 23:37:12 2002
> +++ linux/include/sound/driver.h Tue Mar 26 23:47:32 2002
> @@ -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

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

2002-04-26 09:40:28

by Russell King

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

On Fri, Apr 26, 2002 at 11:17:23AM +0200, Jaroslav Kysela wrote:
> 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.

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.

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

2002-04-26 09:56:34

by Takashi Iwai

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

At Fri, 26 Apr 2002 10:40:17 +0100,
Russell King wrote:
>
> On Fri, Apr 26, 2002 at 11:17:23AM +0200, Jaroslav Kysela wrote:
> > 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.
>
> 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.

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

2002-04-26 10:19:17

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

On Fri, Apr 26, 2002 at 11:17:23AM +0200, Jaroslav Kysela wrote:
> 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.

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.

2002-04-26 10:27:04

by Jaroslav Kysela

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

On Fri, 26 Apr 2002, Ivan Kokshaysky wrote:

> On Fri, Apr 26, 2002 at 11:17:23AM +0200, Jaroslav Kysela wrote:
> > 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.
>
> 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?

<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

2002-04-26 10:50:11

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: compiling cmipci in 2.5.10 on Alpha doesn't work

On Fri, Apr 26, 2002 at 12:26:10PM +0200, Jaroslav Kysela wrote:
> <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).

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.