diff options
165 files changed, 1701 insertions, 1769 deletions
diff --git a/Documentation/isapnp.txt b/Documentation/isapnp.txt index d2f09d3de6a5..400d1b5b523d 100644 --- a/Documentation/isapnp.txt +++ b/Documentation/isapnp.txt @@ -4,199 +4,11 @@ ISA Plug & Play support by Jaroslav Kysela <perex@suse.cz> Interface /proc/isapnp ====================== -Read commands: --------------- +The interface has been removed. See pnp.txt for more details. -No comment. - -Write commands: ---------------- - -With the write interface you can activate or modify the configuration of -ISA Plug & Play devices. It is mainly useful for drivers which have not -been rewritten to use the ISA Plug & Play kernel support yet. - -card <idx> <vendor> - select PnP device by vendor identification -csn <CSN> - select PnP device by CSN -dev <idx> <logdev> - select logical device -auto - run autoconfigure -activate - activate logical device -deactivate - deactivate logical device -port <idx> <value> - set port 0-7 to value -irq <idx> <value> - set IRQ 0-1 to value -dma <idx> <value> - set DMA 0-1 to value -memory <idx> <value> - set memory 0-3 to value -poke <reg> <value> - poke configuration byte to selected register -pokew <reg> <value> - poke configuration word to selected register -poked <reg> <value> - poke configuration dword to selected register -allow_dma0 <value> - allow dma channel 0 during auto activation: 0=off, 1=on - -Explanation: - - variable <idx> begins with zero - - variable <CSN> begins with one - - <vendor> is in the standard format 'ABC1234' - - <logdev> is in the standard format 'ABC1234' - -Example: - -cat > /proc/isapnp <<EOF -card 0 CSC7537 -dev 0 CSC0000 -port 0 0x534 -port 1 0x388 -port 2 0x220 -irq 0 5 -dma 0 1 -dma 1 3 -poke 0x70 9 -activate -logdev 0 CSC0001 -port 0 0x240 -activate -EOF - - -Information for developers +Interface /proc/bus/isapnp ========================== -Finding a device ----------------- - -extern struct pci_bus *isapnp_find_card(unsigned short vendor, - unsigned short device, - struct pci_bus *from); - -This function finds an ISA PnP card. For the vendor argument, the -ISAPNP_VENDOR(a,b,c) macro should be used, where a,b,c are characters or -integers. For the device argument the ISAPNP_DEVICE(x) macro should be -used, where x is an integer value. Both vendor and device arguments -can be taken from contents of the /proc/isapnp file. - -extern struct pci_dev *isapnp_find_dev(struct pci_bus *card, - unsigned short vendor, - unsigned short function, - struct pci_dev *from); - -This function finds an ISA PnP device. If card is NULL, then the global -search mode is used (all devices are used for the searching). Otherwise -only devices which belong to the specified card are checked. For the -function number the ISAPNP_FUNCTION(x) macro can be used; it works -similarly to the ISAPNP_DEVICE(x) macro. - -extern int isapnp_probe_cards(const struct isapnp_card_id *ids, - int (*probe)(struct pci_bus *card, - const struct isapnp_card_id *id)); - - -This function is a helper for drivers which need to use more than -one device from an ISA PnP card. The probe callback is called with -appropriate arguments for each card. - -Example for ids parameter initialization: - -static struct isapnp_card_id card_ids[] __devinitdata = { - { - ISAPNP_CARD_ID('A','D','V', 0x550a), - devs: { - ISAPNP_DEVICE_ID('A', 'D', 'V', 0x0010), - ISAPNP_DEVICE_ID('A', 'D', 'V', 0x0011) - }, - driver_data: 0x1234, - }, - { - ISAPNP_CARD_END, - } -}; -ISAPNP_CARD_TABLE(card_ids); - -extern int isapnp_probe_devs(const struct isapnp_device_id *ids, - int (*probe)(struct pci_bus *card, - const struct isapnp_device_id *id)); - - -This function is a helper for drivers which need to use one -device from an ISA PnP card. The probe callback is called with -appropriate arguments for each matched device. - -Example for ids parameter initialization: - -static struct isapnp_device_id device_ids[] __devinitdata = { - { ISAPNP_DEVICE_SINGLE('E','S','S', 0x0968, 'E','S','S', 0x0968), }, - { ISAPNP_DEVICE_SINGLE_END, } -}; -MODULE_DEVICE_TABLE(isapnp, device_ids); - - -ISA PnP configuration -===================== - -There are two ways in which the ISA PnP interface can be used. - -First way: low-level --------------------- - -All ISA PNP configuration registers are accessible via the low-level -isapnp_(read|write)_(byte|word|dword) functions. - -The function isapnp_cfg_begin() must be called before any lowlevel function. -The function isapnp_cfg_end() must be always called after configuration -otherwise the access to the ISA PnP configuration functions will be blocked. - -Second way: auto-configuration ------------------------------- - -This feature gives to the driver the real power of the ISA PnP driver. -The function dev->prepare() initializes the resource members in the device -structure. This structure contains all resources set to auto configuration -values after the initialization. The device driver may modify some resources -to skip the auto configuration for a given resource. - -Once the device structure contains all requested resource values, the function -dev->activate() must be called to assign free resources to resource members -with the auto configuration value. - -Function dev->activate() does: - - resources with the auto configuration value are configured - - the auto configuration is created using ISA PnP resource map - - the function writes configuration to ISA PnP configuration registers - - the function returns to the caller actual used resources - -When the device driver is removed, function dev->deactivate() has to be -called to free all assigned resources. - -Example (game port initialization) -================================== - -/*** initialization ***/ - - struct pci_dev *dev; - - /* find the first game port, use standard PnP IDs */ - dev = isapnp_find_dev(NULL, - ISAPNP_VENDOR('P','N','P'), - ISAPNP_FUNCTION(0xb02f), - NULL); - if (!dev) - return -ENODEV; - if (dev->active) - return -EBUSY; - if (dev->prepare(dev)<0) - return -EAGAIN; - if (!(dev->resource[0].flags & IORESOURCE_IO)) - return -ENODEV; - if (!dev->ro) { - /* override resource */ - if (user_port != USER_PORT_AUTO_VALUE) - isapnp_resource_change(&dev->resource[0], user_port, 1); - } - if (dev->activate(dev)<0) { - printk("isapnp configure failed (out of resources?)\n"); - return -ENOMEM; - } - user_port = dev->resource[0].start; /* get real port */ - -/*** deactivation ***/ - - /* to deactivate use: */ - if (dev) - dev->deactivate(dev); +This directory allows access to ISA PnP cards and logical devices. +The regular files contain the contents of ISA PnP registers for +a logical device. diff --git a/Documentation/usb/ehci.txt b/Documentation/usb/ehci.txt index d6eae9814188..1536b7e75134 100644 --- a/Documentation/usb/ehci.txt +++ b/Documentation/usb/ehci.txt @@ -1,4 +1,4 @@ -23-Aug-2002 +27-Dec-2002 The EHCI driver is used to talk to high speed USB 2.0 devices using USB 2.0-capable host controller hardware. The USB 2.0 standard is @@ -47,9 +47,11 @@ used on PPC hardware so big/little endianness issues should be gone. It's believed to do all the right PCI magic so that I/O works even on systems with interesting DMA mapping issues. +Transfer Types + At this writing the driver should comfortably handle all control, bulk, and interrupt transfers, including requests to USB 1.1 devices through -transaction translators (TTs) in USB 2.0 hubs. +transaction translators (TTs) in USB 2.0 hubs. But you may find bugs. High Speed Isochronous (ISO) transfer support is also functional, but at this writing no Linux drivers have been using that support. @@ -60,6 +62,8 @@ transfers can't share much code with the code for high speed ISO transfers, since EHCI represents these with a different data structure. So for now, most USB audio and video devices can't be connected to high speed buses. +Driver Behavior + Transfers of all types can be queued. This means that control transfers from a driver on one interface (or through usbfs) won't interfere with ones from another driver, and that interrupt transfers can use periods @@ -104,9 +108,20 @@ Module parameters (pass to "modprobe") include: is 6, indicating 2^6 = 64 microframes. This controls how often the EHCI controller can issue interrupts. -The EHCI interrupt handler just acknowledges interrupts and schedules -a tasklet to handle whatever needs handling. That keeps latencies low, -no matter how often interrupts are issued. +If you're using this driver on a 2.5 kernel, and you've enabled USB +debugging support, you'll see three files in the "sysfs" directory for +any EHCI controller: + + "async" dumps the asynchronous schedule, used for control + and bulk transfers. Shows each active qh and the qtds + pending, usually one qtd per urb. (Look at it with + usb-storage doing disk I/O; watch the request queues!) + "periodic" dumps the periodic schedule, used for interrupt + and isochronous transfers. Doesn't show qtds. + "registers" show controller register state, and + +The contents of those files can help identify driver problems. + Device drivers shouldn't care whether they're running over EHCI or not, but they may want to check for "usb_device->speed == USB_SPEED_HIGH". @@ -115,6 +130,11 @@ can't, such as "high bandwidth" periodic (interrupt or ISO) transfers. Also, some values in device descriptors (such as polling intervals for periodic transfers) use different encodings when operating at high speed. +However, do make a point of testing device drivers through USB 2.0 hubs. +Those hubs report some failures, such as disconnections, differently when +transaction translators are in use; some drivers have been seen to behave +badly when they see different faults than OHCI or UHCI report. + PERFORMANCE @@ -176,10 +196,16 @@ than the I/O. If that same loop used 16 KB chunks, it'd be better; a sequence of 128 KB chunks would waste a lot less. But rather than depending on such large I/O buffers to make synchronous -I/O be efficient, it's better to just queue all several (bulk) requests +I/O be efficient, it's better to just queue up several (bulk) requests to the HC, and wait for them all to complete (or be canceled on error). Such URB queuing should work with all the USB 1.1 HC drivers too. +In the Linux 2.5 kernels, new usb_sg_*() api calls have been defined; they +queue all the buffers from a scatterlist. They also use scatterlist DMA +mapping (which might apply an IOMMU) and IRQ reduction, all of which will +help make high speed transfers run as fast as they can. + + TBD: Interrupt and ISO transfer performance issues. Those periodic transfers are fully scheduled, so the main issue is likely to be how to trigger "high bandwidth" modes. @@ -203,7 +203,7 @@ scripts/docproc scripts/fixdep scripts/split-include : scripts ; .PHONY: scripts scripts: - $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts + $(Q)$(MAKE) $(build)=scripts # Objects we will link into vmlinux / subdirs we need to visit # --------------------------------------------------------------------------- @@ -313,9 +313,9 @@ define rule_vmlinux__ set -e $(if $(filter .tmp_kallsyms%,$^),, echo ' Generating build number' - . scripts/mkversion > .tmp_version + . $(src)/scripts/mkversion > .tmp_version mv -f .tmp_version .version - $(Q)$(MAKE) -f scripts/Makefile.build obj=init + $(Q)$(MAKE) $(build)=init ) $(call cmd,vmlinux__) echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd @@ -329,7 +329,7 @@ endef ifdef CONFIG_SMP define rule_vmlinux $(rule_vmlinux_no_percpu) - $(AWK) -f scripts/per-cpu-check.awk < System.map + $(AWK) -f $(srctree)/scripts/per-cpu-check.awk < System.map endef else define rule_vmlinux @@ -385,7 +385,7 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ; .PHONY: $(SUBDIRS) $(SUBDIRS): .hdepend prepare - $(Q)$(MAKE) -f scripts/Makefile.build obj=$@ + $(Q)$(MAKE) $(build)=$@ # Things we need done before we descend to build or make # module versions are listed in "prepare" @@ -408,17 +408,19 @@ targets += arch/$(ARCH)/vmlinux.lds.s # --------------------------------------------------------------------------- %.s: %.c scripts FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@ + $(Q)$(MAKE) $(build)=$(@D) $@ %.i: %.c scripts FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@ + $(Q)$(MAKE) $(build)=$(@D) $@ %.o: %.c scripts FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@ + $(Q)$(MAKE) $(build)=$(@D) $@ +%.ko: scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ %.lst: %.c scripts FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@ + $(Q)$(MAKE) $(build)=$(@D) $@ %.s: %.S scripts FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@ + $(Q)$(MAKE) $(build)=$(@D) $@ %.o: %.S scripts FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@ + $(Q)$(MAKE) $(build)=$(@D) $@ # FIXME: The asm symlink changes when $(ARCH) changes. That's # hard to detect, but I suppose "make mrproper" is a good idea @@ -439,7 +441,7 @@ include/config/MARKER: scripts/split-include include/linux/autoconf.h # with it and forgot to run make oldconfig include/linux/autoconf.h: .config - $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig scripts/kconfig/conf + $(Q)$(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf ./scripts/kconfig/conf -s arch/$(ARCH)/Kconfig # Generate some files @@ -619,7 +621,7 @@ rpm: clean spec tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \ rm $(KERNELPATH) ; \ cd $(TOPDIR) ; \ - . scripts/mkversion > .version ; \ + $(CONFIG_SHELL) $(srctree)/scripts/mkversion > .version ; \ rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \ rm $(TOPDIR)/../$(KERNELPATH).tar.gz @@ -657,13 +659,13 @@ ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),) make_with_config scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf: scripts/fixdep FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig $@ + $(Q)$(MAKE) $(build)=scripts/kconfig $@ xconfig: scripts/kconfig/qconf ./scripts/kconfig/qconf arch/$(ARCH)/Kconfig menuconfig: scripts/kconfig/mconf - $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/lxdialog + $(Q)$(MAKE) $(build)=scripts/lxdialog ./scripts/kconfig/mconf arch/$(ARCH)/Kconfig config: scripts/kconfig/conf @@ -719,7 +721,7 @@ MRPROPER_DIRS += \ clean-dirs += $(ALL_SUBDIRS) Documentation/DocBook scripts $(addprefix _clean_,$(clean-dirs)): - $(Q)$(MAKE) -f scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@) + $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) quiet_cmd_rmclean = RM $$(CLEAN_FILES) cmd_rmclean = rm -f $(CLEAN_FILES) @@ -810,7 +812,8 @@ help: @$(MAKE) --no-print-directory -f Documentation/DocBook/Makefile dochelp @echo '' @echo 'Architecture specific targets ($(ARCH)):' - @$(MAKE) --no-print-directory -f arch/$(ARCH)/boot/Makefile archhelp + @$(if $(archhelp),$(archhelp),\ + echo ' No architecture specific help defined for $(ARCH)') @echo '' @echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'For further info browse Documentation/kbuild/*' @@ -819,7 +822,7 @@ help: # Documentation targets # --------------------------------------------------------------------------- sgmldocs psdocs pdfdocs htmldocs: scripts - $(Q)$(MAKE) -f scripts/Makefile.build obj=Documentation/DocBook $@ + $(Q)$(MAKE) $(build)=Documentation/DocBook $@ # Scripts to check various things for consistency # --------------------------------------------------------------------------- @@ -907,9 +910,20 @@ define update-if-changed mv -f $@.tmp $@; \ fi endef + +# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= +# Usage: +# $(Q)$(MAKE) $(build)=dir +build := -f scripts/Makefile.build obj + +# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir +# Usage: +# $(Q)$(MAKE) $(clean)=dir +clean := -f scripts/Makefile.clean obj + # $(call descend,<dir>,<target>) # Recursively call a sub-make in <dir> with target <target> - +# Usage is deprecated, because make do not see this as an invocation of make. descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2) FORCE: diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 9ae8e615513c..8fdb2bc24671 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -139,7 +139,7 @@ libs-y += arch/arm/lib/ # Default target when executing plain make all: zImage -makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/arm/boot $(1) +boot := arch/arm/boot # Update machine arch and proc symlinks if something which affects # them changed. We use .arch and .proc to indicate when they were @@ -162,17 +162,17 @@ prepare: maketools .PHONY: maketools FORCE maketools: include/asm-arm/.arch include/asm-arm/.proc \ include/asm-arm/constants.h include/linux/version.h FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=arch/arm/tools include/asm-arm/mach-types.h + $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h # Convert bzImage to zImage bzImage: vmlinux - $(call makeboot,arch/arm/boot/zImage) + $(Q)$(MAKE) $(build)=$(boot) $(boot)/zImage zImage Image bootpImage: vmlinux - $(call makeboot,arch/arm/boot/$@) + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ zinstall install: vmlinux - $(call makeboot,$@) + $(Q)$(MAKE) $(build)=$(boot) $@ MRPROPER_FILES += \ include/asm-arm/arch include/asm-arm/.arch \ @@ -183,14 +183,14 @@ MRPROPER_FILES += \ # We use MRPROPER_FILES and CLEAN_FILES now archmrproper: archclean: - $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/arm/boot + $(Q)$(MAKE) $(clean)=$(boot) # My testing targets (that short circuit a few dependencies) -zImg:; $(call makeboot, arch/arm/boot/zImage) -Img:; $(call makeboot, arch/arm/boot/Image) -bp:; $(call makeboot, arch/arm/boot/bootpImage) -i:; $(call makeboot, install) -zi:; $(call makeboot, zinstall) +zImg:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/zImage +Img:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/Image +bp:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/bootpImage +i:; $(Q)$(MAKE) $(build)=$(boot) install +zi:; $(Q)$(MAKE) $(build)=$(boot) zinstall # # Configuration targets. Use these to select a @@ -216,3 +216,15 @@ include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s @echo -n ' Generating $@' @$(generate-asm-offsets.h) < $< > $@.tmp @$(update-if-changed) + +define archhelp + echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' + echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' + echo ' bootpImage - Combined zImage and initial RAM disk' + echo ' initrd - Create an initial image' + echo ' install - Install uncompressed kernel' + echo ' zinstall - Install compressed kernel' + echo ' Install using (your) ~/bin/installkernel or' + echo ' (distribution) /sbin/installkernel or' + echo ' install to $$(INSTALL_PATH) and run lilo' +endef diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 61eeee5c544f..ec798c2de3ff 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile @@ -84,10 +84,10 @@ $(obj)/bootpImage: $(obj)/bootp/bootp FORCE @echo ' Kernel: $@ is ready' $(obj)/compressed/vmlinux: vmlinux FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed $@ + $(Q)$(MAKE) $(build)=$(obj)/compressed $@ $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed $@ + $(Q)$(MAKE) $(build)=$(obj)/compressed $@ .PHONY: initrd initrd: @@ -108,14 +108,3 @@ zinstall: $(obj)/zImage clean-files := $(addprefix $(obj)/,Image zImage bootpImage) subdir- := bootp compressed - -archhelp: - @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' - @echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' - @echo ' bootpImage - Combined zImage and initial RAM disk' - @echo ' initrd - Create an initial image' - @echo ' install - Install uncompressed kernel' - @echo ' zinstall - Install compressed kernel' - @echo ' Install using (your) ~/bin/installkernel or' - @echo ' (distribution) /sbin/installkernel or' - @echo ' install to $$(INSTALL_PATH) and run lilo' diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 976f82eee371..8de1d269d252 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -81,7 +81,7 @@ drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/ CFLAGS += $(mflags-y) AFLAGS += $(mflags-y) -makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/i386/boot $(1) +boot := arch/i386/boot .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ clean archclean archmrproper @@ -92,20 +92,27 @@ BOOTIMAGE=arch/i386/boot/bzImage zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage zImage bzImage: vmlinux - $(call makeboot,$(BOOTIMAGE)) + $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) compressed: zImage zlilo bzlilo: vmlinux - $(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zlilo) + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo zdisk bzdisk: vmlinux - $(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zdisk) + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk install: vmlinux - $(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install) + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) install archclean: - $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/i386/boot + $(Q)$(MAKE) $(clean)=arch/i386/boot + +define archhelp + echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' + echo ' install - Install kernel using' + echo ' (your) ~/bin/installkernel or' + echo ' (distribution) /sbin/installkernel or' + echo ' install to $$(INSTALL_PATH) and run lilo' +endef -archmrproper: diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile index bcb97140c50f..701136c7581c 100644 --- a/arch/i386/boot/Makefile +++ b/arch/i386/boot/Makefile @@ -74,11 +74,3 @@ zlilo: $(BOOTIMAGE) install: $(BOOTIMAGE) sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" - -archhelp: - @echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' - @echo ' install - Install kernel using' - @echo ' (your) ~/bin/installkernel or' - @echo ' (distribution) /sbin/installkernel or' - @echo ' install to $$(INSTALL_PATH) and run lilo' - diff --git a/arch/i386/kernel/cpu/mcheck/p4.c b/arch/i386/kernel/cpu/mcheck/p4.c index 903fac8e52c3..044aab612f66 100644 --- a/arch/i386/kernel/cpu/mcheck/p4.c +++ b/arch/i386/kernel/cpu/mcheck/p4.c @@ -123,7 +123,7 @@ static void __init intel_init_thermal(struct cpuinfo_x86 *c) /* P4/Xeon Extended MCE MSR retrieval, return 0 if unsupported */ -static int inline intel_get_extended_msrs(struct intel_mce_extended_msrs *r) +static inline int intel_get_extended_msrs(struct intel_mce_extended_msrs *r) { u32 h; diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index c69963ca6bc7..3f42c6e3f011 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -251,7 +251,7 @@ static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED; * We need to reload %cr3 since the page tables may be going * away from under us.. */ -static void inline leave_mm (unsigned long cpu) +static inline void leave_mm (unsigned long cpu) { if (cpu_tlbstate[cpu].state == TLBSTATE_OK) BUG(); diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 063728add94e..c028ac4ab667 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -317,7 +317,7 @@ static inline unsigned long get_cr2(void) return address; } -static void inline do_trap(int trapnr, int signr, char *str, int vm86, +static inline void do_trap(int trapnr, int signr, char *str, int vm86, struct pt_regs * regs, long error_code, siginfo_t *info) { if (vm86 && regs->eflags & VM_MASK) diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c index a6355ae320fd..fe3569203ce6 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/i386/mach-voyager/voyager_smp.c @@ -862,7 +862,7 @@ static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED; * We need to reload %cr3 since the page tables may be going * away from under us.. */ -static void inline +static inline void leave_mm (unsigned long cpu) { if (cpu_tlbstate[cpu].state == TLBSTATE_OK) diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c index c7c5640a7d61..56f06e90f72f 100644 --- a/arch/mips/dec/time.c +++ b/arch/mips/dec/time.c @@ -326,7 +326,7 @@ static long last_rtc_update; * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static void inline +static inline void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { volatile unsigned char dummy; diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index bef2f248725f..16c299115e35 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -285,7 +285,7 @@ badframe: force_sig(SIGSEGV, current); } -static int inline +static inline int setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { int owned_fp; diff --git a/arch/mips/sgi/kernel/reset.c b/arch/mips/sgi/kernel/reset.c index c4e6ac1d1887..e636497beaf2 100644 --- a/arch/mips/sgi/kernel/reset.c +++ b/arch/mips/sgi/kernel/reset.c @@ -126,7 +126,7 @@ static inline void power_button(void) add_timer(&power_timer); } -void inline sgi_volume_set(unsigned char volume) +inline void sgi_volume_set(unsigned char volume) { sgi_volume = volume; @@ -134,7 +134,7 @@ void inline sgi_volume_set(unsigned char volume) hpc3c0->pbus_extregs[2][1] = sgi_volume; } -void inline sgi_volume_get(unsigned char *volume) +inline void sgi_volume_get(unsigned char *volume) { *volume = sgi_volume; } diff --git a/arch/mips64/kernel/signal.c b/arch/mips64/kernel/signal.c index d96be2439680..1d8387342157 100644 --- a/arch/mips64/kernel/signal.c +++ b/arch/mips64/kernel/signal.c @@ -344,7 +344,7 @@ badframe: force_sig(SIGSEGV, current); } -static int inline setup_sigcontext(struct pt_regs *regs, +static inline int setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { int err = 0; diff --git a/arch/mips64/kernel/signal32.c b/arch/mips64/kernel/signal32.c index 98052bb063ca..636f71ab9eb7 100644 --- a/arch/mips64/kernel/signal32.c +++ b/arch/mips64/kernel/signal32.c @@ -425,7 +425,7 @@ badframe: force_sig(SIGSEGV, current); } -static int inline +static inline int setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { int err = 0; diff --git a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c index a52f39e338e3..4633b43f381b 100644 --- a/arch/ppc/8260_io/uart.c +++ b/arch/ppc/8260_io/uart.c @@ -2035,7 +2035,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) * /proc fs routines.... */ -static int inline line_info(char *buf, struct serial_state *state) +static inline int line_info(char *buf, struct serial_state *state) { #ifdef notdef struct async_struct *info = state->info, scr_info; diff --git a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c index 3be25081d634..690c4e501aa9 100644 --- a/arch/ppc/8xx_io/uart.c +++ b/arch/ppc/8xx_io/uart.c @@ -2091,7 +2091,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) * /proc fs routines.... */ -static int inline line_info(char *buf, struct serial_state *state) +static inline int line_info(char *buf, struct serial_state *state) { #ifdef notdef struct async_struct *info = state->info, scr_info; diff --git a/arch/ppc/boot/prep/vreset.c b/arch/ppc/boot/prep/vreset.c index f72d00b76741..16c786de9aa5 100644 --- a/arch/ppc/boot/prep/vreset.c +++ b/arch/ppc/boot/prep/vreset.c @@ -389,7 +389,7 @@ extern void puthex(unsigned long); extern void puts(const char *); static void unlockS3(void); -static void inline +static inline void outw(int port, unsigned short val) { outb(port, val >> 8); diff --git a/arch/s390x/Kconfig b/arch/s390x/Kconfig index 9fde2f90c024..dcb6a3a81ec0 100644 --- a/arch/s390x/Kconfig +++ b/arch/s390x/Kconfig @@ -92,6 +92,11 @@ config S390_SUPPORT (and some other stuff like libraries and such) is needed for executing 31 bit applications. It is safe to say "Y". +config COMPAT + bool + depends on S390_SUPPORT + default y + config BINFMT_ELF32 tristate "Kernel support for 31 bit ELF binaries" depends on S390_SUPPORT diff --git a/arch/s390x/kernel/binfmt_elf32.c b/arch/s390x/kernel/binfmt_elf32.c index fab61db1ef77..a8762672720b 100644 --- a/arch/s390x/kernel/binfmt_elf32.c +++ b/arch/s390x/kernel/binfmt_elf32.c @@ -115,14 +115,10 @@ typedef s390_regs32 elf_gregset_t; #include <linux/config.h> #include <linux/elfcore.h> #include <linux/binfmts.h> +#include <linux/compat.h> int setup_arg_pages32(struct linux_binprm *bprm); -struct timeval32 -{ - int tv_sec, tv_usec; -}; - #define elf_prstatus elf_prstatus32 struct elf_prstatus32 { @@ -134,10 +130,10 @@ struct elf_prstatus32 pid_t pr_ppid; pid_t pr_pgrp; pid_t pr_sid; - struct timeval32 pr_utime; /* User time */ - struct timeval32 pr_stime; /* System time */ - struct timeval32 pr_cutime; /* Cumulative user time */ - struct timeval32 pr_cstime; /* Cumulative system time */ + struct compat_timeval pr_utime; /* User time */ + struct compat_timeval pr_stime; /* System time */ + struct compat_timeval pr_cutime; /* Cumulative user time */ + struct compat_timeval pr_cstime; /* Cumulative system time */ elf_gregset_t pr_reg; /* GP registers */ int pr_fpvalid; /* True if math co-processor being used. */ }; diff --git a/arch/s390x/kernel/entry.S b/arch/s390x/kernel/entry.S index 539be43e4ecc..66794e864c0d 100644 --- a/arch/s390x/kernel/entry.S +++ b/arch/s390x/kernel/entry.S @@ -421,7 +421,7 @@ sys_call_table: .long SYSCALL(sys_alarm,sys32_alarm_wrapper) .long SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old fstat syscall */ .long SYSCALL(sys_pause,sys32_pause) - .long SYSCALL(sys_utime,sys32_utime_wrapper) /* 30 */ + .long SYSCALL(sys_utime,compat_sys_utime_wrapper) /* 30 */ .long SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old stty syscall */ .long SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old gtty syscall */ .long SYSCALL(sys_access,sys32_access_wrapper) @@ -434,7 +434,7 @@ sys_call_table: .long SYSCALL(sys_rmdir,sys32_rmdir_wrapper) /* 40 */ .long SYSCALL(sys_dup,sys32_dup_wrapper) .long SYSCALL(sys_pipe,sys32_pipe_wrapper) - .long SYSCALL(sys_times,sys32_times_wrapper) + .long SYSCALL(sys_times,compat_sys_times_wrapper) .long SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old prof syscall */ .long SYSCALL(sys_brk,sys32_brk_wrapper) /* 45 */ .long SYSCALL(sys_ni_syscall,sys32_setgid16) /* old setgid16 syscall*/ @@ -495,11 +495,11 @@ sys_call_table: .long SYSCALL(sys_ni_syscall,sys_ni_syscall) .long SYSCALL(sys_socketcall,sys32_socketcall_wrapper) .long SYSCALL(sys_syslog,sys32_syslog_wrapper) - .long SYSCALL(sys_setitimer,sys32_setitimer_wrapper) - .long SYSCALL(sys_getitimer,sys32_getitimer_wrapper) /* 105 */ - .long SYSCALL(sys_newstat,sys32_newstat_wrapper) - .long SYSCALL(sys_newlstat,sys32_newlstat_wrapper) - .long SYSCALL(sys_newfstat,sys32_newfstat_wrapper) + .long SYSCALL(sys_setitimer,compat_sys_setitimer_wrapper) + .long SYSCALL(sys_getitimer,compat_sys_getitimer_wrapper) /* 105 */ + .long SYSCALL(sys_newstat,compat_sys_newstat_wrapper) + .long SYSCALL(sys_newlstat,compat_sys_newlstat_wrapper) + .long SYSCALL(sys_newfstat,compat_sys_newfstat_wrapper) .long SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old uname syscall */ .long SYSCALL(sys_ni_syscall,sys_ni_syscall) /* iopl for i386 */ .long SYSCALL(sys_vhangup,sys_vhangup) @@ -553,7 +553,7 @@ sys_call_table: .long SYSCALL(sys_sched_get_priority_max,sys32_sched_get_priority_max_wrapper) .long SYSCALL(sys_sched_get_priority_min,sys32_sched_get_priority_min_wrapper) .long SYSCALL(sys_sched_rr_get_interval,sys32_sched_rr_get_interval_wrapper) - .long SYSCALL(sys_nanosleep,sys32_nanosleep_wrapper) + .long SYSCALL(sys_nanosleep,compat_sys_nanosleep_wrapper) .long SYSCALL(sys_mremap,sys32_mremap_wrapper) .long SYSCALL(sys_ni_syscall,sys32_setresuid16_wrapper) /* old setresuid16 syscall */ .long SYSCALL(sys_ni_syscall,sys32_getresuid16_wrapper) /* old getresuid16 syscall */ diff --git a/arch/s390x/kernel/ioctl32.c b/arch/s390x/kernel/ioctl32.c index 5cd6992bcbe3..ff6066c2cd88 100644 --- a/arch/s390x/kernel/ioctl32.c +++ b/arch/s390x/kernel/ioctl32.c @@ -12,6 +12,7 @@ */ #include <linux/types.h> +#include <linux/compat.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/sched.h> @@ -70,11 +71,6 @@ static inline int hd_geometry_ioctl(unsigned int fd, unsigned int cmd, unsigned return ret; } -struct timeval32 { - int tv_sec; - int tv_usec; -}; - #define EXT2_IOC32_GETFLAGS _IOR('f', 1, int) #define EXT2_IOC32_SETFLAGS _IOW('f', 2, int) #define EXT2_IOC32_GETVERSION _IOR('v', 1, int) @@ -383,9 +379,9 @@ static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) struct loop_info32 { int lo_number; /* ioctl r/o */ - __kernel_dev_t32 lo_device; /* ioctl r/o */ + compat_dev_t lo_device; /* ioctl r/o */ unsigned int lo_inode; /* ioctl r/o */ - __kernel_dev_t32 lo_rdevice; /* ioctl r/o */ + compat_dev_t lo_rdevice; /* ioctl r/o */ int lo_offset; int lo_encrypt_type; int lo_encrypt_key_size; /* ioctl w/o */ diff --git a/arch/s390x/kernel/linux32.c b/arch/s390x/kernel/linux32.c index 32f9a576b570..46dcd3752a40 100644 --- a/arch/s390x/kernel/linux32.c +++ b/arch/s390x/kernel/linux32.c @@ -22,7 +22,6 @@ #include <linux/mm.h> #include <linux/file.h> #include <linux/signal.h> -#include <linux/utime.h> #include <linux/resource.h> #include <linux/times.h> #include <linux/utsname.h> @@ -57,6 +56,7 @@ #include <linux/icmpv6.h> #include <linux/sysctl.h> #include <linux/binfmts.h> +#include <linux/compat.h> #include <asm/types.h> #include <asm/ipc.h> @@ -245,49 +245,20 @@ asmlinkage long sys32_getegid16(void) /* 32-bit timeval and related flotsam. */ -struct timeval32 -{ - int tv_sec, tv_usec; -}; - -struct itimerval32 -{ - struct timeval32 it_interval; - struct timeval32 it_value; -}; - -static inline long get_tv32(struct timeval *o, struct timeval32 *i) +static inline long get_tv32(struct timeval *o, struct compat_timeval *i) { return (!access_ok(VERIFY_READ, tv32, sizeof(*tv32)) || (__get_user(o->tv_sec, &i->tv_sec) | __get_user(o->tv_usec, &i->tv_usec))); } -static inline long put_tv32(struct timeval32 *o, struct timeval *i) +static inline long put_tv32(struct compat_timeval *o, struct timeval *i) { return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || (__put_user(i->tv_sec, &o->tv_sec) | __put_user(i->tv_usec, &o->tv_usec))); } -static inline long get_it32(struct itimerval *o, struct itimerval32 *i) -{ - return (!access_ok(VERIFY_READ, i32, sizeof(*i32)) || - (__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) | - __get_user(o->it_interval.tv_usec, &i->it_interval.tv_usec) | - __get_user(o->it_value.tv_sec, &i->it_value.tv_sec) | - __get_user(o->it_value.tv_usec, &i->it_value.tv_usec))); -} - -static inline long put_it32(struct itimerval32 *o, struct itimerval *i) -{ - return (!access_ok(VERIFY_WRITE, i32, sizeof(*i32)) || - (__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) | - __put_user(i->it_interval.tv_usec, &o->it_interval.tv_usec) | - __put_user(i->it_value.tv_sec, &o->it_value.tv_sec) | - __put_user(i->it_value.tv_usec, &o->it_value.tv_usec))); -} - struct msgbuf32 { s32 mtype; char mtext[1]; }; struct ipc64_perm_ds32 @@ -297,7 +268,7 @@ struct ipc64_perm_ds32 __kernel_gid32_t gid; __kernel_uid32_t cuid; __kernel_gid32_t cgid; - __kernel_mode_t32 mode; + compat_mode_t mode; unsigned short __pad1; unsigned short seq; unsigned short __pad2; @@ -308,18 +279,18 @@ struct ipc64_perm_ds32 struct ipc_perm32 { key_t key; - __kernel_uid_t32 uid; - __kernel_gid_t32 gid; - __kernel_uid_t32 cuid; - __kernel_gid_t32 cgid; - __kernel_mode_t32 mode; + compat_uid_t uid; + compat_gid_t gid; + compat_uid_t cuid; + compat_gid_t cgid; + compat_mode_t mode; unsigned short seq; }; struct semid_ds32 { struct ipc_perm32 sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t32 sem_otime; /* last semop time */ - __kernel_time_t32 sem_ctime; /* last change time */ + compat_time_t sem_otime; /* last semop time */ + compat_time_t sem_ctime; /* last change time */ u32 sem_base; /* ptr to first semaphore in array */ u32 sem_pending; /* pending operations to be processed */ u32 sem_pending_last; /* last pending operation */ @@ -330,9 +301,9 @@ struct semid_ds32 { struct semid64_ds32 { struct ipc64_perm_ds32 sem_perm; unsigned int __pad1; - __kernel_time_t32 sem_otime; + compat_time_t sem_otime; unsigned int __pad2; - __kernel_time_t32 sem_ctime; + compat_time_t sem_ctime; u32 sem_nsems; u32 __unused1; u32 __unused2; @@ -343,31 +314,31 @@ struct msqid_ds32 struct ipc_perm32 msg_perm; u32 msg_first; u32 msg_last; - __kernel_time_t32 msg_stime; - __kernel_time_t32 msg_rtime; - __kernel_time_t32 msg_ctime; + compat_time_t msg_stime; + compat_time_t msg_rtime; + compat_time_t msg_ctime; u32 wwait; u32 rwait; unsigned short msg_cbytes; unsigned short msg_qnum; unsigned short msg_qbytes; - __kernel_ipc_pid_t32 msg_lspid; - __kernel_ipc_pid_t32 msg_lrpid; + compat_ipc_pid_t msg_lspid; + compat_ipc_pid_t msg_lrpid; }; struct msqid64_ds32 { struct ipc64_perm_ds32 msg_perm; unsigned int __pad1; - __kernel_time_t32 msg_stime; + compat_time_t msg_stime; unsigned int __pad2; - __kernel_time_t32 msg_rtime; + compat_time_t msg_rtime; unsigned int __pad3; - __kernel_time_t32 msg_ctime; + compat_time_t msg_ctime; unsigned int msg_cbytes; unsigned int msg_qnum; unsigned int msg_qbytes; - __kernel_pid_t32 msg_lspid; - __kernel_pid_t32 msg_lrpid; + compat_pid_t msg_lspid; + compat_pid_t msg_lrpid; unsigned int __unused1; unsigned int __unused2; }; @@ -376,25 +347,25 @@ struct msqid64_ds32 { struct shmid_ds32 { struct ipc_perm32 shm_perm; int shm_segsz; - __kernel_time_t32 shm_atime; - __kernel_time_t32 shm_dtime; - __kernel_time_t32 shm_ctime; - __kernel_ipc_pid_t32 shm_cpid; - __kernel_ipc_pid_t32 shm_lpid; + compat_time_t shm_atime; + compat_time_t shm_dtime; + compat_time_t shm_ctime; + compat_ipc_pid_t shm_cpid; + compat_ipc_pid_t shm_lpid; unsigned short shm_nattch; }; struct shmid64_ds32 { struct ipc64_perm_ds32 shm_perm; - __kernel_size_t32 shm_segsz; - __kernel_time_t32 shm_atime; + compat_size_t shm_segsz; + compat_time_t shm_atime; unsigned int __unused1; - __kernel_time_t32 shm_dtime; + compat_time_t shm_dtime; unsigned int __unused2; - __kernel_time_t32 shm_ctime; + compat_time_t shm_ctime; unsigned int __unused3; - __kernel_pid_t32 shm_cpid; - __kernel_pid_t32 shm_lpid; + compat_pid_t shm_cpid; + compat_pid_t shm_lpid; unsigned int shm_nattch; unsigned int __unused4; unsigned int __unused5; @@ -1010,37 +981,7 @@ asmlinkage int sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned l return sys_ftruncate(fd, (high << 32) | low); } -extern asmlinkage int sys_utime(char * filename, struct utimbuf * times); - -struct utimbuf32 { - __kernel_time_t32 actime, modtime; -}; - -asmlinkage int sys32_utime(char * filename, struct utimbuf32 *times) -{ - struct utimbuf t; - mm_segment_t old_fs; - int ret; - char *filenam; - - if (!times) - return sys_utime(filename, NULL); - if (get_user (t.actime, ×->actime) || - __get_user (t.modtime, ×->modtime)) - return -EFAULT; - filenam = getname (filename); - ret = PTR_ERR(filenam); - if (!IS_ERR(filenam)) { - old_fs = get_fs(); - set_fs (KERNEL_DS); - ret = sys_utime(filenam, &t); - set_fs (old_fs); - putname (filenam); - } - return ret; -} - -struct iovec32 { u32 iov_base; __kernel_size_t32 iov_len; }; +struct iovec32 { u32 iov_base; compat_size_t iov_len; }; typedef ssize_t (*io_fn_t)(struct file *, char *, size_t, loff_t *); typedef ssize_t (*iov_fn_t)(struct file *, const struct iovec *, unsigned long, loff_t *); @@ -1363,7 +1304,7 @@ set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset) asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x) { fd_set_bits fds; - struct timeval32 *tvp = (struct timeval32 *)AA(tvp_x); + struct compat_timeval *tvp = (struct compat_timeval *)AA(tvp_x); char *bits; unsigned long nn; long timeout; @@ -1452,7 +1393,7 @@ out_nofds: return ret; } -static int cp_new_stat32(struct kstat *stat, struct stat32 *statbuf) +int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf) { int err; @@ -1479,39 +1420,6 @@ static int cp_new_stat32(struct kstat *stat, struct stat32 *statbuf) return err; } -asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf) -{ - struct kstat stat; - int error = vfs_stat(filename, &stat); - - if (!error) - error = cp_new_stat32(&stat, statbuf); - - return error; -} - -asmlinkage int sys32_newlstat(char * filename, struct stat32 *statbuf) -{ - struct kstat stat; - int error = vfs_lstat(filename, &stat); - - if (!error) - error = cp_new_stat32(&stat, statbuf); - - return error; -} - -asmlinkage int sys32_newfstat(unsigned int fd, struct stat32 *statbuf) -{ - struct kstat stat; - int error = vfs_fstat(fd, &stat); - - if (!error) - error = cp_new_stat32(&stat, statbuf); - - return error; -} - extern asmlinkage int sys_sysfs(int option, unsigned long arg1, unsigned long arg2); asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2) @@ -1522,16 +1430,16 @@ asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2) struct ncp_mount_data32 { int version; unsigned int ncp_fd; - __kernel_uid_t32 mounted_uid; - __kernel_pid_t32 wdog_pid; + compat_uid_t mounted_uid; + compat_pid_t wdog_pid; unsigned char mounted_vol[NCP_VOLNAME_LEN + 1]; unsigned int time_out; unsigned int retry_count; unsigned int flags; - __kernel_uid_t32 uid; - __kernel_gid_t32 gid; - __kernel_mode_t32 file_mode; - __kernel_mode_t32 dir_mode; + compat_uid_t uid; + compat_gid_t gid; + compat_mode_t file_mode; + compat_mode_t dir_mode; }; static void *do_ncp_super_data_conv(void *raw_data) @@ -1551,11 +1459,11 @@ static void *do_ncp_super_data_conv(void *raw_data) struct smb_mount_data32 { int version; - __kernel_uid_t32 mounted_uid; - __kernel_uid_t32 uid; - __kernel_gid_t32 gid; - __kernel_mode_t32 file_mode; - __kernel_mode_t32 dir_mode; + compat_uid_t mounted_uid; + compat_uid_t uid; + compat_gid_t gid; + compat_mode_t file_mode; + compat_mode_t dir_mode; }; static void *do_smb_super_data_conv(void *raw_data) @@ -1671,8 +1579,8 @@ out: } struct rusage32 { - struct timeval32 ru_utime; - struct timeval32 ru_stime; + struct compat_timeval ru_utime; + struct compat_timeval ru_stime; s32 ru_maxrss; s32 ru_ixrss; s32 ru_idrss; @@ -1714,7 +1622,7 @@ static int put_rusage (struct rusage32 *ru, struct rusage *r) return err; } -asmlinkage int sys32_wait4(__kernel_pid_t32 pid, unsigned int *stat_addr, int options, struct rusage32 *ru) +asmlinkage int sys32_wait4(compat_pid_t pid, unsigned int *stat_addr, int options, struct rusage32 *ru) { if (!ru) return sys_wait4(pid, stat_addr, options, NULL); @@ -1774,14 +1682,10 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info) return ret; } -struct timespec32 { - s32 tv_sec; - s32 tv_nsec; -}; - extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval); -asmlinkage int sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct timespec32 *interval) +asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, + struct compat_timespec *interval) { struct timespec t; int ret; @@ -1796,28 +1700,6 @@ asmlinkage int sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct timespec return ret; } -extern asmlinkage int sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp); - -asmlinkage int sys32_nanosleep(struct timespec32 *rqtp, struct timespec32 *rmtp) -{ - struct timespec t; - int ret; - mm_segment_t old_fs = get_fs (); - - if (get_user (t.tv_sec, &rqtp->tv_sec) || - __get_user (t.tv_nsec, &rqtp->tv_nsec)) - return -EFAULT; - set_fs (KERNEL_DS); - ret = sys_nanosleep(&t, rmtp ? &t : NULL); - set_fs (old_fs); - if (rmtp && ret == -EINTR) { - if (__put_user (t.tv_sec, &rmtp->tv_sec) || - __put_user (t.tv_nsec, &rmtp->tv_nsec)) - return -EFAULT; - } - return ret; -} - extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set, old_sigset_t *oset); asmlinkage int sys32_sigprocmask(int how, old_sigset_t32 *set, old_sigset_t32 *oset) @@ -1837,7 +1719,7 @@ asmlinkage int sys32_sigprocmask(int how, old_sigset_t32 *set, old_sigset_t32 *o extern asmlinkage int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize); -asmlinkage int sys32_rt_sigprocmask(int how, sigset_t32 *set, sigset_t32 *oset, __kernel_size_t32 sigsetsize) +asmlinkage int sys32_rt_sigprocmask(int how, sigset_t32 *set, sigset_t32 *oset, compat_size_t sigsetsize) { sigset_t s; sigset_t32 s32; @@ -1888,7 +1770,7 @@ asmlinkage int sys32_sigpending(old_sigset_t32 *set) extern asmlinkage int sys_rt_sigpending(sigset_t *set, size_t sigsetsize); -asmlinkage int sys32_rt_sigpending(sigset_t32 *set, __kernel_size_t32 sigsetsize) +asmlinkage int sys32_rt_sigpending(sigset_t32 *set, compat_size_t sigsetsize) { sigset_t s; sigset_t32 s32; @@ -1916,7 +1798,7 @@ copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from); asmlinkage int sys32_rt_sigtimedwait(sigset_t32 *uthese, siginfo_t32 *uinfo, - struct timespec32 *uts, __kernel_size_t32 sigsetsize) + struct compat_timespec *uts, compat_size_t sigsetsize) { int ret, sig; sigset_t these; @@ -2015,36 +1897,6 @@ sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo) return ret; } -struct tms32 { - __kernel_clock_t32 tms_utime; - __kernel_clock_t32 tms_stime; - __kernel_clock_t32 tms_cutime; - __kernel_clock_t32 tms_cstime; -}; - -extern asmlinkage long sys_times(struct tms * tbuf); - -asmlinkage long sys32_times(struct tms32 *tbuf) -{ - struct tms t; - long ret; - mm_segment_t old_fs = get_fs (); - int err; - - set_fs (KERNEL_DS); - ret = sys_times(tbuf ? &t : NULL); - set_fs (old_fs); - if (tbuf) { - err = put_user (t.tms_utime, &tbuf->tms_utime); - err |= __put_user (t.tms_stime, &tbuf->tms_stime); - err |= __put_user (t.tms_cutime, &tbuf->tms_cutime); - err |= __put_user (t.tms_cstime, &tbuf->tms_cstime); - if (err) - ret = -EFAULT; - } - return ret; -} - #define RLIM_OLD_INFINITY32 0x7fffffff #define RLIM_INFINITY32 0xffffffff #define RESOURCE32_OLD(x) ((x > RLIM_OLD_INFINITY32) ? RLIM_OLD_INFINITY32 : x) @@ -2136,14 +1988,14 @@ struct msghdr32 { u32 msg_name; int msg_namelen; u32 msg_iov; - __kernel_size_t32 msg_iovlen; + compat_size_t msg_iovlen; u32 msg_control; - __kernel_size_t32 msg_controllen; + compat_size_t msg_controllen; unsigned msg_flags; }; struct cmsghdr32 { - __kernel_size_t32 cmsg_len; + compat_size_t cmsg_len; int cmsg_level; int cmsg_type; }; @@ -2277,7 +2129,7 @@ static int cmsghdr_from_user32_to_kern(struct msghdr *kmsg, { struct cmsghdr32 *ucmsg; struct cmsghdr *kcmsg, *kcmsg_base; - __kernel_size_t32 ucmlen; + compat_size_t ucmlen; __kernel_size_t kcmlen, tmp; kcmlen = 0; @@ -2498,12 +2350,12 @@ static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_up * from 64-bit time values to 32-bit time values */ case SO_TIMESTAMP: { - __kernel_time_t32* ptr_time32 = CMSG32_DATA(kcmsg32); + compat_time_t* ptr_time32 = CMSG32_DATA(kcmsg32); __kernel_time_t* ptr_time = CMSG_DATA(ucmsg); get_user(*ptr_time32, ptr_time); get_user(*(ptr_time32+1), ptr_time+1); kcmsg32->cmsg_len -= 2*(sizeof(__kernel_time_t) - - sizeof(__kernel_time_t32)); + sizeof(compat_time_t)); } default:; } @@ -2746,7 +2598,7 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags) err = __put_user(msg_sys.msg_flags, &msg->msg_flags); if (err) goto out_freeiov; - err = __put_user((__kernel_size_t32) ((unsigned long)msg_sys.msg_control - cmsg_ptr), &msg->msg_controllen); + err = __put_user((compat_size_t) ((unsigned long)msg_sys.msg_control - cmsg_ptr), &msg->msg_controllen); if (err) goto out_freeiov; err = len; @@ -2848,7 +2700,7 @@ asmlinkage int sys32_setsockopt(int fd, int level, int optname, struct timeval tmp; mm_segment_t old_fs; - if (get_tv32(&tmp, (struct timeval32 *)optval )) + if (get_tv32(&tmp, (struct compat_timeval *)optval )) return -EFAULT; old_fs = get_fs(); set_fs(KERNEL_DS); @@ -3126,7 +2978,7 @@ static __inline__ struct module *find_module(const char *name) } static int -qm_modules(char *buf, size_t bufsize, __kernel_size_t32 *ret) +qm_modules(char *buf, size_t bufsize, compat_size_t *ret) { struct module *mod; size_t nmod, space, len; @@ -3161,7 +3013,7 @@ calc_space_needed: } static int -qm_deps(struct module *mod, char *buf, size_t bufsize, __kernel_size_t32 *ret) +qm_deps(struct module *mod, char *buf, size_t bufsize, compat_size_t *ret) { size_t i, space, len; @@ -3198,7 +3050,7 @@ calc_space_needed: } static int -qm_refs(struct module *mod, char *buf, size_t bufsize, __kernel_size_t32 *ret) +qm_refs(struct module *mod, char *buf, size_t bufsize, compat_size_t *ret) { size_t nrefs, space, len; struct module_ref *ref; @@ -3242,7 +3094,7 @@ calc_space_needed: } static inline int -qm_symbols(struct module *mod, char *buf, size_t bufsize, __kernel_size_t32 *ret) +qm_symbols(struct module *mod, char *buf, size_t bufsize, compat_size_t *ret) { size_t i, space, len; struct module_symbol *s; @@ -3301,7 +3153,7 @@ calc_space_needed: } static inline int -qm_info(struct module *mod, char *buf, size_t bufsize, __kernel_size_t32 *ret) +qm_info(struct module *mod, char *buf, size_t bufsize, compat_size_t *ret) { int error = 0; @@ -3368,27 +3220,27 @@ struct nfsctl_client32 { struct nfsctl_export32 { s8 ex32_client[NFSCLNT_IDMAX+1]; s8 ex32_path[NFS_MAXPATHLEN+1]; - __kernel_dev_t32 ex32_dev; - __kernel_ino_t32 ex32_ino; + compat_dev_t ex32_dev; + compat_ino_t ex32_ino; s32 ex32_flags; - __kernel_uid_t32 ex32_anon_uid; - __kernel_gid_t32 ex32_anon_gid; + compat_uid_t ex32_anon_uid; + compat_gid_t ex32_anon_gid; }; struct nfsctl_uidmap32 { u32 ug32_ident; /* char * */ - __kernel_uid_t32 ug32_uidbase; + compat_uid_t ug32_uidbase; s32 ug32_uidlen; u32 ug32_udimap; /* uid_t * */ - __kernel_uid_t32 ug32_gidbase; + compat_uid_t ug32_gidbase; s32 ug32_gidlen; u32 ug32_gdimap; /* gid_t * */ }; struct nfsctl_fhparm32 { struct sockaddr gf32_addr; - __kernel_dev_t32 gf32_dev; - __kernel_ino_t32 gf32_ino; + compat_dev_t gf32_dev; + compat_ino_t gf32_ino; s32 gf32_version; }; @@ -3517,7 +3369,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) return -ENOMEM; for(i = 0; i < karg->ca_umap.ug_uidlen; i++) err |= __get_user(karg->ca_umap.ug_udimap[i], - &(((__kernel_uid_t32 *)A(uaddr))[i])); + &(((compat_uid_t *)A(uaddr))[i])); err |= __get_user(karg->ca_umap.ug_gidbase, &arg32->ca32_umap.ug32_gidbase); err |= __get_user(karg->ca_umap.ug_uidlen, @@ -3531,7 +3383,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) return -ENOMEM; for(i = 0; i < karg->ca_umap.ug_gidlen; i++) err |= __get_user(karg->ca_umap.ug_gdimap[i], - &(((__kernel_gid_t32 *)A(uaddr))[i])); + &(((compat_gid_t *)A(uaddr))[i])); return err; } @@ -3683,7 +3535,7 @@ done: extern struct timezone sys_tz; extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz); -asmlinkage int sys32_gettimeofday(struct timeval32 *tv, struct timezone *tz) +asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz) { if (tv) { struct timeval ktv; @@ -3698,7 +3550,7 @@ asmlinkage int sys32_gettimeofday(struct timeval32 *tv, struct timezone *tz) return 0; } -asmlinkage int sys32_settimeofday(struct timeval32 *tv, struct timezone *tz) +asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz) { struct timeval ktv; struct timezone ktz; @@ -3715,46 +3567,9 @@ asmlinkage int sys32_settimeofday(struct timeval32 *tv, struct timezone *tz) return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL); } -extern int do_getitimer(int which, struct itimerval *value); - -asmlinkage int sys32_getitimer(int which, struct itimerval32 *it) -{ - struct itimerval kit; - int error; - - error = do_getitimer(which, &kit); - if (!error && put_it32(it, &kit)) - error = -EFAULT; - - return error; -} - -extern int do_setitimer(int which, struct itimerval *, struct itimerval *); - -asmlinkage int sys32_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out) -{ - struct itimerval kin, kout; - int error; - - if (in) { - if (get_it32(&kin, in)) - return -EFAULT; - } else - memset(&kin, 0, sizeof(kin)); - - error = do_setitimer(which, &kin, out ? &kout : NULL); - if (error || !out) - return error; - if (put_it32(out, &kout)) - return -EFAULT; - - return 0; - -} - asmlinkage int sys_utimes(char *, struct timeval *); -asmlinkage int sys32_utimes(char *filename, struct timeval32 *tvs) +asmlinkage int sys32_utimes(char *filename, struct compat_timeval *tvs) { char *kfilename; struct timeval ktvs[2]; @@ -3807,34 +3622,32 @@ extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf, extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf, size_t count, loff_t pos); -typedef __kernel_ssize_t32 ssize_t32; - -asmlinkage ssize_t32 sys32_pread64(unsigned int fd, char *ubuf, - __kernel_size_t32 count, u32 poshi, u32 poslo) +asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, char *ubuf, + compat_size_t count, u32 poshi, u32 poslo) { - if ((ssize_t32) count < 0) + if ((compat_ssize_t) count < 0) return -EINVAL; return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); } -asmlinkage ssize_t32 sys32_pwrite64(unsigned int fd, char *ubuf, - __kernel_size_t32 count, u32 poshi, u32 poslo) +asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd, char *ubuf, + compat_size_t count, u32 poshi, u32 poslo) { - if ((ssize_t32) count < 0) + if ((compat_ssize_t) count < 0) return -EINVAL; return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); } extern asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count); -asmlinkage ssize_t32 sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count) +asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count) { return sys_readahead(fd, ((loff_t)AA(offhi) << 32) | AA(offlo), count); } extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count); -asmlinkage int sys32_sendfile(int out_fd, int in_fd, __kernel_off_t32 *offset, s32 count) +asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count) { mm_segment_t old_fs = get_fs(); int ret; @@ -3857,7 +3670,7 @@ extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count); asmlinkage int sys32_sendfile64(int out_fd, int in_fd, - __kernel_loff_t32 *offset, s32 count) + compat_loff_t *offset, s32 count) { mm_segment_t old_fs = get_fs(); int ret; @@ -3882,7 +3695,7 @@ struct timex32 { u32 modes; s32 offset, freq, maxerror, esterror; s32 status, constant, precision, tolerance; - struct timeval32 time; + struct compat_timeval time; s32 tick; s32 ppsfreq, jitter, shift, stabil; s32 jitcnt, calcnt, errcnt, stbcnt; @@ -4301,7 +4114,7 @@ asmlinkage long sys32_socketcall(int call, u32 *args) extern asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len, unsigned long *user_mask_ptr); -asmlinkage int sys32_sched_setaffinity(__kernel_pid_t32 pid, unsigned int len, +asmlinkage int sys32_sched_setaffinity(compat_pid_t pid, unsigned int len, u32 *user_mask_ptr) { unsigned long kernel_mask; @@ -4325,7 +4138,7 @@ asmlinkage int sys32_sched_setaffinity(__kernel_pid_t32 pid, unsigned int len, extern asmlinkage int sys_sched_getaffinity(pid_t pid, unsigned int len, unsigned long *user_mask_ptr); -asmlinkage int sys32_sched_getaffinity(__kernel_pid_t32 pid, unsigned int len, +asmlinkage int sys32_sched_getaffinity(compat_pid_t pid, unsigned int len, u32 *user_mask_ptr) { unsigned long kernel_mask; @@ -4353,7 +4166,7 @@ sys_futex(void *uaddr, int op, int val, struct timespec *utime); asmlinkage int sys32_futex(void *uaddr, int op, int val, - struct timespec32 *timeout32) + struct compat_timespec *timeout32) { struct timespec tmp; mm_segment_t old_fs; @@ -4373,9 +4186,9 @@ sys32_futex(void *uaddr, int op, int val, asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count); -asmlinkage ssize_t32 sys32_read(unsigned int fd, char * buf, size_t count) +asmlinkage compat_ssize_t sys32_read(unsigned int fd, char * buf, size_t count) { - if ((ssize_t32) count < 0) + if ((compat_ssize_t) count < 0) return -EINVAL; return sys_read(fd, buf, count); @@ -4383,9 +4196,9 @@ asmlinkage ssize_t32 sys32_read(unsigned int fd, char * buf, size_t count) asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count); -asmlinkage ssize_t32 sys32_write(unsigned int fd, char * buf, size_t count) +asmlinkage compat_ssize_t sys32_write(unsigned int fd, char * buf, size_t count) { - if ((ssize_t32) count < 0) + if ((compat_ssize_t) count < 0) return -EINVAL; return sys_write(fd, buf, count); diff --git a/arch/s390x/kernel/linux32.h b/arch/s390x/kernel/linux32.h index d3c08cdef45b..94fdd15c7560 100644 --- a/arch/s390x/kernel/linux32.h +++ b/arch/s390x/kernel/linux32.h @@ -2,6 +2,7 @@ #define _ASM_S390X_S390_H #include <linux/config.h> +#include <linux/compat.h> #include <linux/socket.h> #include <linux/nfs_fs.h> #include <linux/sunrpc/svc.h> @@ -15,26 +16,6 @@ ((unsigned long)(__x)) /* Now 32bit compatibility types */ -typedef unsigned int __kernel_size_t32; -typedef int __kernel_ssize_t32; -typedef int __kernel_ptrdiff_t32; -typedef int __kernel_time_t32; -typedef int __kernel_clock_t32; -typedef int __kernel_pid_t32; -typedef unsigned short __kernel_ipc_pid_t32; -typedef unsigned short __kernel_uid_t32; -typedef unsigned short __kernel_gid_t32; -typedef unsigned short __kernel_dev_t32; -typedef unsigned int __kernel_ino_t32; -typedef unsigned short __kernel_mode_t32; -typedef unsigned short __kernel_umode_t32; -typedef short __kernel_nlink_t32; -typedef int __kernel_daddr_t32; -typedef int __kernel_off_t32; -typedef unsigned int __kernel_caddr_t32; -typedef long __kernel_loff_t32; -typedef __kernel_fsid_t __kernel_fsid_t32; - struct ipc_kludge_32 { __u32 msgp; /* pointer */ __s32 msgtyp; @@ -47,35 +28,12 @@ struct ipc_kludge_32 { struct flock32 { short l_type; short l_whence; - __kernel_off_t32 l_start; - __kernel_off_t32 l_len; - __kernel_pid_t32 l_pid; + compat_off_t l_start; + compat_off_t l_len; + compat_pid_t l_pid; short __unused; }; -struct stat32 { - unsigned short st_dev; - unsigned short __pad1; - __u32 st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned short __pad2; - __u32 st_size; - __u32 st_blksize; - __u32 st_blocks; - __u32 st_atime; - __u32 __unused1; - __u32 st_mtime; - __u32 __unused2; - __u32 st_ctime; - __u32 __unused3; - __u32 __unused4; - __u32 __unused5; -}; - struct statfs32 { __s32 f_type; __s32 f_bsize; @@ -141,8 +99,8 @@ typedef struct siginfo32 { pid_t _pid; /* which child */ uid_t _uid; /* sender's uid */ int _status;/* exit code */ - __kernel_clock_t32 _utime; - __kernel_clock_t32 _stime; + compat_clock_t _utime; + compat_clock_t _stime; } _sigchld; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ @@ -253,7 +211,7 @@ struct sigaction32 { typedef struct { __u32 ss_sp; /* pointer */ int ss_flags; - __kernel_size_t32 ss_size; + compat_size_t ss_size; } stack_t32; /* asm/ucontext.h */ diff --git a/arch/s390x/kernel/wrapper32.S b/arch/s390x/kernel/wrapper32.S index 857197668e82..380d13fe4096 100644 --- a/arch/s390x/kernel/wrapper32.S +++ b/arch/s390x/kernel/wrapper32.S @@ -130,11 +130,11 @@ sys32_alarm_wrapper: #sys32_pause_wrapper # void - .globl sys32_utime_wrapper -sys32_utime_wrapper: + .globl compat_sys_utime_wrapper +compat_sys_utime_wrapper: llgtr %r2,%r2 # char * - llgtr %r3,%r3 # struct utimbuf_emu31 * - jg sys32_utime # branch to system call + llgtr %r3,%r3 # struct compat_utimbuf * + jg compat_sys_utime # branch to system call .globl sys32_access_wrapper sys32_access_wrapper: @@ -182,10 +182,10 @@ sys32_pipe_wrapper: llgtr %r2,%r2 # u32 * jg sys_pipe # branch to system call - .globl sys32_times_wrapper -sys32_times_wrapper: - llgtr %r2,%r2 # struct tms_emu31 * - jg sys32_times # branch to system call + .globl compat_sys_times_wrapper +compat_sys_times_wrapper: + llgtr %r2,%r2 # struct compat_tms * + jg compat_sys_times # branch to system call .globl sys32_brk_wrapper sys32_brk_wrapper: @@ -465,36 +465,36 @@ sys32_syslog_wrapper: lgfr %r4,%r4 # int jg sys_syslog # branch to system call - .globl sys32_setitimer_wrapper -sys32_setitimer_wrapper: + .globl compat_sys_setitimer_wrapper +compat_sys_setitimer_wrapper: lgfr %r2,%r2 # int llgtr %r3,%r3 # struct itimerval_emu31 * llgtr %r4,%r4 # struct itimerval_emu31 * - jg sys32_setitimer # branch to system call + jg compat_sys_setitimer # branch to system call - .globl sys32_getitimer_wrapper -sys32_getitimer_wrapper: + .globl compat_sys_getitimer_wrapper +compat_sys_getitimer_wrapper: lgfr %r2,%r2 # int llgtr %r3,%r3 # struct itimerval_emu31 * - jg sys32_getitimer # branch to system call + jg compat_sys_getitimer # branch to system call - .globl sys32_newstat_wrapper -sys32_newstat_wrapper: + .globl compat_sys_newstat_wrapper +compat_sys_newstat_wrapper: llgtr %r2,%r2 # char * llgtr %r3,%r3 # struct stat_emu31 * - jg sys32_newstat # branch to system call + jg compat_sys_newstat # branch to system call - .globl sys32_newlstat_wrapper -sys32_newlstat_wrapper: + .globl compat_sys_newlstat_wrapper +compat_sys_newlstat_wrapper: llgtr %r2,%r2 # char * llgtr %r3,%r3 # struct stat_emu31 * - jg sys32_newlstat # branch to system call + jg compat_sys_newlstat # branch to system call - .globl sys32_newfstat_wrapper -sys32_newfstat_wrapper: + .globl compat_sys_newfstat_wrapper +compat_sys_newfstat_wrapper: llgfr %r2,%r2 # unsigned int llgtr %r3,%r3 # struct stat_emu31 * - jg sys32_newfstat # branch to system call + jg compat_sys_newfstat # branch to system call #sys32_vhangup_wrapper # void @@ -743,14 +743,14 @@ sys32_sched_get_priority_min_wrapper: .globl sys32_sched_rr_get_interval_wrapper sys32_sched_rr_get_interval_wrapper: lgfr %r2,%r2 # pid_t - llgtr %r3,%r3 # struct timespec_emu31 * + llgtr %r3,%r3 # struct compat_timespec * jg sys32_sched_rr_get_interval # branch to system call - .globl sys32_nanosleep_wrapper -sys32_nanosleep_wrapper: - llgtr %r2,%r2 # struct timespec_emu31 * - llgtr %r3,%r3 # struct timespec_emu31 * - jg sys32_nanosleep # branch to system call + .globl compat_sys_nanosleep_wrapper +compat_sys_nanosleep_wrapper: + llgtr %r2,%r2 # struct compat_timespec * + llgtr %r3,%r3 # struct compat_timespec * + jg compat_sys_nanosleep # branch to system call .globl sys32_mremap_wrapper sys32_mremap_wrapper: @@ -839,7 +839,7 @@ sys32_rt_sigpending_wrapper: sys32_rt_sigtimedwait_wrapper: llgtr %r2,%r2 # const sigset_emu31_t * llgtr %r3,%r3 # siginfo_emu31_t * - llgtr %r4,%r4 # const struct timespec_emu31 * + llgtr %r4,%r4 # const struct compat_timespec * llgfr %r5,%r5 # size_t jg sys32_rt_sigtimedwait # branch to system call diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile index a0a4985e614b..32ef5188df77 100644 --- a/arch/sparc64/Makefile +++ b/arch/sparc64/Makefile @@ -71,11 +71,11 @@ libs-y += arch/sparc64/prom/ arch/sparc64/lib/ # FIXME: is drivers- right? drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/ -makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/sparc64/boot $(1) - tftpboot.img vmlinux.aout: - $(call makeboot,arch/sparc64/boot/$@) - -archmrproper: -archclean: + $(Q)$(MAKE) $(build)=arch/sparc64/boot arch/sparc64/boot/$@ +define archhelp + echo '* vmlinux - Standard sparc64 kernel' + echo ' vmlinux.aout - a.out kernel for sparc64' + echo ' tftpboot.img - Image prepared for tftp' +endef diff --git a/arch/sparc64/boot/Makefile b/arch/sparc64/boot/Makefile index 6a4a74781edc..51dcc7d12ab0 100644 --- a/arch/sparc64/boot/Makefile +++ b/arch/sparc64/boot/Makefile @@ -24,7 +24,3 @@ $(obj)/vmlinux.aout: vmlinux FORCE $(call if_changed,elftoaout) @echo ' kernel: $@ is ready' -archhelp: - @echo '* vmlinux - Standard sparc64 kernel' - @echo ' vmlinux.aout - a.out kernel for sparc64' - @echo ' tftpboot.img - Image prepared for tftp' diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 45fabd1e471e..85b280253c26 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -185,7 +185,7 @@ int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, * This function may be called from IRQ context. */ -void inline disable_irq_nosync(unsigned int irq) +inline void disable_irq_nosync(unsigned int irq) { irq_desc_t *desc = irq_desc + irq; unsigned long flags; diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index 05f428f6a8cf..cf3e9b86d1b8 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile @@ -57,32 +57,30 @@ drivers-$(CONFIG_PCI) += arch/x86_64/pci/ # FIXME: is drivers- right ? drivers-$(CONFIG_OPROFILE) += arch/x86_64/oprofile/ -makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/x86_64/boot $(1) +boot := arch/x86_64/boot .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ - clean archclean archmrproper + archclean BOOTIMAGE=arch/x86_64/boot/bzImage zImage zlilo zdisk: BOOTIMAGE=arch/x86_64/boot/zImage zImage bzImage: vmlinux - $(call makeboot,$(BOOTIMAGE)) + $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) compressed: zImage zlilo bzlilo: vmlinux - $(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zlilo) + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo zdisk bzdisk: vmlinux - $(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zdisk) + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk install: vmlinux - $(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install) + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) install archclean: - $(call makeboot,clean) - -archmrproper: + $(Q)$(MAKE) $(clean)=$(boot) prepare: include/asm-$(ARCH)/offset.h @@ -97,4 +95,12 @@ include/asm-$(ARCH)/offset.h: include/asm-$(ARCH)/offset.h.tmp @$(update-if-changed) CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \ - include/asm-$(ARCH)/offset.h
\ No newline at end of file + include/asm-$(ARCH)/offset.h + +define archhelp + echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' + echo ' install - Install kernel using' + echo ' (your) ~/bin/installkernel or' + echo ' (distribution) /sbin/installkernel or' + echo ' install to $$(INSTALL_PATH) and run lilo' +endef diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile index 2d234181b61b..89eff91ba573 100644 --- a/arch/x86_64/boot/Makefile +++ b/arch/x86_64/boot/Makefile @@ -31,7 +31,7 @@ EXTRA_TARGETS := vmlinux.bin bootsect bootsect.o \ CFLAGS += -m32 host-progs := tools/build - +subdir- := compressed #Let make clean descend in compressed/ # --------------------------------------------------------------------------- $(obj)/zImage: IMAGE_OFFSET := 0x1000 @@ -59,8 +59,7 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE $(call if_changed,ld) $(obj)/compressed/vmlinux: FORCE - $(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed \ - IMAGE_OFFSET=$(IMAGE_OFFSET) $@ + $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ zdisk: $(BOOTIMAGE) dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0 @@ -74,16 +73,3 @@ zlilo: $(BOOTIMAGE) install: $(BOOTIMAGE) sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" - -clean: - @echo 'Cleaning up (boot)' - @rm -f $(host-progs) $(EXTRA_TARGETS) - +@$(call descend,$(obj)/compressed) clean - -archhelp: - @echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' - @echo ' install - Install kernel using' - @echo ' (your) ~/bin/installkernel or' - @echo ' (distribution) /sbin/installkernel or' - @echo ' install to $$(INSTALL_PATH) and run lilo' - diff --git a/arch/x86_64/boot/compressed/Makefile b/arch/x86_64/boot/compressed/Makefile index 8fd54bab42a6..d182ac81f8e0 100644 --- a/arch/x86_64/boot/compressed/Makefile +++ b/arch/x86_64/boot/compressed/Makefile @@ -30,7 +30,3 @@ LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE $(call if_changed,ld) - -clean: - @echo 'Cleaning up (boot/compressed)' - @rm -f $(EXTRA_TARGETS) diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c index 6266c936c135..816c40f9308f 100644 --- a/arch/x86_64/kernel/smp.c +++ b/arch/x86_64/kernel/smp.c @@ -142,7 +142,7 @@ static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED; * We cannot call mmdrop() because we are in interrupt context, * instead update mm->cpu_vm_mask. */ -static void inline leave_mm (unsigned long cpu) +static inline void leave_mm (unsigned long cpu) { if (read_pda(mmu_state) == TLBSTATE_OK) BUG(); diff --git a/crypto/blowfish.c b/crypto/blowfish.c index 54e98a86b248..f7f5eb756a12 100644 --- a/crypto/blowfish.c +++ b/crypto/blowfish.c @@ -31,7 +31,7 @@ struct bf_ctx { u32 s[1024]; }; -const static u32 bf_pbox[16 + 2] = { +static const u32 bf_pbox[16 + 2] = { 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, @@ -39,7 +39,7 @@ const static u32 bf_pbox[16 + 2] = { 0x9216d5d9, 0x8979fb1b, }; -const static u32 bf_sbox[256 * 4] = { +static const u32 bf_sbox[256 * 4] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, diff --git a/crypto/des.c b/crypto/des.c index ed85916730b0..08ca675c24f7 100644 --- a/crypto/des.c +++ b/crypto/des.c @@ -46,7 +46,7 @@ struct des3_ede_ctx { u32 expkey[DES3_EDE_EXPKEY_WORDS]; }; -const static u32 des_keymap[] = { +static const u32 des_keymap[] = { 0x02080008, 0x02082000, 0x00002008, 0x00000000, 0x02002000, 0x00080008, 0x02080000, 0x02082008, 0x00000008, 0x02000000, 0x00082000, 0x00002008, @@ -184,7 +184,7 @@ const static u32 des_keymap[] = { 0x20000000, 0x20208000, 0x00000080, 0x20008080, }; -const static u8 rotors[] = { +static const u8 rotors[] = { 34, 13, 5, 46, 47, 18, 32, 41, 11, 53, 33, 20, 14, 36, 30, 24, 49, 2, 15, 37, 42, 50, 0, 21, 38, 48, 6, 26, 39, 4, 52, 25, 12, 27, 31, 40, @@ -266,7 +266,7 @@ const static u8 rotors[] = { 49, 10, 21, 22, 16, 44, 28, 0, 51, 15, 2, 36, }; -const static u8 parity[] = { +static const u8 parity[] = { 8,1,0,8,0,8,8,0,0,8,8,0,8,0,2,8,0,8,8,0,8,0,0,8,8,0,0,8,0,8,8,3, 0,8,8,0,8,0,0,8,8,0,0,8,0,8,8,0,8,0,0,8,0,8,8,0,0,8,8,0,8,0,0,8, 0,8,8,0,8,0,0,8,8,0,0,8,0,8,8,0,8,0,0,8,0,8,8,0,0,8,8,0,8,0,0,8, diff --git a/crypto/sha1.c b/crypto/sha1.c index f3a56d838ea4..012d872d4477 100644 --- a/crypto/sha1.c +++ b/crypto/sha1.c @@ -107,7 +107,7 @@ static void sha1_transform(u32 *state, const u8 *in) static void sha1_init(void *ctx) { struct sha1_ctx *sctx = ctx; - const static struct sha1_ctx initstate = { + static const struct sha1_ctx initstate = { 0, { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }, { 0, } @@ -144,7 +144,7 @@ static void sha1_final(void* ctx, u8 *out) u32 i, j, index, padlen; u64 t; u8 bits[8] = { 0, }; - const static u8 padding[64] = { 0x80, }; + static const u8 padding[64] = { 0x80, }; t = sctx->count; bits[7] = 0xff & t; t>>=8; diff --git a/drivers/acpi/include/acpiosxf.h b/drivers/acpi/include/acpiosxf.h index 2326fda0e434..2bf4e3f0e9a4 100644 --- a/drivers/acpi/include/acpiosxf.h +++ b/drivers/acpi/include/acpiosxf.h @@ -235,14 +235,14 @@ acpi_os_write_memory ( acpi_status acpi_os_read_pci_configuration ( acpi_pci_id *pci_id, - u32 register, + u32 reg, void *value, u32 width); acpi_status acpi_os_write_pci_configuration ( acpi_pci_id *pci_id, - u32 register, + u32 reg, acpi_integer value, u32 width); diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c index cf9a687b24d2..b42342634205 100644 --- a/drivers/cdrom/sonycd535.c +++ b/drivers/cdrom/sonycd535.c @@ -1657,8 +1657,8 @@ __setup("sonycd535=", sonycd535_setup); #endif /* MODULE */ -void __exit -static sony535_exit(void) +static void __exit +sony535_exit(void) { int i; diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig index c7174f4d93ea..b27355fe0135 100644 --- a/drivers/char/agp/Kconfig +++ b/drivers/char/agp/Kconfig @@ -31,6 +31,7 @@ config AGP_GART config AGP3 bool "AGP 3.0 compliance (EXPERIMENTAL)" + depends on AGP config AGP_INTEL tristate "Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support" diff --git a/drivers/char/agp/amd-k8-agp.c b/drivers/char/agp/amd-k8-agp.c index b5512012e086..f7a2a3f81d0b 100644 --- a/drivers/char/agp/amd-k8-agp.c +++ b/drivers/char/agp/amd-k8-agp.c @@ -15,7 +15,6 @@ #include "agp.h" extern int agp_memory_reserved; -extern __u32 *agp_gatt_table; static u_int64_t pci_read64 (struct pci_dev *dev, int reg) { @@ -521,6 +520,8 @@ static int __init agp_amdk8_init(void) if (ret_val) agp_bridge.type = NOT_SUPPORTED; + agp_bridge.type = AMD_8151; + return ret_val; } diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index 929737e336ce..a901a2af7cdb 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c @@ -49,13 +49,10 @@ int agp_backend_acquire(void) if (agp_bridge.type == NOT_SUPPORTED) return -EINVAL; - atomic_inc(&agp_bridge.agp_in_use); - - if (atomic_read(&agp_bridge.agp_in_use) != 1) { - atomic_dec(&agp_bridge.agp_in_use); + if (atomic_read(&agp_bridge.agp_in_use) != 0) return -EBUSY; - } - MOD_INC_USE_COUNT; + + atomic_inc(&agp_bridge.agp_in_use); return 0; } @@ -65,7 +62,6 @@ void agp_backend_release(void) return; atomic_dec(&agp_bridge.agp_in_use); - MOD_DEC_USE_COUNT; } struct agp_max_table { @@ -73,7 +69,7 @@ struct agp_max_table { int agp; }; -static struct agp_max_table maxes_table[9] __initdata = +static struct agp_max_table maxes_table[9] = { {0, 0}, {32, 4}, @@ -86,7 +82,7 @@ static struct agp_max_table maxes_table[9] __initdata = {4096, 3932} }; -static int __init agp_find_max (void) +static int agp_find_max (void) { long memory, index, result; diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index c332db2887aa..46f7d16c9f65 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c @@ -43,15 +43,14 @@ static agp_memory *agp_find_mem_by_key(int key) { agp_memory *curr; - if (agp_fe.current_controller == NULL) { + if (agp_fe.current_controller == NULL) return NULL; - } + curr = agp_fe.current_controller->pool; while (curr != NULL) { - if (curr->key == key) { + if (curr->key == key) return curr; - } curr = curr->next; } @@ -71,14 +70,14 @@ static void agp_remove_from_pool(agp_memory * temp) if (prev != NULL) { prev->next = next; - if (next != NULL) { + if (next != NULL) next->prev = prev; - } + } else { /* This is the first item on the list */ - if (next != NULL) { + if (next != NULL) next->prev = NULL; - } + agp_fe.current_controller->pool = next; } } @@ -116,9 +115,8 @@ static agp_segment_priv *agp_find_seg_in_client(const agp_client * client, static void agp_remove_seg_from_client(agp_client * client) { if (client->segments != NULL) { - if (*(client->segments) != NULL) { + if (*(client->segments) != NULL) kfree(*(client->segments)); - } kfree(client->segments); } } @@ -130,9 +128,9 @@ static void agp_add_seg_to_client(agp_client * client, prev_seg = client->segments; - if (prev_seg != NULL) { + if (prev_seg != NULL) agp_remove_seg_from_client(client); - } + client->num_segments = num_segments; client->segments = seg; } @@ -175,8 +173,7 @@ static int agp_create_segment(agp_client * client, agp_region * region) agp_segment *user_seg; int i; - seg = kmalloc((sizeof(agp_segment_priv) * region->seg_count), - GFP_KERNEL); + seg = kmalloc((sizeof(agp_segment_priv) * region->seg_count), GFP_KERNEL); if (seg == NULL) { kfree(region->seg_list); return -ENOMEM; @@ -227,9 +224,8 @@ agp_file_private *agp_find_private(pid_t pid) curr = agp_fe.file_priv_list; while (curr != NULL) { - if (curr->my_pid == pid) { + if (curr->my_pid == pid) return curr; - } curr = curr->next; } @@ -242,9 +238,8 @@ void agp_insert_file_private(agp_file_private * priv) prev = agp_fe.file_priv_list; - if (prev != NULL) { + if (prev != NULL) prev->prev = priv; - } priv->next = prev; agp_fe.file_priv_list = priv; } @@ -260,13 +255,13 @@ void agp_remove_file_private(agp_file_private * priv) if (prev != NULL) { prev->next = next; - if (next != NULL) { + if (next != NULL) next->prev = prev; - } + } else { - if (next != NULL) { + if (next != NULL) next->prev = NULL; - } + agp_fe.file_priv_list = next; } } @@ -289,9 +284,9 @@ static agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type) memory = agp_allocate_memory(pg_count, type); printk(KERN_DEBUG "agp_allocate_memory: %p\n", memory); - if (memory == NULL) { + if (memory == NULL) return NULL; - } + agp_insert_into_pool(memory); return memory; } @@ -308,9 +303,8 @@ static agp_controller *agp_find_controller_by_pid(pid_t id) controller = agp_fe.controllers; while (controller != NULL) { - if (controller->pid == id) { + if (controller->pid == id) return controller; - } controller = controller->next; } @@ -323,9 +317,9 @@ static agp_controller *agp_create_controller(pid_t id) controller = kmalloc(sizeof(agp_controller), GFP_KERNEL); - if (controller == NULL) { + if (controller == NULL) return NULL; - } + memset(controller, 0, sizeof(agp_controller)); controller->pid = id; @@ -339,9 +333,9 @@ static int agp_insert_controller(agp_controller * controller) prev_controller = agp_fe.controllers; controller->next = prev_controller; - if (prev_controller != NULL) { + if (prev_controller != NULL) prev_controller->prev = controller; - } + agp_fe.controllers = controller; return 0; @@ -394,13 +388,13 @@ static int agp_remove_controller(agp_controller * controller) if (prev_controller != NULL) { prev_controller->next = next_controller; - if (next_controller != NULL) { + if (next_controller != NULL) next_controller->prev = prev_controller; - } + } else { - if (next_controller != NULL) { + if (next_controller != NULL) next_controller->prev = NULL; - } + agp_fe.controllers = next_controller; } @@ -450,9 +444,9 @@ static void agp_controller_release_current(agp_controller * controller, priv = agp_find_private(clients->pid); - if (priv != NULL) { + if (priv != NULL) clear_bit(AGP_FF_IS_VALID, &priv->access_flags); - } + clients = clients->next; } @@ -471,15 +465,14 @@ static agp_client *agp_find_client_in_controller(agp_controller * controller, { agp_client *client; - if (controller == NULL) { + if (controller == NULL) return NULL; - } + client = controller->clients; while (client != NULL) { - if (client->pid == id) { + if (client->pid == id) return client; - } client = client->next; } @@ -493,9 +486,8 @@ static agp_controller *agp_find_controller_for_client(pid_t id) controller = agp_fe.controllers; while (controller != NULL) { - if ((agp_find_client_in_controller(controller, id)) != NULL) { + if ((agp_find_client_in_controller(controller, id)) != NULL) return controller; - } controller = controller->next; } @@ -506,9 +498,9 @@ static agp_client *agp_find_client_by_pid(pid_t id) { agp_client *temp; - if (agp_fe.current_controller == NULL) { + if (agp_fe.current_controller == NULL) return NULL; - } + temp = agp_find_client_in_controller(agp_fe.current_controller, id); return temp; } @@ -520,9 +512,9 @@ static void agp_insert_client(agp_client * client) prev_client = agp_fe.current_controller->clients; client->next = prev_client; - if (prev_client != NULL) { + if (prev_client != NULL) prev_client->prev = client; - } + agp_fe.current_controller->clients = client; agp_fe.current_controller->num_clients++; } @@ -533,9 +525,9 @@ static agp_client *agp_create_client(pid_t id) new_client = kmalloc(sizeof(agp_client), GFP_KERNEL); - if (new_client == NULL) { + if (new_client == NULL) return NULL; - } + memset(new_client, 0, sizeof(agp_client)); new_client->pid = id; agp_insert_client(new_client); @@ -550,27 +542,24 @@ static int agp_remove_client(pid_t id) agp_controller *controller; controller = agp_find_controller_for_client(id); - - if (controller == NULL) { + if (controller == NULL) return -EINVAL; - } - client = agp_find_client_in_controller(controller, id); - if (client == NULL) { + client = agp_find_client_in_controller(controller, id); + if (client == NULL) return -EINVAL; - } + prev_client = client->prev; next_client = client->next; if (prev_client != NULL) { prev_client->next = next_client; - if (next_client != NULL) { + if (next_client != NULL) next_client->prev = prev_client; - } + } else { - if (next_client != NULL) { + if (next_client != NULL) next_client->prev = NULL; - } controller->clients = next_client; } @@ -595,14 +584,12 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) AGP_LOCK(); - if (agp_fe.backend_acquired != TRUE) { - AGP_UNLOCK(); - return -EPERM; - } - if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags))) { - AGP_UNLOCK(); - return -EPERM; - } + if (agp_fe.backend_acquired != TRUE) + goto out_eperm; + + if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags))) + goto out_eperm; + agp_copy_info(&kerninfo); size = vma->vm_end - vma->vm_start; current_size = kerninfo.aper_size; @@ -610,45 +597,48 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) offset = vma->vm_pgoff << PAGE_SHIFT; if (test_bit(AGP_FF_IS_CLIENT, &priv->access_flags)) { - if ((size + offset) > current_size) { - AGP_UNLOCK(); - return -EINVAL; - } + if ((size + offset) > current_size) + goto out_inval; + client = agp_find_client_by_pid(current->pid); - if (client == NULL) { - AGP_UNLOCK(); - return -EPERM; - } - if (!agp_find_seg_in_client(client, offset, - size, vma->vm_page_prot)) { - AGP_UNLOCK(); - return -EINVAL; - } - if (remap_page_range(vma, vma->vm_start, - (kerninfo.aper_base + offset), + if (client == NULL) + goto out_eperm; + + if (!agp_find_seg_in_client(client, offset, size, vma->vm_page_prot)) + goto out_inval; + + if (remap_page_range(vma, vma->vm_start, (kerninfo.aper_base + offset), size, vma->vm_page_prot)) { - AGP_UNLOCK(); - return -EAGAIN; + goto out_again; } AGP_UNLOCK(); return 0; } + if (test_bit(AGP_FF_IS_CONTROLLER, &priv->access_flags)) { - if (size != current_size) { - AGP_UNLOCK(); - return -EINVAL; - } + if (size != current_size) + goto out_inval; + if (remap_page_range(vma, vma->vm_start, kerninfo.aper_base, size, vma->vm_page_prot)) { - AGP_UNLOCK(); - return -EAGAIN; + goto out_again; } AGP_UNLOCK(); return 0; } + +out_eperm: AGP_UNLOCK(); return -EPERM; + +out_inval: + AGP_UNLOCK(); + return -EINVAL; + +out_again: + AGP_UNLOCK(); + return -EAGAIN; } static int agp_release(struct inode *inode, struct file *file) @@ -751,26 +741,28 @@ static int agpioc_info_wrap(agp_file_private * priv, unsigned long arg) userinfo.pg_total = userinfo.pg_system = kerninfo.max_memory; userinfo.pg_used = kerninfo.current_memory; - if (copy_to_user((void *) arg, &userinfo, sizeof(agp_info))) { + if (copy_to_user((void *) arg, &userinfo, sizeof(agp_info))) return -EFAULT; - } + return 0; } static int agpioc_acquire_wrap(agp_file_private * priv, unsigned long arg) { + int ret; + agp_controller *controller; - if (!(test_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags))) { + if (!(test_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags))) return -EPERM; - } - if (agp_fe.current_controller != NULL) { + + if (agp_fe.current_controller != NULL) return -EBUSY; - } - if ((agp_backend_acquire()) == 0) { + + ret = agp_backend_acquire(); + if (ret == 0) agp_fe.backend_acquired = TRUE; - } else { - return -EBUSY; - } + else + return ret; controller = agp_find_controller_by_pid(priv->my_pid); @@ -816,10 +808,9 @@ static int agpioc_reserve_wrap(agp_file_private * priv, unsigned long arg) agp_client *client; agp_file_private *client_priv; - - if (copy_from_user(&reserve, (void *) arg, sizeof(agp_region))) { + if (copy_from_user(&reserve, (void *) arg, sizeof(agp_region))) return -EFAULT; - } + if ((unsigned) reserve.seg_count >= ~0U/sizeof(agp_segment)) return -EFAULT; @@ -849,9 +840,9 @@ static int agpioc_reserve_wrap(agp_file_private * priv, unsigned long arg) segment = kmalloc((sizeof(agp_segment) * reserve.seg_count), GFP_KERNEL); - if (segment == NULL) { + if (segment == NULL) return -ENOMEM; - } + if (copy_from_user(segment, (void *) reserve.seg_list, sizeof(agp_segment) * reserve.seg_count)) { kfree(segment); @@ -895,14 +886,14 @@ static int agpioc_allocate_wrap(agp_file_private * priv, unsigned long arg) agp_memory *memory; agp_allocate alloc; - if (copy_from_user(&alloc, (void *) arg, sizeof(agp_allocate))) { + if (copy_from_user(&alloc, (void *) arg, sizeof(agp_allocate))) return -EFAULT; - } + memory = agp_allocate_memory_wrap(alloc.pg_count, alloc.type); - if (memory == NULL) { + if (memory == NULL) return -ENOMEM; - } + alloc.key = memory->key; alloc.physical = memory->physical; @@ -919,9 +910,9 @@ static int agpioc_deallocate_wrap(agp_file_private * priv, unsigned long arg) memory = agp_find_mem_by_key((int) arg); - if (memory == NULL) { + if (memory == NULL) return -EINVAL; - } + agp_free_memory_wrap(memory); return 0; } @@ -931,14 +922,14 @@ static int agpioc_bind_wrap(agp_file_private * priv, unsigned long arg) agp_bind bind_info; agp_memory *memory; - if (copy_from_user(&bind_info, (void *) arg, sizeof(agp_bind))) { + if (copy_from_user(&bind_info, (void *) arg, sizeof(agp_bind))) return -EFAULT; - } + memory = agp_find_mem_by_key(bind_info.key); - if (memory == NULL) { + if (memory == NULL) return -EINVAL; - } + return agp_bind_memory(memory, bind_info.pg_start); } @@ -947,14 +938,14 @@ static int agpioc_unbind_wrap(agp_file_private * priv, unsigned long arg) agp_memory *memory; agp_unbind unbind; - if (copy_from_user(&unbind, (void *) arg, sizeof(agp_unbind))) { + if (copy_from_user(&unbind, (void *) arg, sizeof(agp_unbind))) return -EFAULT; - } + memory = agp_find_mem_by_key(unbind.key); - if (memory == NULL) { + if (memory == NULL) return -EINVAL; - } + return agp_unbind_memory(memory); } @@ -977,8 +968,7 @@ static int agp_ioctl(struct inode *inode, struct file *file, goto ioctl_out; } if (cmd != AGPIOC_ACQUIRE) { - if (!(test_bit(AGP_FF_IS_CONTROLLER, - &curr_priv->access_flags))) { + if (!(test_bit(AGP_FF_IS_CONTROLLER, &curr_priv->access_flags))) { ret_val = -EPERM; goto ioctl_out; } @@ -990,59 +980,49 @@ static int agp_ioctl(struct inode *inode, struct file *file, goto ioctl_out; } } + switch (cmd) { case AGPIOC_INFO: - { - ret_val = agpioc_info_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_info_wrap(curr_priv, arg); + break; + case AGPIOC_ACQUIRE: - { - ret_val = agpioc_acquire_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_acquire_wrap(curr_priv, arg); + break; + case AGPIOC_RELEASE: - { - ret_val = agpioc_release_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_release_wrap(curr_priv, arg); + break; + case AGPIOC_SETUP: - { - ret_val = agpioc_setup_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_setup_wrap(curr_priv, arg); + break; + case AGPIOC_RESERVE: - { - ret_val = agpioc_reserve_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_reserve_wrap(curr_priv, arg); + break; + case AGPIOC_PROTECT: - { - ret_val = agpioc_protect_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_protect_wrap(curr_priv, arg); + break; + case AGPIOC_ALLOCATE: - { - ret_val = agpioc_allocate_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_allocate_wrap(curr_priv, arg); + break; + case AGPIOC_DEALLOCATE: - { - ret_val = agpioc_deallocate_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_deallocate_wrap(curr_priv, arg); + break; + case AGPIOC_BIND: - { - ret_val = agpioc_bind_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_bind_wrap(curr_priv, arg); + break; + case AGPIOC_UNBIND: - { - ret_val = agpioc_unbind_wrap(curr_priv, arg); - goto ioctl_out; - } + ret_val = agpioc_unbind_wrap(curr_priv, arg); + break; } - + ioctl_out: AGP_UNLOCK(); return ret_val; diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index 3a08a2302021..a6b774459075 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c @@ -168,7 +168,7 @@ static int __init via_kt400_setup(struct pci_dev *pdev) agp_bridge.resume = agp_generic_resume; agp_bridge.cant_use_aperture = 0; - pci_read_config_byte(agp_bridge.dev, VIA_AGPSEL, ®); + pci_read_config_byte(pdev, VIA_AGPSEL, ®); if ((reg & (1<<1))==1) { /* AGP 2.0 compatability mode. */ agp_bridge.agp_enable = agp_generic_agp_enable; diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 9a990ab0c00b..cb16472e3afc 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c @@ -2503,7 +2503,7 @@ static inline int stl_initeio(stlbrd_t *brdp) * dealing with all types of ECH board. */ -static int inline stl_initech(stlbrd_t *brdp) +static inline int stl_initech(stlbrd_t *brdp) { stlpanel_t *panelp; unsigned int status, nxtid, ioaddr, conflict; @@ -5222,7 +5222,7 @@ static void stl_sc26198rxisr(stlport_t *portp, unsigned int iack) * Process an RX bad character. */ -static void inline stl_sc26198rxbadch(stlport_t *portp, unsigned char status, char ch) +static inline void stl_sc26198rxbadch(stlport_t *portp, unsigned char status, char ch) { struct tty_struct *tty; unsigned int ioaddr; diff --git a/drivers/fc4/soc.c b/drivers/fc4/soc.c index 2d1b2e4da698..03b72bf668a4 100644 --- a/drivers/fc4/soc.c +++ b/drivers/fc4/soc.c @@ -104,7 +104,7 @@ static void soc_reset(fc_channel *fc) soc_enable(s); } -static void inline soc_solicited (struct soc *s) +static inline void soc_solicited (struct soc *s) { fc_hdr fchdr; soc_rsp *hwrsp; @@ -165,7 +165,7 @@ static void inline soc_solicited (struct soc *s) } } -static void inline soc_request (struct soc *s, u32 cmd) +static inline void soc_request (struct soc *s, u32 cmd) { SOC_SETIMASK(s, s->imask & ~(cmd & SOC_CMD_REQ_QALL)); SOD(("imask %08lx %08lx\n", s->imask, sbus_readl(s->regs + IMASK))); @@ -184,7 +184,7 @@ static void inline soc_request (struct soc *s, u32 cmd) s->curr_port ^= 1; } -static void inline soc_unsolicited (struct soc *s) +static inline void soc_unsolicited (struct soc *s) { soc_rsp *hwrsp, *hwrspc; soc_cq *sw_cq; diff --git a/drivers/fc4/socal.c b/drivers/fc4/socal.c index b00c94f6db25..ef18d4c92edd 100644 --- a/drivers/fc4/socal.c +++ b/drivers/fc4/socal.c @@ -133,7 +133,7 @@ static void socal_reset(fc_channel *fc) socal_enable(s); } -static void inline socal_solicited(struct socal *s, unsigned long qno) +static inline void socal_solicited(struct socal *s, unsigned long qno) { socal_rsp *hwrsp; socal_cq *sw_cq; @@ -225,7 +225,7 @@ static void inline socal_solicited(struct socal *s, unsigned long qno) } } -static void inline socal_request (struct socal *s, u32 cmd) +static inline void socal_request (struct socal *s, u32 cmd) { SOCAL_SETIMASK(s, s->imask & ~(cmd & SOCAL_CMD_REQ_QALL)); SOD(("imask %08x %08x\n", s->imask, sbus_readl(s->regs + IMASK))); @@ -242,7 +242,7 @@ static void inline socal_request (struct socal *s, u32 cmd) s->curr_port ^= 1; } -static void inline socal_unsolicited (struct socal *s, unsigned long qno) +static inline void socal_unsolicited (struct socal *s, unsigned long qno) { socal_rsp *hwrsp, *hwrspc; socal_cq *sw_cq; diff --git a/drivers/hotplug/ibmphp_res.c b/drivers/hotplug/ibmphp_res.c index 762ad60c71a7..27cccc156b70 100644 --- a/drivers/hotplug/ibmphp_res.c +++ b/drivers/hotplug/ibmphp_res.c @@ -1889,7 +1889,7 @@ void ibmphp_print_test (void) debug_pci ("***********************END***********************\n"); } -int static range_exists_already (struct range_node * range, struct bus_node * bus_cur, u8 type) +static int range_exists_already (struct range_node * range, struct bus_node * bus_cur, u8 type) { struct range_node * range_cur = NULL; switch (type) { diff --git a/drivers/i2c/i2c-adap-ite.c b/drivers/i2c/i2c-adap-ite.c index 2c7b5103806c..28352ac46df6 100644 --- a/drivers/i2c/i2c-adap-ite.c +++ b/drivers/i2c/i2c-adap-ite.c @@ -61,11 +61,7 @@ static int own = 0; static int i2c_debug=0; static struct iic_ite gpi; -#if (LINUX_VERSION_CODE < 0x020301) -static struct wait_queue *iic_wait = NULL; -#else static wait_queue_head_t iic_wait; -#endif static int iic_pending; /* ----- global defines ----------------------------------------------- */ @@ -236,9 +232,7 @@ static int __init iic_ite_init(void) piic->iic_own = own; iic_ite_data.data = (void *)piic; -#if (LINUX_VERSION_CODE >= 0x020301) init_waitqueue_head(&iic_wait); -#endif if (iic_hw_resrc_init() == 0) { if (i2c_iic_add_bus(&iic_ite_ops) < 0) return -ENODEV; diff --git a/drivers/i2c/i2c-philips-par.c b/drivers/i2c/i2c-philips-par.c index ce2258a20447..b489b5f37114 100644 --- a/drivers/i2c/i2c-philips-par.c +++ b/drivers/i2c/i2c-philips-par.c @@ -228,41 +228,25 @@ static void i2c_parport_detach (struct parport *port) } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4) static struct parport_driver i2c_driver = { "i2c-philips-par", i2c_parport_attach, i2c_parport_detach, NULL }; -#endif int __init i2c_bitlp_init(void) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,4) - struct parport *port; -#endif printk(KERN_INFO "i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4) parport_register_driver(&i2c_driver); -#else - for (port = parport_enumerate(); port; port=port->next) - i2c_parport_attach(port); -#endif return 0; } void __exit i2c_bitlp_exit(void) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4) parport_unregister_driver(&i2c_driver); -#else - struct parport *port; - for (port = parport_enumerate(); port; port=port->next) - i2c_parport_detach(port); -#endif } MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>"); diff --git a/drivers/i2c/i2c-proc.c b/drivers/i2c/i2c-proc.c index 785e9c5f3716..3b97e96de669 100644 --- a/drivers/i2c/i2c-proc.c +++ b/drivers/i2c/i2c-proc.c @@ -23,7 +23,6 @@ This driver puts entries in /proc/sys/dev/sensors for each I2C device */ -#include <linux/version.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> @@ -31,14 +30,10 @@ #include <linux/sysctl.h> #include <linux/proc_fs.h> #include <linux/ioport.h> -#include <asm/uaccess.h> #include <linux/i2c.h> #include <linux/i2c-proc.h> #include <linux/init.h> - -#ifndef THIS_MODULE -#define THIS_MODULE NULL -#endif +#include <asm/uaccess.h> static int i2c_create_name(char **name, const char *prefix, struct i2c_adapter *adapter, int addr); @@ -56,7 +51,6 @@ static int i2c_sysctl_chips(ctl_table * table, int *name, int nlen, #define SENSORS_ENTRY_MAX 20 static struct ctl_table_header *i2c_entries[SENSORS_ENTRY_MAX]; -static unsigned short i2c_inodes[SENSORS_ENTRY_MAX]; static struct i2c_client *i2c_clients[SENSORS_ENTRY_MAX]; @@ -197,8 +191,6 @@ int i2c_register_entry(struct i2c_client *client, const char *prefix, return id; } #endif /* DEBUG */ - i2c_inodes[id - 256] = - new_header->ctl_table->child->child->de->low_ino; new_header->ctl_table->child->child->de->owner = controlling_mod; return id; diff --git a/drivers/ide/pci/pdc202xx_old.h b/drivers/ide/pci/pdc202xx_old.h index a91915c8c7a1..b3b5388a5b80 100644 --- a/drivers/ide/pci/pdc202xx_old.h +++ b/drivers/ide/pci/pdc202xx_old.h @@ -14,7 +14,7 @@ #define PDC202XX_DEBUG_DRIVE_INFO 0 #define PDC202XX_DECODE_REGISTER_INFO 0 -const static char *pdc_quirk_drives[] = { +static const char *pdc_quirk_drives[] = { "QUANTUM FIREBALLlct08 08", "QUANTUM FIREBALLP KA6.4", "QUANTUM FIREBALLP KA9.1", diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index 0e07e706a576..a679f52a0912 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c @@ -267,7 +267,7 @@ static void notify_down(u32 contr) /* ------------------------------------------------------------ */ -static void inline notify_doit(struct capi_notifier *np) +static inline void notify_doit(struct capi_notifier *np) { switch (np->cmd) { case KCI_CONTRUP: diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 0c7838de3289..55e9a01d4e29 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -250,7 +250,7 @@ static void raid_end_bio_io(r1bio_t *r1_bio, int uptodate) /* * Update disk head position estimator based on IRQ completion info. */ -static void inline update_head_pos(int disk, r1bio_t *r1_bio) +static inline void update_head_pos(int disk, r1bio_t *r1_bio) { conf_t *conf = mddev_to_conf(r1_bio->mddev); diff --git a/drivers/media/dvb/av7110/av7110.c b/drivers/media/dvb/av7110/av7110.c index 0a8971b2f017..4df0e077f88a 100644 --- a/drivers/media/dvb/av7110/av7110.c +++ b/drivers/media/dvb/av7110/av7110.c @@ -2245,7 +2245,7 @@ VidMode(av7110_t *av7110, int mode) } -static int inline +static inline int vidcom(av7110_t *av7110, u32 com, u32 arg) { return outcom(av7110, 0x80, 0x02, 4, @@ -2253,7 +2253,7 @@ vidcom(av7110_t *av7110, u32 com, u32 arg) (arg>>16), (arg&0xffff)); } -static int inline +static inline int audcom(av7110_t *av7110, u32 com) { return outcom(av7110, 0x80, 0x03, 4, diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index af042ec7b2ad..4ddef3f99205 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c @@ -1634,7 +1634,7 @@ static int free_frame_buf(struct cam_data *cam) } -static void inline free_frames(struct cpia_frame frame[FRAME_NUM]) +static inline void free_frames(struct cpia_frame frame[FRAME_NUM]) { int i; diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index fb87cdd8b873..6259fe17c681 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c @@ -107,7 +107,7 @@ MODULE_PARM_DESC(mem_type, "Set Memory type (0=Flash, 1=RAM, 2=ROM, default=0)") -static void inline cs_error(client_handle_t handle, int func, int ret) +static inline void cs_error(client_handle_t handle, int func, int ret) { error_info_t err = { func, ret }; CardServices(ReportError, handle, &err); diff --git a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c index d118a1585ca0..3f38f62ada89 100644 --- a/drivers/net/e100/e100_main.c +++ b/drivers/net/e100/e100_main.c @@ -1812,7 +1812,7 @@ e100intr(int irq, void *dev_inst, struct pt_regs *regs) * * This routine frees resources of TX skbs. */ -static void inline +static inline void e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb) { if (tcb->tcb_skb) { diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 2d8c089d5c93..93237b2af18a 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -342,7 +342,7 @@ static inline int calc_crc_ccitt(const unsigned char *buf, int cnt) /* --------------------------------------------------------------------- */ -static void inline baycom_int_freq(struct baycom_state *bc) +static inline void baycom_int_freq(struct baycom_state *bc) { #ifdef BAYCOM_DEBUG unsigned long cur_jiffies = jiffies; @@ -431,7 +431,7 @@ static void epp_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* ---------------------------------------------------------------------- */ -static void inline do_kiss_params(struct baycom_state *bc, +static inline void do_kiss_params(struct baycom_state *bc, unsigned char *data, unsigned long len) { diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c index 64eea939a50e..d46e75c34c95 100644 --- a/drivers/net/hamradio/baycom_ser_fdx.c +++ b/drivers/net/hamradio/baycom_ser_fdx.c @@ -152,7 +152,7 @@ struct baycom_state { /* --------------------------------------------------------------------- */ -static void inline baycom_int_freq(struct baycom_state *bc) +static inline void baycom_int_freq(struct baycom_state *bc) { #ifdef BAYCOM_DEBUG unsigned long cur_jiffies = jiffies; diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c index 14e18b0b1df0..92644c2089ab 100644 --- a/drivers/net/hamradio/baycom_ser_hdx.c +++ b/drivers/net/hamradio/baycom_ser_hdx.c @@ -143,7 +143,7 @@ struct baycom_state { /* --------------------------------------------------------------------- */ -static void inline baycom_int_freq(struct baycom_state *bc) +static inline void baycom_int_freq(struct baycom_state *bc) { #ifdef BAYCOM_DEBUG unsigned long cur_jiffies = jiffies; @@ -166,7 +166,7 @@ static void inline baycom_int_freq(struct baycom_state *bc) * ===================== SER12 specific routines ========================= */ -static void inline ser12_set_divisor(struct net_device *dev, +static inline void ser12_set_divisor(struct net_device *dev, unsigned char divisor) { outb(0x81, LCR(dev->base_addr)); /* DLAB = 1 */ diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index 7587ce3f2ecb..da2719f5fef8 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c @@ -1479,7 +1479,7 @@ static inline int ioc3_is_menet(struct pci_dev *pdev) && dev->device == PCI_DEVICE_ID_SGI_IOC3; } -static void inline ioc3_serial_probe(struct pci_dev *pdev, +static inline void ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3) { struct serial_struct req; diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c index d677e1832497..1d2793c8f350 100644 --- a/drivers/net/lp486e.c +++ b/drivers/net/lp486e.c @@ -1061,7 +1061,7 @@ err_out: return ret; } -static void inline +static inline void i596_handle_CU_completion(struct net_device *dev, volatile struct i596_private *lp, unsigned short status, diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c index 95f72759aa0f..f2be232c4de1 100644 --- a/drivers/net/mac89x0.c +++ b/drivers/net/mac89x0.c @@ -141,14 +141,14 @@ static int set_mac_address(struct net_device *dev, void *addr); #define tx_done(dev) 1 /* For reading/writing registers ISA-style */ -static int inline +static inline int readreg_io(struct net_device *dev, int portno) { nubus_writew(swab16(portno), dev->base_addr + ADD_PORT); return swab16(nubus_readw(dev->base_addr + DATA_PORT)); } -static void inline +static inline void writereg_io(struct net_device *dev, int portno, int value) { nubus_writew(swab16(portno), dev->base_addr + ADD_PORT); @@ -156,13 +156,13 @@ writereg_io(struct net_device *dev, int portno, int value) } /* These are for reading/writing registers in shared memory */ -static int inline +static inline int readreg(struct net_device *dev, int portno) { return swab16(nubus_readw(dev->mem_start + portno)); } -static void inline +static inline void writereg(struct net_device *dev, int portno, int value) { nubus_writew(swab16(value), dev->mem_start + portno); diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 3551dc49874f..ae3c088214fd 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -1282,7 +1282,7 @@ MODULE_PARM_DESC(parport, "List of parport device numbers to use by plip"); static struct net_device *dev_plip[PLIP_MAX] = { NULL, }; -static int inline +static inline int plip_searchfor(int list[], int a) { int i; diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index f3b5ef9ae502..dbcbebe706fe 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c @@ -1933,7 +1933,7 @@ reject: /* Reject the packet */ spin_unlock_irqrestore(&cosa->lock, flags); } -static void inline eot_interrupt(struct cosa_data *cosa, int status) +static inline void eot_interrupt(struct cosa_data *cosa, int status) { unsigned long flags, flags1; spin_lock_irqsave(&cosa->lock, flags); diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 71c48db5f3ec..f803b5919c4f 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -114,7 +114,7 @@ static void frob_econtrol (struct parport *pb, unsigned char m, outb ((ectr & ~m) ^ v, ECONTROL (pb)); } -static void __inline__ frob_set_mode (struct parport *p, int mode) +static __inline__ void frob_set_mode (struct parport *p, int mode) { frob_econtrol (p, ECR_MODE_MASK, mode << 5); } diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 8c2cd91ad6c3..893561738443 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -814,7 +814,7 @@ static void __init add_pcic(int ns, int type) #ifdef CONFIG_ISA -#ifdef __ISAPNP__ +#ifdef CONFIG_PNP static struct isapnp_device_id id_table[] __initdata = { { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_FUNCTION(0x0e00), (unsigned long) "Intel 82365-Compatible" }, @@ -826,32 +826,28 @@ static struct isapnp_device_id id_table[] __initdata = { }; MODULE_DEVICE_TABLE(isapnp, id_table); -static struct pci_dev *i82365_pnpdev; +static struct pnp_dev *i82365_pnpdev; #endif static void __init isa_probe(void) { int i, j, sock, k, ns, id; ioaddr_t port; -#ifdef __ISAPNP__ +#ifdef CONFIG_PNP struct isapnp_device_id *devid; - struct pci_dev *dev; + struct pnp_dev *dev; for (devid = id_table; devid->vendor; devid++) { - if ((dev = isapnp_find_dev(NULL, devid->vendor, devid->function, NULL))) { - printk("ISAPNP "); + if ((dev = pnp_find_dev(NULL, devid->vendor, devid->function, NULL))) { + printk("PNP "); - if (dev->prepare && dev->prepare(dev) < 0) { - printk("prepare failed\n"); - break; - } - - if (dev->activate && dev->activate(dev) < 0) { + if (pnp_activate_dev(dev, NULL) < 0) { printk("activate failed\n"); break; } - if ((i365_base = pci_resource_start(dev, 0))) { + i365_base = pnp_port_start(dev, 0); + if (i365_base) { printk("no resources ?\n"); break; } @@ -1644,8 +1640,8 @@ static void __exit exit_i82365(void) release_region(socket[i].ioaddr, 2); } #if defined(CONFIG_ISA) && defined(__ISAPNP__) - if (i82365_pnpdev && i82365_pnpdev->deactivate) - i82365_pnpdev->deactivate(i82365_pnpdev); + if (i82365_pnpdev) + pnp_disable_dev(i82365_pnpdev); #endif } /* exit_i82365 */ diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index e591e906049d..914c1e2628ee 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -192,6 +192,7 @@ struct pnp_dev * pnp_request_card_device(struct pnp_card *card, const char *id, { struct list_head *pos; struct pnp_dev *dev; + struct pnpc_driver *cdrv; if (!card || !id) goto done; if (!from) { @@ -212,9 +213,16 @@ done: return NULL; found: - if (dev->active == 0) - if(pnp_activate_dev(dev)<0) - return NULL; + cdrv = to_pnpc_driver(card->dev.driver); + if (dev->active == 0) { + if (!(cdrv->flags & PNPC_DRIVER_DO_NOT_ACTIVATE)) { + if(pnp_activate_dev(dev,NULL)<0) + return NULL; + } + } else { + if ((cdrv->flags & PNPC_DRIVER_DO_NOT_ACTIVATE)) + pnp_disable_dev(dev); + } spin_lock(&pnp_lock); list_add_tail(&dev->rdev_list, &card->rdevs); spin_unlock(&pnp_lock); diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index 7eed8f4f8163..979cccd2a128 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -115,7 +115,8 @@ int __pnp_add_device(struct pnp_dev *dev) int error = 0; pnp_name_device(dev); pnp_fixup_device(dev); - strcpy(dev->dev.name,dev->name); + strncpy(dev->dev.name,dev->name,DEVICE_NAME_SIZE-1); + dev->dev.name[DEVICE_NAME_SIZE-1] = '\0'; dev->dev.bus = &pnp_bus_type; dev->dev.release = &pnp_release_device; error = device_register(&dev->dev); diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 8676d7941b00..e954b11ae931 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -66,7 +66,7 @@ static const struct pnp_device_id * match_device(struct pnp_driver *drv, struct static int pnp_device_probe(struct device *dev) { - int error = 0; + int error; struct pnp_driver *pnp_drv; struct pnp_dev *pnp_dev; const struct pnp_device_id *dev_id = NULL; @@ -75,9 +75,17 @@ static int pnp_device_probe(struct device *dev) pnp_dbg("pnp: match found with the PnP device '%s' and the driver '%s'", dev->bus_id,pnp_drv->name); - if (pnp_dev->active == 0) - if(pnp_activate_dev(pnp_dev)<0) - return -1; + if (pnp_dev->active == 0) { + if (!(pnp_drv->flags & PNP_DRIVER_DO_NOT_ACTIVATE)) { + error = pnp_activate_dev(pnp_dev, NULL); + if (error < 0) + return error; + } + } else { + if ((pnp_drv->flags & PNP_DRIVER_DO_NOT_ACTIVATE)) + pnp_disable_dev(pnp_dev); + } + error = 0; if (pnp_drv->probe && pnp_dev->active) { dev_id = match_device(pnp_drv, pnp_dev); if (dev_id != NULL) diff --git a/drivers/pnp/idlist.h b/drivers/pnp/idlist.h index c75698a68f5c..aa2272fbd652 100644 --- a/drivers/pnp/idlist.h +++ b/drivers/pnp/idlist.h @@ -5,6 +5,7 @@ ID("CSC0003", "Crystal Semiconductor CS423x sound -- MPU401") ID("IBM3780", "IBM pointing device") ID("IBM0071", "IBM infrared communications device") ID("IBM3760", "IBM DSP") +ID("NSC6001", "National Semiconductor Serial Port with Fast IR") ID("PNP0000", "AT Interrupt Controller") ID("PNP0001", "EISA Interrupt Controller") ID("PNP0002", "MCA Interrupt Controller") @@ -54,6 +55,7 @@ ID("PNP0602", "Plus Hardcard IIXL/EZ") ID("PNP0603", "Generic IDE supporting Microsoft Device Bay Specification") ID("PNP0700", "PC standard floppy disk controller") ID("PNP0701", "Standard floppy controller supporting MS Device Bay Spec") +ID("PNP0802", "Microsoft Sound System or Compatible Device (obsolete)") ID("PNP0900", "VGA Compatible") ID("PNP0901", "Video Seven VRAM/VRAM II/1024i") ID("PNP0902", "8514/A Compatible") @@ -151,7 +153,6 @@ ID("PNP0f1c", "Compaq LTE Trackball PS/2-style Mouse") ID("PNP0f1d", "Compaq LTE Trackball Serial Mouse") ID("PNP0f1e", "Microsoft Kids Trackball Mouse") ID("PNP8001", "Novell/Anthem NE3200") -ID("PNP0802", "Microsoft Sound System or Compatible Device (obsolete)") ID("PNP8004", "Compaq NE3200") ID("PNP8006", "Intel EtherExpress/32") ID("PNP8008", "HP EtherTwist EISA LAN Adapter/32 (HP27248A)") diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 8746323da744..b7ad96265091 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c @@ -295,12 +295,28 @@ pnp_set_current_resources(struct device * dmdev, const char * buf, size_t count, num_args = sscanf(buf,"%10s %i %10s",command,&depnum,type); if (!num_args) goto done; + if (!strnicmp(command,"lock",4)) { + if (dev->active) { + dev->lock_resources = 1; + } else { + error = -EINVAL; + } + goto done; + } + if (!strnicmp(command,"unlock",6)) { + if (dev->lock_resources) { + dev->lock_resources = 0; + } else { + error = -EINVAL; + } + goto done; + } if (!strnicmp(command,"disable",7)) { error = pnp_disable_dev(dev); goto done; } if (!strnicmp(command,"auto",4)) { - error = pnp_activate_dev(dev); + error = pnp_activate_dev(dev,NULL); goto done; } if (!strnicmp(command,"manual",6)) { @@ -308,7 +324,7 @@ pnp_set_current_resources(struct device * dmdev, const char * buf, size_t count, goto done; if (!strnicmp(type,"static",6)) mode = PNP_STATIC; - error = pnp_raw_set_dev(dev,depnum,mode); + error = pnp_raw_set_dev(dev,depnum,NULL,mode); goto done; } done: diff --git a/drivers/pnp/isapnp/Makefile b/drivers/pnp/isapnp/Makefile index 62c36dd5df7e..1539195169db 100644 --- a/drivers/pnp/isapnp/Makefile +++ b/drivers/pnp/isapnp/Makefile @@ -2,8 +2,8 @@ # Makefile for the kernel ISAPNP driver. # -export-objs := core.o +export-objs := core.o compat.o isapnp-proc-$(CONFIG_PROC_FS) = proc.o -obj-y := core.o $(isapnp-proc-y) +obj-y := core.o compat.o $(isapnp-proc-y) diff --git a/drivers/pnp/isapnp/compat.c b/drivers/pnp/isapnp/compat.c index 862c21feba05..834a4ee8b4a9 100644 --- a/drivers/pnp/isapnp/compat.c +++ b/drivers/pnp/isapnp/compat.c @@ -26,21 +26,20 @@ static void pnp_convert_id(char *buf, unsigned short vendor, unsigned short devi } struct pnp_card *pnp_find_card(unsigned short vendor, - unsigned short device, - struct pnp_card *from) + unsigned short device, + struct pnp_card *from) { char id[7]; char any[7]; struct list_head *list; pnp_convert_id(id, vendor, device); pnp_convert_id(any, ISAPNP_ANY_ID, ISAPNP_ANY_ID); - list = isapnp_cards.next; - if (from) - list = from->node.next; - while (list != &isapnp_cards) { - struct pnp_card *card = to_pnp_card(list); - if (compare_pnp_id(&card->ids,id) || (memcmp(id,any,7)==0)) + list = from ? from->global_list.next : pnp_cards.next; + + while (list != &pnp_cards) { + struct pnp_card *card = global_to_pnp_card(list); + if (compare_pnp_id(card->id,id) || (memcmp(id,any,7)==0)) return card; list = list->next; } @@ -48,9 +47,9 @@ struct pnp_card *pnp_find_card(unsigned short vendor, } struct pnp_dev *pnp_find_dev(struct pnp_card *card, - unsigned short vendor, - unsigned short function, - struct pnp_dev *from) + unsigned short vendor, + unsigned short function, + struct pnp_dev *from) { char id[7]; char any[7]; @@ -65,7 +64,7 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card, while (list != &pnp_global) { struct pnp_dev *dev = global_to_pnp_dev(list); - if (compare_pnp_id(&dev->ids,id) || (memcmp(id,any,7)==0)) + if (compare_pnp_id(dev->id,id) || (memcmp(id,any,7)==0)) return dev; list = list->next; } @@ -80,7 +79,7 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card, } while (list != &card->devices) { struct pnp_dev *dev = card_to_pnp_dev(list); - if (compare_pnp_id(&dev->ids,id)) + if (compare_pnp_id(dev->id,id)) return dev; list = list->next; } diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index b60bea187852..fa683efd00a3 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -42,12 +42,8 @@ #include <linux/delay.h> #include <linux/init.h> #include <linux/isapnp.h> -#include <linux/pnp.h> #include <asm/io.h> -LIST_HEAD(isapnp_cards); -LIST_HEAD(isapnp_devices); - #if 0 #define ISAPNP_REGION_OK #endif @@ -106,6 +102,8 @@ static int isapnp_detected; /* some prototypes */ static int isapnp_config_prepare(struct pnp_dev *dev); +extern struct pnp_protocol isapnp_card_protocol; +extern struct pnp_protocol isapnp_protocol; static inline void write_data(unsigned char x) { @@ -521,7 +519,7 @@ static void __init isapnp_add_port_resource(struct pnp_dev *dev, port->max = (tmp[4] << 8) | tmp[3]; port->align = tmp[5]; port->size = tmp[6]; - port->flags = tmp[0] ? ISAPNP_PORT_FLAG_16BITADDR : 0; + port->flags = tmp[0] ? PNP_PORT_FLAG_16BITADDR : 0; pnp_add_port_resource(dev,depnum,port); return; } @@ -543,7 +541,7 @@ static void __init isapnp_add_fixed_port_resource(struct pnp_dev *dev, port->min = port->max = (tmp[1] << 8) | tmp[0]; port->size = tmp[2]; port->align = 0; - port->flags = ISAPNP_PORT_FLAG_FIXED; + port->flags = PNP_PORT_FLAG_FIXED; pnp_add_port_resource(dev,depnum,port); return; } @@ -631,7 +629,7 @@ isapnp_parse_name(char *name, unsigned int name_max, unsigned short *size) */ static int __init isapnp_create_device(struct pnp_card *card, - unsigned short size) + unsigned short size) { int number = 0, skip = 0, depnum = 0, dependent = 0, compat = 0; unsigned char type, tmp[17]; @@ -686,7 +684,7 @@ static int __init isapnp_create_device(struct pnp_card *card, case _STAG_STARTDEP: if (size > 1) goto __skip; - dependent = 0x100 | ISAPNP_RES_PRIORITY_ACCEPTABLE; + dependent = 0x100 | PNP_RES_PRIORITY_ACCEPTABLE; if (size > 0) { isapnp_peek(tmp, size); dependent = 0x100 | tmp[0]; @@ -891,7 +889,7 @@ static int __init isapnp_build_device_list(void) if (isapnp_checksum_value != 0x00) printk(KERN_ERR "isapnp: checksum for device %i is not valid (0x%x)\n", csn, isapnp_checksum_value); card->checksum = isapnp_checksum_value; - card->protocol = &isapnp_protocol; + card->protocol = &isapnp_card_protocol; pnpc_add_card(card); } return 0; @@ -903,7 +901,12 @@ static int __init isapnp_build_device_list(void) int isapnp_present(void) { - return !list_empty(&isapnp_devices); + struct pnp_card *card; + pnp_for_each_card(card) { + if (card->protocol == &isapnp_card_protocol) + return 1; + } + return 0; } int isapnp_cfg_begin(int csn, int logdev) @@ -947,7 +950,7 @@ static int isapnp_config_prepare(struct pnp_dev *dev) int idx; if (dev == NULL) return -EINVAL; - if (dev->active || dev->ro) + if (dev->active || dev->lock_resources) return -EBUSY; for (idx = 0; idx < DEVICE_COUNT_IRQ; idx++) { dev->irq_resource[idx].name = NULL; @@ -970,24 +973,11 @@ static int isapnp_config_prepare(struct pnp_dev *dev) return 0; } -void isapnp_resource_change(struct resource *resource, - unsigned long start, - unsigned long size) -{ - if (resource == NULL) - return; - resource->flags &= ~IORESOURCE_AUTO; - resource->start = start; - resource->end = start + size - 1; -} - /* * Inititialization. */ -EXPORT_SYMBOL(isapnp_cards); -EXPORT_SYMBOL(isapnp_devices); EXPORT_SYMBOL(isapnp_present); EXPORT_SYMBOL(isapnp_cfg_begin); EXPORT_SYMBOL(isapnp_cfg_end); @@ -999,7 +989,6 @@ EXPORT_SYMBOL(isapnp_write_word); EXPORT_SYMBOL(isapnp_write_dword); EXPORT_SYMBOL(isapnp_wake); EXPORT_SYMBOL(isapnp_device); -EXPORT_SYMBOL(isapnp_resource_change); static int isapnp_get_resources(struct pnp_dev *dev) { @@ -1053,8 +1042,15 @@ static int isapnp_disable_resources(struct pnp_dev *dev) return 0; } +struct pnp_protocol isapnp_card_protocol = { + .name = "ISA Plug and Play - card", + .get = NULL, + .set = NULL, + .disable = NULL, +}; + struct pnp_protocol isapnp_protocol = { - .name = "ISA Plug and Play", + .name = "ISA Plug and Play - device", .get = isapnp_get_resources, .set = isapnp_set_resources, .disable = isapnp_disable_resources, @@ -1064,6 +1060,7 @@ int __init isapnp_init(void) { int cards; struct pnp_card *card; + struct pnp_dev *dev; if (isapnp_disable) { isapnp_detected = 0; @@ -1084,6 +1081,9 @@ int __init isapnp_init(void) return -EBUSY; } + if(pnp_register_protocol(&isapnp_card_protocol)<0) + return -EBUSY; + if(pnp_register_protocol(&isapnp_protocol)<0) return -EBUSY; @@ -1126,13 +1126,11 @@ int __init isapnp_init(void) protocol_for_each_card(&isapnp_protocol,card) { cards++; if (isapnp_verbose) { - struct list_head *devlist; printk(KERN_INFO "isapnp: Card '%s'\n", card->name[0]?card->name:"Unknown"); if (isapnp_verbose < 2) continue; - for (devlist = card->devices.next; devlist != &card->devices; devlist = devlist->next) { - struct pci_dev *dev = pci_dev_b(devlist); - printk(KERN_INFO "isapnp: Device '%s'\n", dev->dev.name[0]?card->name:"Unknown"); + pnp_card_for_each_dev(card,dev) { + printk(KERN_INFO "isapnp: Device '%s'\n", dev->name[0]?dev->name:"Unknown"); } } } diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index f3427d078367..2330ee03f808 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c @@ -28,6 +28,7 @@ #include <linux/smp_lock.h> #include <asm/uaccess.h> +extern struct pnp_protocol isapnp_protocol; static struct proc_dir_entry *isapnp_proc_bus_dir = NULL; diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 2f11e1b5f746..fadd276ccd95 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c @@ -1035,7 +1035,7 @@ static unsigned char *node_possible_resource_data_to_dev(unsigned char *p, struc #define CHAR(id,a) (0x40 + (((id)>>a) & 31)) // -static void inline pnpid32_to_pnpid(u32 id, char *str) +static inline void pnpid32_to_pnpid(u32 id, char *str) { const char *hex = "0123456789abcdef"; @@ -1058,6 +1058,7 @@ static void inline pnpid32_to_pnpid(u32 id, char *str) static void node_id_data_to_dev(unsigned char *p, struct pnp_bios_node *node, struct pnp_dev *dev) { int len; + char id[8]; struct pnp_id *dev_id; if ((char *)p == NULL) @@ -1083,7 +1084,9 @@ static void node_id_data_to_dev(unsigned char *p, struct pnp_bios_node *node, st dev_id = pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL); if (!dev_id) return; - pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << 24,dev_id->id); + memset(dev_id, 0, sizeof(struct pnp_id)); + pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << 24,id); + memcpy(&dev_id->id, id, 7); pnp_add_id(dev_id, dev); break; } @@ -1258,7 +1261,7 @@ static int pnpbios_get_resources(struct pnp_dev *dev) struct pnp_bios_node * node; /* just in case */ - if(dev->driver) + if(pnp_dev_has_driver(dev)) return -EBUSY; if(!pnp_is_dynamic(dev)) return -EPERM; @@ -1281,7 +1284,7 @@ static int pnpbios_set_resources(struct pnp_dev *dev, struct pnp_cfg *config, ch struct pnp_bios_node * node; /* just in case */ - if(dev->driver) + if(pnp_dev_has_driver(dev)) return -EBUSY; if (flags == PNP_DYNAMIC && !pnp_is_dynamic(dev)) return -EPERM; @@ -1335,7 +1338,7 @@ static int pnpbios_disable_resources(struct pnp_dev *dev) if (!config) return -1; /* just in case */ - if(dev->driver) + if(pnp_dev_has_driver(dev)) return -EBUSY; if(dev->flags & PNP_NO_DISABLE || !pnp_is_dynamic(dev)) return -EPERM; @@ -1380,7 +1383,7 @@ static struct pnp_protocol pnpbios_protocol = { .disable = pnpbios_disable_resources, }; -static int inline insert_device(struct pnp_dev *dev) +static inline int insert_device(struct pnp_dev *dev) { struct list_head * pos; struct pnp_dev * pnp_dev; @@ -1396,7 +1399,7 @@ static int inline insert_device(struct pnp_dev *dev) static void __init build_devlist(void) { u8 nodenum; - char id[7]; + char id[8]; unsigned char *pos; unsigned int nodes_got = 0; unsigned int devs = 0; @@ -1432,14 +1435,15 @@ static void __init build_devlist(void) break; memset(dev,0,sizeof(struct pnp_dev)); dev_id = pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL); - if (!dev_id) + if (!dev_id) { + kfree(dev); break; + } memset(dev_id,0,sizeof(struct pnp_id)); dev->number = thisnodenum; - memcpy(dev->name,"Unknown Device",13); - dev->name[14] = '\0'; + strcpy(dev->name,"Unknown Device"); pnpid32_to_pnpid(node->eisa_id,id); - memcpy(dev_id->id,id,8); + memcpy(dev_id->id,id,7); pnp_add_id(dev_id, dev); pos = node_current_resource_data_to_dev(node,dev); pos = node_possible_resource_data_to_dev(pos,node,dev); @@ -1448,9 +1452,10 @@ static void __init build_devlist(void) dev->protocol = &pnpbios_protocol; - if(insert_device(dev)<0) + if(insert_device(dev)<0) { + kfree(dev_id); kfree(dev); - else + } else devs++; if (nodenum <= thisnodenum) { printk(KERN_ERR "PnPBIOS: build_devlist: Node number 0x%x is out of sequence following node 0x%x. Aborting.\n", (unsigned int)nodenum, (unsigned int)thisnodenum); diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index d8648efb72b3..d447461caa14 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -588,45 +588,65 @@ static int pnp_generate_dma(struct pnp_cfg *config, int num) return -ENOENT; } -static int pnp_prepare_request(struct pnp_cfg *config) +int pnp_init_res_cfg(struct pnp_res_cfg *res_config) { - struct pnp_dev *dev; int idx; - if (!config) - return -EINVAL; - dev = &config->request; - if (dev == NULL) + + if (!res_config) return -EINVAL; - if (dev->active || dev->ro) - return -EBUSY; for (idx = 0; idx < DEVICE_COUNT_IRQ; idx++) { - dev->irq_resource[idx].name = NULL; - dev->irq_resource[idx].start = -1; - dev->irq_resource[idx].end = -1; - dev->irq_resource[idx].flags = 0; + res_config->irq_resource[idx].start = -1; + res_config->irq_resource[idx].end = -1; + res_config->irq_resource[idx].flags = 0; } for (idx = 0; idx < DEVICE_COUNT_DMA; idx++) { - dev->dma_resource[idx].name = NULL; - dev->dma_resource[idx].start = -1; - dev->dma_resource[idx].end = -1; - dev->dma_resource[idx].flags = 0; + res_config->dma_resource[idx].name = NULL; + res_config->dma_resource[idx].start = -1; + res_config->dma_resource[idx].end = -1; + res_config->dma_resource[idx].flags = 0; } for (idx = 0; idx < DEVICE_COUNT_RESOURCE; idx++) { - dev->resource[idx].name = NULL; - dev->resource[idx].start = 0; - dev->resource[idx].end = 0; - dev->resource[idx].flags = 0; + res_config->resource[idx].name = NULL; + res_config->resource[idx].start = 0; + res_config->resource[idx].end = 0; + res_config->resource[idx].flags = 0; } return 0; } -static int pnp_generate_request(struct pnp_cfg *config) +static int pnp_prepare_request(struct pnp_dev *dev, struct pnp_cfg *config, struct pnp_res_cfg *template) { - int i; + int idx, err; if (!config) return -EINVAL; - if (pnp_prepare_request<0) - return -ENOENT; + if (dev->lock_resources) + return -EPERM; + if (dev->active) + return -EBUSY; + err = pnp_init_res_cfg(&config->request); + if (err < 0) + return err; + if (!template) + return 0; + for (idx = 0; idx < DEVICE_COUNT_IRQ; idx++) + if (template->irq_resource[idx].start >= 0) + config->request.irq_resource[idx] = template->irq_resource[idx]; + for (idx = 0; idx < DEVICE_COUNT_DMA; idx++) + if (template->dma_resource[idx].start >= 0) + config->request.dma_resource[idx] = template->dma_resource[idx]; + for (idx = 0; idx < DEVICE_COUNT_RESOURCE; idx++) + if (template->resource[idx].start > 0) + config->request.resource[idx] = template->resource[idx]; + return 0; +} + +static int pnp_generate_request(struct pnp_dev *dev, struct pnp_cfg *config, struct pnp_res_cfg *template) +{ + int i, err; + if (!config) + return -EINVAL; + if ((err = pnp_prepare_request(dev, config, template))<0) + return err; for (i=0; i<=7; i++) { if(pnp_generate_port(config,i)<0) @@ -745,7 +765,7 @@ static struct pnp_cfg * pnp_generate_config(struct pnp_dev *dev, int depnum) * finds the best resource configuration and then informs the correct pnp protocol */ -int pnp_activate_dev(struct pnp_dev *dev) +int pnp_activate_dev(struct pnp_dev *dev, struct pnp_res_cfg *template) { int depnum, max; struct pnp_cfg *config; @@ -754,7 +774,7 @@ int pnp_activate_dev(struct pnp_dev *dev) max = pnp_get_max_depnum(dev); if (dev->active) return -EBUSY; - if (dev->driver){ + if (pnp_dev_has_driver(dev)){ printk(KERN_INFO "pnp: Automatic configuration failed because the PnP device '%s' is busy\n", dev->dev.bus_id); return -EINVAL; } @@ -767,7 +787,7 @@ int pnp_activate_dev(struct pnp_dev *dev) config = pnp_generate_config(dev,depnum); if (!config) return -EINVAL; - if (pnp_generate_request(config)==0) + if (pnp_generate_request(dev,config,template)==0) goto done; kfree(config); } @@ -794,10 +814,12 @@ int pnp_disable_dev(struct pnp_dev *dev) { if (!dev) return -EINVAL; - if (dev->driver){ + if (pnp_dev_has_driver(dev)){ printk(KERN_INFO "pnp: Disable failed becuase the PnP device '%s' is busy\n", dev->dev.bus_id); return -EINVAL; } + if (dev->lock_resources) + return -EPERM; if (!dev->protocol->disable || !dev->active) return -EINVAL; pnp_dbg("the device '%s' has been disabled", dev->dev.bus_id); @@ -812,21 +834,21 @@ int pnp_disable_dev(struct pnp_dev *dev) * */ -int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode) +int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, struct pnp_res_cfg *template, int mode) { struct pnp_cfg *config; if (!dev) return -EINVAL; - config = pnp_generate_config(dev,depnum); - if (dev->driver){ - printk(KERN_INFO "pnp: Unable to set resources becuase the PnP device '%s' is busy\n", dev->dev.bus_id); + if (pnp_dev_has_driver(dev)){ + printk(KERN_INFO "pnp: Unable to set resources because the PnP device '%s' is busy\n", dev->dev.bus_id); return -EINVAL; } if (!dev->protocol->get || !dev->protocol->set) return -EINVAL; + config = pnp_generate_config(dev,depnum); if (!config) return -EINVAL; - if (pnp_generate_request(config)==0) + if (pnp_generate_request(dev,config,template)==0) goto done; kfree(config); printk(KERN_ERR "pnp: Manual configuration failed for device '%s' due to resource conflicts\n", dev->dev.bus_id); @@ -840,6 +862,23 @@ int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode) return 0; } +/** + * pnp_resource_change - change one resource + * @resource: pointer to resource to be changed + * @start: start of region + * @size: size of region + * + */ + +void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) +{ + if (resource == NULL) + return; + resource->flags &= ~IORESOURCE_AUTO; + resource->start = start; + resource->end = start + size - 1; +} + EXPORT_SYMBOL(pnp_build_resource); EXPORT_SYMBOL(pnp_find_resources); EXPORT_SYMBOL(pnp_get_max_depnum); @@ -848,9 +887,11 @@ EXPORT_SYMBOL(pnp_add_dma_resource); EXPORT_SYMBOL(pnp_add_port_resource); EXPORT_SYMBOL(pnp_add_mem_resource); EXPORT_SYMBOL(pnp_add_mem32_resource); +EXPORT_SYMBOL(pnp_init_res_cfg); EXPORT_SYMBOL(pnp_activate_dev); EXPORT_SYMBOL(pnp_disable_dev); EXPORT_SYMBOL(pnp_raw_set_dev); +EXPORT_SYMBOL(pnp_resource_change); /* format is: allowdma0 */ diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index ddfd46f701fc..18eefd83915e 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -58,6 +58,7 @@ obj-$(CONFIG_SCSI_AHA152X) += aha152x.o obj-$(CONFIG_SCSI_AHA1542) += aha1542.o obj-$(CONFIG_SCSI_AHA1740) += aha1740.o obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx/ +obj-$(CONFIG_SCSI_AIC79XX) += aic7xxx/ obj-$(CONFIG_SCSI_AACRAID) += aacraid/ obj-$(CONFIG_SCSI_AIC7XXX_OLD) += aic7xxx_old.o obj-$(CONFIG_SCSI_IPS) += ips.o diff --git a/drivers/scsi/aic7xxx/Kconfig.aic79xx b/drivers/scsi/aic7xxx/Kconfig.aic79xx index 0b6c04b23581..70b49a9ba691 100644 --- a/drivers/scsi/aic7xxx/Kconfig.aic79xx +++ b/drivers/scsi/aic7xxx/Kconfig.aic79xx @@ -1,6 +1,6 @@ # # AIC79XX 2.5.X Kernel configuration File. -# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#2 $ +# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#3 $ # config SCSI_AIC79XX tristate "Adaptec AIC79xx U320 support" @@ -76,20 +76,20 @@ config AIC79XX_DEBUG_ENABLE driver errors. config AIC79XX_DEBUG_MASK - int "Debug code enable mask (16383 for all debugging)" - depends on SCSI_AIC79XX - default "0" - help + int "Debug code enable mask (16383 for all debugging)" + depends on SCSI_AIC79XX + default "0" + help Bit mask of debug options that is only valid if the CONFIG_AIC79XX_DEBUG_ENBLE option is enabled. The bits in this mask are defined in the drivers/scsi/aic7xxx/aic79xx.h - search for the variable ahd_debug in that file to find them. config AIC79XX_REG_PRETTY_PRINT - bool "Decode registers during diagnostics" - depends on SCSI_AIC79XX && SCSI_AIC7XXX_BUILD_FIRMWARE + bool "Decode registers during diagnostics" + depends on SCSI_AIC79XX default y - help + help Compile in register value tables for the output of expanded register contents in diagnostics. This make it much easier to understand debug output without having to refer to a data book and/or the aic7xxx.reg diff --git a/drivers/scsi/aic7xxx/Kconfig.aic7xxx b/drivers/scsi/aic7xxx/Kconfig.aic7xxx index 9d9a9e4b02c7..869922fd34af 100644 --- a/drivers/scsi/aic7xxx/Kconfig.aic7xxx +++ b/drivers/scsi/aic7xxx/Kconfig.aic7xxx @@ -1,6 +1,6 @@ # # AIC7XXX and AIC79XX 2.5.X Kernel configuration File. -# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic7xxx#4 $ +# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic7xxx#5 $ # config SCSI_AIC7XXX tristate "Adaptec AIC7xxx Fast -> U160 support (New Driver)" @@ -92,7 +92,7 @@ config AIC7XXX_DEBUG_MASK config AIC7XXX_REG_PRETTY_PRINT bool "Decode registers during diagnostics" - depends on SCSI_AIC7XXX && SCSI_AIC7XXX_BUILD_FIRMWARE + depends on SCSI_AIC7XXX default y help Compile in register value tables for the output of expanded register diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c index 80d25528e95c..0646072850b9 100644 --- a/drivers/scsi/aic7xxx/aic7770_osm.c +++ b/drivers/scsi/aic7xxx/aic7770_osm.c @@ -36,7 +36,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_osm.c#11 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_osm.c#12 $ */ #include "aic7xxx_osm.h" @@ -61,8 +61,14 @@ aic7770_linux_probe(Scsi_Host_Template *template) uint32_t eisa_id; size_t id_size; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) if (check_region(eisaBase, AHC_EISA_IOSIZE) != 0) continue; + request_region(eisaBase, AHC_EISA_IOSIZE, "aic7xxx"); +#else + if (request_region(eisaBase, AHC_EISA_IOSIZE, "aic7xxx") != 0) + continue; +#endif eisa_id = 0; id_size = sizeof(eisa_id); @@ -72,6 +78,7 @@ aic7770_linux_probe(Scsi_Host_Template *template) eisa_id |= inb(eisaBase + IDOFFSET + i) << ((id_size-i-1) * 8); } + release_region(eisaBase, AHC_EISA_IOSIZE); if (eisa_id & 0x80000000) continue; /* no EISA card in slot */ diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 5c0951af77c6..a288ed9f9b3e 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#147 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#148 $ * * $FreeBSD$ */ @@ -3416,8 +3416,10 @@ reswitch: */ if (ahd->msgout_len != 0) { #ifdef AHD_DEBUG - if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) + if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) { + ahd_print_devinfo(ahd, &devinfo); printf("Asserting ATN for response\n"); + } #endif ahd_assert_atn(ahd); } @@ -7521,8 +7523,7 @@ ahd_stat_timer(void *arg) "now %sabled. Cmds %d\n", ahd_name(ahd), (enint_coal & ENINT_COALESS) ? "en" : "dis", - ahd->cmdcmplt_total, - ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket]); + ahd->cmdcmplt_total); #endif } diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 8fb69cd8f90f..02a7612a7efd 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1,7 +1,7 @@ /* * Adaptec AIC79xx device driver for Linux. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#100 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#103 $ * * -------------------------------------------------------------------------- * Copyright (c) 1994-2000 Justin T. Gibbs. @@ -1339,7 +1339,7 @@ Scsi_Host_Template aic79xx_driver_template = { */ .max_sectors = 8192, #endif -#if defined CONFIG_HIGHIO +#if defined CONFIG_HIGHIO || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18) /* Assume RedHat Distribution with its different HIGHIO conventions. */ .can_dma_32 = 1, @@ -2486,8 +2486,25 @@ ahd_linux_dv_thread(void *data) printf("In DV Thread\n"); #endif + /* + * Don't care about any signals. + */ + siginitsetinv(¤t->blocked, 0); + + /* + * Complete thread creation. + */ + lock_kernel(); + daemonize(); + sprintf(current->comm, "ahd_dv_%d", ahd->unit); + unlock_kernel(); + while (1) { - down(&ahd->platform_data->dv_sem); + /* + * Use down_interruptible() rather than down() to + * avoid inclusion in the load average. + */ + down_interruptible(&ahd->platform_data->dv_sem); /* Check to see if we've been signaled to exit */ ahd_lock(ahd, &s); @@ -2510,7 +2527,7 @@ ahd_linux_dv_thread(void *data) while (LIST_FIRST(&ahd->pending_scbs) != NULL) { ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_EMPTY; ahd_unlock(ahd, &s); - down(&ahd->platform_data->dv_sem); + down_interruptible(&ahd->platform_data->dv_sem); ahd_lock(ahd, &s); } @@ -2521,7 +2538,7 @@ ahd_linux_dv_thread(void *data) while (AHD_DV_SIMQ_FROZEN(ahd) == 0) { ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE; ahd_unlock(ahd, &s); - down(&ahd->platform_data->dv_sem); + down_interruptible(&ahd->platform_data->dv_sem); ahd_lock(ahd, &s); } ahd_unlock(ahd, &s); @@ -2623,6 +2640,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset) AHD_TRANS_GOAL, /*paused*/FALSE); ahd_unlock(ahd, &s); timeout = 10 * HZ; + targ->flags &= ~AHD_INQ_VALID; /* FALLTHROUGH */ case AHD_DV_STATE_INQ_VERIFY: { @@ -2686,7 +2704,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ahd_unlock(ahd, &s); #endif - down(&ahd->platform_data->dv_cmd_sem); + down_interruptible(&ahd->platform_data->dv_cmd_sem); /* * Wait for the SIMQ to be released so that DV is the * only reason the queue is frozen. @@ -2695,7 +2713,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset) while (AHD_DV_SIMQ_FROZEN(ahd) == 0) { ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE; ahd_unlock(ahd, &s); - down(&ahd->platform_data->dv_sem); + down_interruptible(&ahd->platform_data->dv_sem); ahd_lock(ahd, &s); } ahd_unlock(ahd, &s); @@ -2704,6 +2722,25 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset) } out: + if ((targ->flags & AHD_INQ_VALID) != 0 + && ahd_linux_get_device(ahd, devinfo.channel - 'A', + devinfo.target, devinfo.lun, + /*alloc*/FALSE) == NULL) { + /* + * The DV state machine failed to configure this device. + * This is normal if DV is disabled. Since we have inquiry + * data, filter it and use the "optimistic" negotiation + * parameters found in the inquiry string. + */ + ahd_linux_filter_inquiry(ahd, &devinfo); + if ((targ->flags & (AHD_BASIC_DV|AHD_ENHANCED_DV)) != 0) { + ahd_print_devinfo(ahd, &devinfo); + printf("DV failed to configure device. " + "Please file a bug report against " + "this driver.\n"); + } + } + if (cmd != NULL) free(cmd, M_DEVBUF); @@ -2789,24 +2826,21 @@ ahd_linux_dv_transition(struct ahd_softc *ahd, struct scsi_cmnd *cmd, break; } - if (ahd_linux_user_dv_setting(ahd) == 0) { - ahd_linux_filter_inquiry(ahd, devinfo); - AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_EXIT); + AHD_SET_DV_STATE(ahd, targ, targ->dv_state+1); + targ->flags |= AHD_INQ_VALID; + if (ahd_linux_user_dv_setting(ahd) == 0) break; - } spi3data = targ->inq_data->spi3data; switch (spi3data & SID_SPI_CLOCK_DT_ST) { default: case SID_SPI_CLOCK_ST: /* Assume only basic DV is supported. */ - ahd_linux_filter_inquiry(ahd, devinfo); - AHD_SET_DV_STATE(ahd, targ, - AHD_DV_STATE_INQ_VERIFY); + targ->flags |= AHD_BASIC_DV; break; case SID_SPI_CLOCK_DT: case SID_SPI_CLOCK_DT_ST: - AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_REBD); + targ->flags |= AHD_ENHANCED_DV; break; } break; @@ -2902,8 +2936,15 @@ ahd_linux_dv_transition(struct ahd_softc *ahd, struct scsi_cmnd *cmd, case AHD_DV_STATE_TUR: switch (status & SS_MASK) { case SS_NOP: - AHD_SET_DV_STATE(ahd, targ, - AHD_DV_STATE_INQ_ASYNC); + if ((targ->flags & AHD_BASIC_DV) != 0) { + ahd_linux_filter_inquiry(ahd, devinfo); + AHD_SET_DV_STATE(ahd, targ, + AHD_DV_STATE_INQ_VERIFY); + } else if ((targ->flags & AHD_ENHANCED_DV) != 0) { + AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_REBD); + } else { + AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_EXIT); + } break; case SS_RETRY: case SS_TUR: diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h index 46d34b111c53..a3377dcc6f50 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/drivers/scsi/aic7xxx/aic79xx_osm.h @@ -36,7 +36,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#96 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#99 $ * */ #ifndef _AIC79XX_LINUX_H_ @@ -48,6 +48,7 @@ #include <linux/delay.h> #include <linux/ioport.h> #include <linux/pci.h> +#include <linux/smp_lock.h> #include <linux/version.h> #ifndef AHD_MODVERSION_FILE #define __NO_VERSION__ @@ -287,7 +288,7 @@ ahd_scb_timer_reset(struct scb *scb, u_int usec) #include <linux/smp.h> #endif -#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA5" +#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA6" /**************************** Front End Queues ********************************/ /* @@ -424,16 +425,19 @@ struct ahd_linux_device { }; typedef enum { - AHD_DV_REQUIRED = 0x01 + AHD_DV_REQUIRED = 0x01, + AHD_INQ_VALID = 0x02, + AHD_BASIC_DV = 0x04, + AHD_ENHANCED_DV = 0x08 } ahd_linux_targ_flags; /* DV States */ typedef enum { AHD_DV_STATE_EXIT = 0, AHD_DV_STATE_INQ_SHORT_ASYNC, - AHD_DV_STATE_TUR, AHD_DV_STATE_INQ_ASYNC, AHD_DV_STATE_INQ_ASYNC_VERIFY, + AHD_DV_STATE_TUR, AHD_DV_STATE_REBD, AHD_DV_STATE_INQ_VERIFY, AHD_DV_STATE_WEB, diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c index fe598eba390d..115fcbf89e65 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c @@ -36,7 +36,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#18 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#19 $ */ #include "aic79xx_osm.h" @@ -240,10 +240,8 @@ ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, u_long *base, if (check_region(*base, 256) != 0 || check_region(*base2, 256) != 0) return (ENOMEM); - else { - request_region(*base, 256, "aic79xx"); - request_region(*base2, 256, "aic79xx"); - } + request_region(*base, 256, "aic79xx"); + request_region(*base2, 256, "aic79xx"); #else if (request_region(*base, 256, "aic79xx") == 0) return (ENOMEM); diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index d67bed4e6795..a69c1194203e 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#104 $ + * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#105 $ * * $FreeBSD$ */ @@ -2772,9 +2772,12 @@ reswitch: */ if (ahc->msgout_len != 0) { #ifdef AHC_DEBUG - if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) + if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) { + ahc_print_devinfo(ahc, &devinfo); printf("Asserting ATN for response\n"); + } #endif + ahc_assert_atn(ahc); } } else ahc->msgin_index++; diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 69f6593b6072..e8e2a4e91527 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -1,7 +1,7 @@ /* * Adaptec AIC7xxx device driver for Linux. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#163 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#166 $ * * Copyright (c) 1994 John Aycock * The University of Calgary Department of Computer Science. @@ -2336,8 +2336,25 @@ ahc_linux_dv_thread(void *data) printf("Launching DV Thread\n"); #endif + /* + * Don't care about any signals. + */ + siginitsetinv(¤t->blocked, 0); + + /* + * Complete thread creation. + */ + lock_kernel(); + daemonize(); + sprintf(current->comm, "ahc_dv_%d", ahc->unit); + unlock_kernel(); + while (1) { - down(&ahc->platform_data->dv_sem); + /* + * Use down_interruptible() rather than down() to + * avoid inclusion in the load average. + */ + down_interruptible(&ahc->platform_data->dv_sem); /* Check to see if we've been signaled to exit */ ahc_lock(ahc, &s); @@ -2360,7 +2377,7 @@ ahc_linux_dv_thread(void *data) while (LIST_FIRST(&ahc->pending_scbs) != NULL) { ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_EMPTY; ahc_unlock(ahc, &s); - down(&ahc->platform_data->dv_sem); + down_interruptible(&ahc->platform_data->dv_sem); ahc_lock(ahc, &s); } @@ -2371,7 +2388,7 @@ ahc_linux_dv_thread(void *data) while (AHC_DV_SIMQ_FROZEN(ahc) == 0) { ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE; ahc_unlock(ahc, &s); - down(&ahc->platform_data->dv_sem); + down_interruptible(&ahc->platform_data->dv_sem); ahc_lock(ahc, &s); } ahc_unlock(ahc, &s); @@ -2473,6 +2490,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset) AHC_TRANS_GOAL, /*paused*/FALSE); ahc_unlock(ahc, &s); timeout = 10 * HZ; + targ->flags &= ~AHC_INQ_VALID; /* FALLTHROUGH */ case AHC_DV_STATE_INQ_VERIFY: { @@ -2536,7 +2554,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ahc_unlock(ahc, &s); #endif - down(&ahc->platform_data->dv_cmd_sem); + down_interruptible(&ahc->platform_data->dv_cmd_sem); /* * Wait for the SIMQ to be released so that DV is the * only reason the queue is frozen. @@ -2545,7 +2563,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset) while (AHC_DV_SIMQ_FROZEN(ahc) == 0) { ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE; ahc_unlock(ahc, &s); - down(&ahc->platform_data->dv_sem); + down_interruptible(&ahc->platform_data->dv_sem); ahc_lock(ahc, &s); } ahc_unlock(ahc, &s); @@ -2554,6 +2572,25 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset) } out: + if ((targ->flags & AHC_INQ_VALID) != 0 + && ahc_linux_get_device(ahc, devinfo.channel - 'A', + devinfo.target, devinfo.lun, + /*alloc*/FALSE) == NULL) { + /* + * The DV state machine failed to configure this device. + * This is normal if DV is disabled. Since we have inquiry + * data, filter it and use the "optimistic" negotiation + * parameters found in the inquiry string. + */ + ahc_linux_filter_inquiry(ahc, &devinfo); + if ((targ->flags & (AHC_BASIC_DV|AHC_ENHANCED_DV)) != 0) { + ahc_print_devinfo(ahc, &devinfo); + printf("DV failed to configure device. " + "Please file a bug report against " + "this driver.\n"); + } + } + if (cmd != NULL) free(cmd, M_DEVBUF); @@ -2639,24 +2676,21 @@ ahc_linux_dv_transition(struct ahc_softc *ahc, struct scsi_cmnd *cmd, break; } - if (ahc_linux_user_dv_setting(ahc) == 0) { - ahc_linux_filter_inquiry(ahc, devinfo); - AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT); + AHC_SET_DV_STATE(ahc, targ, targ->dv_state+1); + targ->flags |= AHC_INQ_VALID; + if (ahc_linux_user_dv_setting(ahc) == 0) break; - } spi3data = targ->inq_data->spi3data; switch (spi3data & SID_SPI_CLOCK_DT_ST) { default: case SID_SPI_CLOCK_ST: /* Assume only basic DV is supported. */ - ahc_linux_filter_inquiry(ahc, devinfo); - AHC_SET_DV_STATE(ahc, targ, - AHC_DV_STATE_INQ_VERIFY); + targ->flags |= AHC_BASIC_DV; break; case SID_SPI_CLOCK_DT: case SID_SPI_CLOCK_DT_ST: - AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_REBD); + targ->flags |= AHC_ENHANCED_DV; break; } break; @@ -2752,8 +2786,15 @@ ahc_linux_dv_transition(struct ahc_softc *ahc, struct scsi_cmnd *cmd, case AHC_DV_STATE_TUR: switch (status & SS_MASK) { case SS_NOP: - AHC_SET_DV_STATE(ahc, targ, - AHC_DV_STATE_INQ_ASYNC); + if ((targ->flags & AHC_BASIC_DV) != 0) { + ahc_linux_filter_inquiry(ahc, devinfo); + AHC_SET_DV_STATE(ahc, targ, + AHC_DV_STATE_INQ_VERIFY); + } else if ((targ->flags & AHC_ENHANCED_DV) != 0) { + AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_REBD); + } else { + AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT); + } break; case SS_RETRY: case SS_TUR: @@ -4373,6 +4414,17 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, memset(&cmd->sense_buffer[sense_size], 0, sizeof(cmd->sense_buffer) - sense_size); cmd->result |= (DRIVER_SENSE << 24); +#ifdef AHC_DEBUG + if (ahc_debug & AHC_SHOW_SENSE) { + int i; + + printf("Copied %d bytes of sense data:", + sense_size); + for (i = 0; i < sense_size; i++) + printf(" 0x%x", cmd->sense_buffer[i]); + printf("\n"); + } +#endif } break; } diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index 65ff6384a9a4..3e8f383baf9d 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h @@ -53,7 +53,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#111 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#114 $ * */ #ifndef _AIC7XXX_LINUX_H_ @@ -65,6 +65,7 @@ #include <linux/delay.h> #include <linux/ioport.h> #include <linux/pci.h> +#include <linux/smp_lock.h> #include <linux/version.h> #ifndef AHC_MODVERSION_FILE #define __NO_VERSION__ @@ -300,7 +301,7 @@ ahc_scb_timer_reset(struct scb *scb, u_int usec) #include <linux/smp.h> #endif -#define AIC7XXX_DRIVER_VERSION "6.2.24" +#define AIC7XXX_DRIVER_VERSION "6.2.25" /**************************** Front End Queues ********************************/ /* @@ -437,16 +438,19 @@ struct ahc_linux_device { }; typedef enum { - AHC_DV_REQUIRED = 0x01 + AHC_DV_REQUIRED = 0x01, + AHC_INQ_VALID = 0x02, + AHC_BASIC_DV = 0x04, + AHC_ENHANCED_DV = 0x08 } ahc_linux_targ_flags; /* DV States */ typedef enum { AHC_DV_STATE_EXIT = 0, AHC_DV_STATE_INQ_SHORT_ASYNC, - AHC_DV_STATE_TUR, AHC_DV_STATE_INQ_ASYNC, AHC_DV_STATE_INQ_ASYNC_VERIFY, + AHC_DV_STATE_TUR, AHC_DV_STATE_REBD, AHC_DV_STATE_INQ_VERIFY, AHC_DV_STATE_WEB, diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 05b12228dc10..fcc865041b62 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -36,7 +36,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#41 $ + * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#42 $ */ #include "aic7xxx_osm.h" @@ -232,8 +232,7 @@ ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) if (check_region(*base, 256) != 0) return (ENOMEM); - else - request_region(*base, 256, "aic7xxx"); + request_region(*base, 256, "aic7xxx"); #else if (request_region(*base, 256, "aic7xxx") == 0) return (ENOMEM); diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c index 2e766b85c1aa..f1f448dff569 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#23 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#24 $ * * $FreeBSD$ */ @@ -546,7 +546,7 @@ symtable_dump(FILE *ofile, FILE *dfile) if (num_entries == 0) aic_print_reg_dump_start(dfile, curnode); - else + else if (dfile != NULL) fputs(",\n", dfile); num_entries++; aic_print_reg_dump_entry(dfile, fieldnode); diff --git a/drivers/scsi/aic7xxx/aiclib.c b/drivers/scsi/aic7xxx/aiclib.c index 50270d5483fd..8b9929c58927 100644 --- a/drivers/scsi/aic7xxx/aiclib.c +++ b/drivers/scsi/aic7xxx/aiclib.c @@ -541,12 +541,18 @@ static struct asc_table_entry asc_table[] = { "Rounded parameter") }, /* DTL WRSOMCAE */{SST(0x39, 0x00, SS_RDEF, "Saving parameters not supported") }, -/* DTL WRSOM */{SST(0x3A, 0x00, SS_FATAL|ENXIO, +/* DTL WRSOM */{SST(0x3A, 0x00, SS_NOP, "Medium not present") }, -/* DT WR OM */{SST(0x3A, 0x01, SS_FATAL|ENXIO, +/* DT WR OM */{SST(0x3A, 0x01, SS_NOP, "Medium not present - tray closed") }, -/* DT WR OM */{SST(0x3A, 0x02, SS_FATAL|ENXIO, +/* DT WR OM */{SST(0x3A, 0x01, SS_NOP, "Medium not present - tray open") }, +/* DT WR OM */{SST(0x3A, 0x03, SS_NOP, + "Medium not present - Loadable") }, +/* DT WR OM */{SST(0x3A, 0x04, SS_NOP, + "Medium not present - medium auxiliary " + "memory accessible") }, +/* DT WR OM */{SST(0x3A, 0xFF, SS_NOP, NULL) },/* Range 0x05->0xFF */ /* TL */{SST(0x3B, 0x00, SS_RDEF, "Sequential positioning error") }, /* T */{SST(0x3B, 0x01, SS_RDEF, diff --git a/drivers/scsi/aic7xxx/aiclib.h b/drivers/scsi/aic7xxx/aiclib.h index c13774fedac2..a06167a85fa7 100644 --- a/drivers/scsi/aic7xxx/aiclib.h +++ b/drivers/scsi/aic7xxx/aiclib.h @@ -827,12 +827,16 @@ extern const char *scsi_sense_key_text[]; /************************* Large Disk Handling ********************************/ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +static __inline int aic_sector_div(u_long capacity, int heads, int sectors); + static __inline int aic_sector_div(u_long capacity, int heads, int sectors) { return (capacity / (heads * sectors)); } #else +static __inline int aic_sector_div(sector_t capacity, int heads, int sectors); + static __inline int aic_sector_div(sector_t capacity, int heads, int sectors) { diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 70da49bc0372..f7a944485be2 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c @@ -309,13 +309,8 @@ static Scsi_Host_Template *the_template = NULL; #undef TAG_NONE #define TAG_NONE 0xff -/* For the m68k, the number of bits in 'allocated' must be a multiple of 32! */ -#if (MAX_TAGS % 32) != 0 -#error "MAX_TAGS must be a multiple of 32!" -#endif - typedef struct { - long allocated[MAX_TAGS/32]; + DECLARE_BITMAP(allocated, MAX_TAGS); int nr_allocated; int queue_size; } TAG_ALLOC; @@ -334,7 +329,7 @@ static void __init init_tags( void ) for( target = 0; target < 8; ++target ) { for( lun = 0; lun < 8; ++lun ) { ta = &TagAlloc[target][lun]; - memset( &ta->allocated, 0, MAX_TAGS/8 ); + CLEAR_BITMAP( ta->allocated, MAX_TAGS ); ta->nr_allocated = 0; /* At the beginning, assume the maximum queue size we could * support (MAX_TAGS). This value will be decreased if the target @@ -394,8 +389,8 @@ static void cmd_get_tag( Scsi_Cmnd *cmd, int should_be_tagged ) else { TAG_ALLOC *ta = &TagAlloc[cmd->target][cmd->lun]; - cmd->tag = find_first_zero_bit( &ta->allocated, MAX_TAGS ); - set_bit( cmd->tag, &ta->allocated ); + cmd->tag = find_first_zero_bit( ta->allocated, MAX_TAGS ); + set_bit( cmd->tag, ta->allocated ); ta->nr_allocated++; TAG_PRINTK( "scsi%d: using tag %d for target %d lun %d " "(now %d tags in use)\n", @@ -424,7 +419,7 @@ static void cmd_free_tag( Scsi_Cmnd *cmd ) } else { TAG_ALLOC *ta = &TagAlloc[cmd->target][cmd->lun]; - clear_bit( cmd->tag, &ta->allocated ); + clear_bit( cmd->tag, ta->allocated ); ta->nr_allocated--; TAG_PRINTK( "scsi%d: freed tag %d for target %d lun %d\n", H_NO(cmd), cmd->tag, cmd->target, cmd->lun ); @@ -443,7 +438,7 @@ static void free_all_tags( void ) for( target = 0; target < 8; ++target ) { for( lun = 0; lun < 8; ++lun ) { ta = &TagAlloc[target][lun]; - memset( &ta->allocated, 0, MAX_TAGS/8 ); + CLEAR_BITMAP( ta->allocated, MAX_TAGS ); ta->nr_allocated = 0; } } diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 283998c0c6d5..eb24cfde6960 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1738,7 +1738,7 @@ static int mega_driver_ioctl (mega_host_config * megaCfg, Scsi_Cmnd * SCpnt) return 1; } -static void inline set_mbox_xfer_addr (mega_host_config * megaCfg, mega_scb * pScb, +static inline void set_mbox_xfer_addr (mega_host_config * megaCfg, mega_scb * pScb, mega_ioctl_mbox * mbox, u32 direction) { diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index dc4399609d44..0eaded61130b 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -2134,7 +2134,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp) * /proc fs routines.... */ -static int inline line_info(char *buf, struct serial_state *state) +static inline int line_info(char *buf, struct serial_state *state) { #ifdef notdef struct async_struct *info = state->info, scr_info; diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index aa599f3385d2..63f8871a2ae9 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c @@ -313,7 +313,7 @@ static const struct pnp_device_id pnp_dev_table[] = { MODULE_DEVICE_TABLE(pnp, pnp_dev_table); -static void inline avoid_irq_share(struct pnp_dev *dev) +static inline void avoid_irq_share(struct pnp_dev *dev) { unsigned int map = 0x1FF8; struct pnp_irq *irq; @@ -360,7 +360,7 @@ static int serial_pnp_guess_board(struct pnp_dev *dev, int *flags) struct pnp_resources *res = dev->res; struct pnp_resources *resa; - if (!(check_name(dev->name) || check_name(dev->card->name))) + if (!(check_name(dev->name) || (dev->card && check_name(dev->card->name)))) return -ENODEV; if (!res) @@ -385,8 +385,11 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id) { struct serial_struct serial_req; int ret, line, flags = dev_id->driver_data; - if (flags & UNKNOWN_DEV) + if (flags & UNKNOWN_DEV) { ret = serial_pnp_guess_board(dev, &flags); + if (ret < 0) + return ret; + } if (flags & SPCI_FL_NO_SHIRQ) avoid_irq_share(dev); memset(&serial_req, 0, sizeof(serial_req)); diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 624beac700b4..bc59f1c31e6a 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -346,7 +346,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) /* FALLTHROUGH */ case DeviceOutRequest | USB_REQ_CLEAR_FEATURE: case DeviceOutRequest | USB_REQ_SET_FEATURE: - dbg ("no device features yet yet"); + dev_dbg (*hcd->controller, "no device features yet yet\n"); break; case DeviceRequest | USB_REQ_GET_CONFIGURATION: ubuf [0] = 1; @@ -404,7 +404,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) /* FALLTHROUGH */ case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: case EndpointOutRequest | USB_REQ_SET_FEATURE: - dbg ("no endpoint features yet"); + dev_dbg (*hcd->controller, "no endpoint features yet\n"); break; /* CLASS REQUESTS (and errors) */ @@ -418,12 +418,12 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) error: /* "protocol stall" on error */ urb->status = -EPIPE; - dbg ("unsupported hub control message (maxchild %d)", + dev_dbg (*hcd->controller, "unsupported hub control message (maxchild %d)\n", urb->dev->maxchild); } if (urb->status) { urb->actual_length = 0; - dbg ("CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d", + dev_dbg (*hcd->controller, "CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d\n", typeReq, wValue, wIndex, wLength, urb->status); } if (bufp) { @@ -456,7 +456,7 @@ static int rh_status_urb (struct usb_hcd *hcd, struct urb *urb) if (timer_pending (&hcd->rh_timer) || urb->status != -EINPROGRESS || urb->transfer_buffer_length < len) { - dbg ("not queuing status urb, stat %d", urb->status); + dev_dbg (*hcd->controller, "not queuing status urb, stat %d\n", urb->status); return -EINVAL; } @@ -667,7 +667,7 @@ void usb_register_bus(struct usb_bus *bus) usbfs_add_bus (bus); - info ("new USB bus registered, assigned bus number %d", bus->busnum); + dev_info (*bus->controller, "new USB bus registered, assigned bus number %d\n", bus->busnum); } EXPORT_SYMBOL (usb_register_bus); @@ -681,7 +681,7 @@ EXPORT_SYMBOL (usb_register_bus); */ void usb_deregister_bus (struct usb_bus *bus) { - info ("USB bus %d deregistered", bus->busnum); + dev_info (*bus->controller, "USB bus %d deregistered\n", bus->busnum); /* * NOTE: make sure that all the devices are removed by the @@ -824,7 +824,7 @@ int usb_check_bandwidth (struct usb_device *dev, struct urb *urb) #else "would have "; #endif - dbg ("usb_check_bandwidth %sFAILED: %d + %ld = %d usec", + dev_dbg (dev->dev, "usb_check_bandwidth %sFAILED: %d + %ld = %d usec\n", mode, old_alloc, bustime, new_alloc); #endif #ifdef CONFIG_USB_BANDWIDTH @@ -863,7 +863,7 @@ void usb_claim_bandwidth (struct usb_device *dev, struct urb *urb, int bustime, urb->bandwidth = bustime; #ifdef USB_BANDWIDTH_MESSAGES - dbg ("bandwidth alloc increased by %d (%s) to %d for %d requesters", + dev_dbg (dev->dev, "bandwidth alloc increased by %d (%s) to %d for %d requesters\n", bustime, isoc ? "ISOC" : "INTR", dev->bus->bandwidth_allocated, @@ -892,7 +892,7 @@ void usb_release_bandwidth (struct usb_device *dev, struct urb *urb, int isoc) dev->bus->bandwidth_int_reqs--; #ifdef USB_BANDWIDTH_MESSAGES - dbg ("bandwidth alloc reduced by %d (%s) to %d for %d requesters", + dev_dbg (dev->dev, "bandwidth alloc reduced by %d (%s) to %d for %d requesters\n", urb->bandwidth, isoc ? "ISOC" : "INTR", dev->bus->bandwidth_allocated, @@ -1153,7 +1153,7 @@ static int hcd_unlink_urb (struct urb *urb) */ if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) { if (in_interrupt ()) { - dbg ("non-async unlink in_interrupt"); + dev_dbg (*hcd->controller, "non-async unlink in_interrupt"); retval = -EWOULDBLOCK; goto done; } @@ -1233,7 +1233,7 @@ static int hcd_free_dev (struct usb_device *udev) /* device driver problem with refcounts? */ if (!list_empty (&dev->urb_list)) { - dbg ("free busy dev, %s devnum %d (bug!)", + dev_dbg (*hcd->controller, "free busy dev, %s devnum %d (bug!)\n", hcd->self.bus_name, udev->devnum); return -EINVAL; } @@ -1339,6 +1339,12 @@ EXPORT_SYMBOL (usb_hcd_irq); /*-------------------------------------------------------------------------*/ +static void hcd_panic (void *_hcd) +{ + struct usb_hcd *hcd = _hcd; + hcd->driver->stop (hcd); +} + /** * usb_hc_died - report abnormal shutdown of a host controller (bus glue) * @hcd: pointer to the HCD representing the controller @@ -1360,7 +1366,7 @@ void usb_hc_died (struct usb_hcd *hcd) dev = list_entry (devlist, struct hcd_dev, dev_list); list_for_each (urblist, &dev->urb_list) { urb = list_entry (urblist, struct urb, urb_list); - dbg ("shutdown %s urb %p pipe %x, current status %d", + dev_dbg (*hcd->controller, "shutdown %s urb %p pipe %x, current status %d\n", hcd->self.bus_name, urb, urb->pipe, urb->status); if (urb->status == -EINPROGRESS) urb->status = -ESHUTDOWN; @@ -1371,9 +1377,9 @@ void usb_hc_died (struct usb_hcd *hcd) urb->status = -ESHUTDOWN; spin_unlock_irqrestore (&hcd_data_lock, flags); - if (urb) - usb_rh_status_dequeue (hcd, urb); - hcd->driver->stop (hcd); + /* hcd->stop() needs a task context */ + INIT_WORK (&hcd->work, hcd_panic, hcd); + (void) schedule_work (&hcd->work); } EXPORT_SYMBOL (usb_hc_died); diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 99cb0f4b2c84..a3d924e2e34c 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h @@ -67,6 +67,7 @@ struct usb_hcd { /* usb_bus.hcpriv points to this */ struct timer_list rh_timer; /* drives root hub */ struct list_head dev_list; /* devices on this bus */ + struct work_struct work; /* * hardware info/state diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d013ec009f87..d185edba0fa6 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -263,7 +263,8 @@ static void usb_hub_power_on(struct usb_hub *hub) int i; /* Enable power to the ports */ - dbg("enabling power on all ports"); + dev_dbg(*hubdev(interface_to_usbdev(hub->intf)), + "enabling power on all ports\n"); dev = interface_to_usbdev(hub->intf); for (i = 0; i < hub->descriptor->bNbrPorts; i++) usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER); @@ -276,6 +277,7 @@ static int usb_hub_configure(struct usb_hub *hub, struct usb_endpoint_descriptor *endpoint) { struct usb_device *dev = interface_to_usbdev (hub->intf); + struct device *hub_dev; struct usb_hub_status hubstatus; unsigned int pipe; int maxp, ret; @@ -303,8 +305,9 @@ static int usb_hub_configure(struct usb_hub *hub, goto fail; } + hub_dev = hubdev(dev); dev->maxchild = hub->descriptor->bNbrPorts; - dev_info (*hubdev (dev), "%d port%s detected\n", dev->maxchild, + dev_info (*hub_dev, "%d port%s detected\n", dev->maxchild, (dev->maxchild == 1) ? "" : "s"); le16_to_cpus(&hub->descriptor->wHubCharacteristics); @@ -318,33 +321,33 @@ static int usb_hub_configure(struct usb_hub *hub, [((i + 1) / 8)] & (1 << ((i + 1) % 8)) ? 'F' : 'R'; portstr[dev->maxchild] = 0; - dbg("compound device; port removable status: %s", portstr); + dev_dbg(*hub_dev, "compound device; port removable status: %s\n", portstr); } else - dbg("standalone hub"); + dev_dbg(*hub_dev, "standalone hub\n"); switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) { case 0x00: - dbg("ganged power switching"); + dev_dbg(*hub_dev, "ganged power switching\n"); break; case 0x01: - dbg("individual port power switching"); + dev_dbg(*hub_dev, "individual port power switching\n"); break; case 0x02: case 0x03: - dbg("unknown reserved power switching mode"); + dev_dbg(*hub_dev, "unknown reserved power switching mode\n"); break; } switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_OCPM) { case 0x00: - dbg("global over-current protection"); + dev_dbg(*hub_dev, "global over-current protection\n"); break; case 0x08: - dbg("individual port over-current protection"); + dev_dbg(*hub_dev, "individual port over-current protection\n"); break; case 0x10: case 0x18: - dbg("no over-current protection"); + dev_dbg(*hub_dev, "no over-current protection\n"); break; } @@ -355,16 +358,16 @@ static int usb_hub_configure(struct usb_hub *hub, case 0: break; case 1: - dbg("Single TT"); + dev_dbg(*hub_dev, "Single TT\n"); hub->tt.hub = dev; break; case 2: - dbg("TT per port"); + dev_dbg(*hub_dev, "TT per port\n"); hub->tt.hub = dev; hub->tt.multi = 1; break; default: - dbg("Unrecognized hub protocol %d", + dev_dbg(*hub_dev, "Unrecognized hub protocol %d\n", dev->descriptor.bDeviceProtocol); break; } @@ -372,26 +375,26 @@ static int usb_hub_configure(struct usb_hub *hub, switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_TTTT) { case 0x00: if (dev->descriptor.bDeviceProtocol != 0) - dbg("TT requires at most 8 FS bit times"); + dev_dbg(*hub_dev, "TT requires at most 8 FS bit times\n"); break; case 0x20: - dbg("TT requires at most 16 FS bit times"); + dev_dbg(*hub_dev, "TT requires at most 16 FS bit times\n"); break; case 0x40: - dbg("TT requires at most 24 FS bit times"); + dev_dbg(*hub_dev, "TT requires at most 24 FS bit times\n"); break; case 0x60: - dbg("TT requires at most 32 FS bit times"); + dev_dbg(*hub_dev, "TT requires at most 32 FS bit times\n"); break; } - dbg("Port indicators are %s supported", + dev_dbg(*hub_dev, "Port indicators are %s supported\n", (hub->descriptor->wHubCharacteristics & HUB_CHAR_PORTIND) ? "" : "not"); - dbg("power on to power good time: %dms", + dev_dbg(*hub_dev, "power on to power good time: %dms\n", hub->descriptor->bPwrOn2PwrGood * 2); - dbg("hub controller current requirement: %dmA", + dev_dbg(*hub_dev, "hub controller current requirement: %dmA\n", hub->descriptor->bHubContrCurrent); ret = usb_get_hub_status(dev, &hubstatus); @@ -402,11 +405,11 @@ static int usb_hub_configure(struct usb_hub *hub, le16_to_cpus(&hubstatus.wHubStatus); - dbg("local power source is %s", + dev_dbg(*hub_dev, "local power source is %s\n", (hubstatus.wHubStatus & HUB_STATUS_LOCAL_POWER) ? "lost (inactive)" : "good"); - dbg("%sover-current condition exists", + dev_dbg(*hub_dev, "%sover-current condition exists\n", (hubstatus.wHubStatus & HUB_STATUS_OVERCURRENT) ? "" : "no "); /* Start the interrupt endpoint */ diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index c367260c4d98..1ca898312c5e 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -84,19 +84,19 @@ int usb_device_probe(struct device *dev) const struct usb_device_id *id; int error = -ENODEV; - dbg("%s", __FUNCTION__); + dev_dbg(*dev, "%s\n", __FUNCTION__); if (!driver->probe) return error; if (!try_module_get(driver->owner)) { - err ("Can't get a module reference for %s", driver->name); + dev_err (*dev, "Can't get a module reference for %s\n", driver->name); return error; } id = usb_match_id (intf, driver->id_table); if (id) { - dbg ("%s - got id", __FUNCTION__); + dev_dbg (*dev, "%s - got id\n", __FUNCTION__); down (&driver->serialize); error = driver->probe (intf, id); up (&driver->serialize); @@ -118,7 +118,7 @@ int usb_device_remove(struct device *dev) driver = to_usb_driver(dev->driver); if (!driver) { - err("%s does not have a valid driver to work with!", + dev_err(*dev, "%s does not have a valid driver to work with!", __FUNCTION__); return -ENODEV; } @@ -126,7 +126,7 @@ int usb_device_remove(struct device *dev) if (!try_module_get(driver->owner)) { // FIXME this happens even when we just rmmod // drivers that aren't in active use... - err("Dieing driver still bound to device.\n"); + dev_err(*dev, "Dieing driver still bound to device.\n"); return -EIO; } @@ -1042,7 +1042,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) wait_ms(200); } if (err < 0) { - err("USB device not accepting new address=%d (error=%d)", + dev_err(dev->dev, "USB device not accepting new address=%d (error=%d)\n", dev->devnum, err); clear_bit(dev->devnum, dev->bus->devmap.devicemap); dev->devnum = -1; @@ -1060,9 +1060,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent) if (err < 8) { if (err < 0) - err("USB device not responding, giving up (error=%d)", err); + dev_err(dev->dev, "USB device not responding, giving up (error=%d)\n", err); else - err("USB device descriptor short read (expected %i, got %i)", 8, err); + dev_err(dev->dev, "USB device descriptor short read (expected %i, got %i)\n", 8, err); clear_bit(dev->devnum, dev->bus->devmap.devicemap); dev->devnum = -1; return 1; @@ -1077,9 +1077,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent) err = usb_get_device_descriptor(dev); if (err < (signed)sizeof(dev->descriptor)) { if (err < 0) - err("unable to get device descriptor (error=%d)", err); + dev_err(dev->dev, "unable to get device descriptor (error=%d)\n", err); else - err("USB device descriptor short read (expected %Zi, got %i)", + dev_err(dev->dev, "USB device descriptor short read (expected %Zi, got %i)\n", sizeof(dev->descriptor), err); clear_bit(dev->devnum, dev->bus->devmap.devicemap); @@ -1089,7 +1089,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) err = usb_get_configuration(dev); if (err < 0) { - err("unable to get device %d configuration (error=%d)", + dev_err(dev->dev, "unable to get device %d configuration (error=%d)\n", dev->devnum, err); clear_bit(dev->devnum, dev->bus->devmap.devicemap); dev->devnum = -1; @@ -1099,7 +1099,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) /* we set the default configuration here */ err = usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue); if (err) { - err("failed to set device %d default configuration (error=%d)", + dev_err(dev->dev, "failed to set device %d default configuration (error=%d)\n", dev->devnum, err); clear_bit(dev->devnum, dev->bus->devmap.devicemap); dev->devnum = -1; @@ -1151,7 +1151,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) dev->bus->bus_name, dev->devpath, desc->bInterfaceNumber); } - dbg ("%s - registering %s", __FUNCTION__, interface->dev.bus_id); + dev_dbg (dev->dev, "%s - registering interface %s\n", __FUNCTION__, interface->dev.bus_id); device_add (&interface->dev); usb_create_driverfs_intf_files (interface); } diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c index 0e0362bedb13..5ab762bd73b3 100644 --- a/drivers/usb/host/ohci-dbg.c +++ b/drivers/usb/host/ohci-dbg.c @@ -73,9 +73,9 @@ urb_print (struct urb * urb, char * str, int small) #endif } -static void ohci_dump_intr_mask (char *label, __u32 mask) +static void ohci_dump_intr_mask (struct device *dev, char *label, __u32 mask) { - dbg ("%s: 0x%08x%s%s%s%s%s%s%s%s%s", + dev_dbg (*dev, "%s: 0x%08x%s%s%s%s%s%s%s%s%s\n", label, mask, (mask & OHCI_INTR_MIE) ? " MIE" : "", @@ -90,10 +90,10 @@ static void ohci_dump_intr_mask (char *label, __u32 mask) ); } -static void maybe_print_eds (char *label, __u32 value) +static void maybe_print_eds (struct device *dev, char *label, __u32 value) { if (value) - dbg ("%s %08x", label, value); + dev_dbg (*dev, "%s %08x\n", label, value); } static char *hcfs2string (int state) @@ -111,15 +111,16 @@ static char *hcfs2string (int state) static void ohci_dump_status (struct ohci_hcd *controller) { struct ohci_regs *regs = controller->regs; + struct device *dev = controller->hcd.controller; __u32 temp; temp = readl (®s->revision) & 0xff; - dbg ("OHCI %d.%d, %s legacy support registers", + dev_dbg (*dev, "OHCI %d.%d, %s legacy support registers\n", 0x03 & (temp >> 4), (temp & 0x0f), (temp & 0x10) ? "with" : "NO"); temp = readl (®s->control); - dbg ("control: 0x%08x%s%s%s HCFS=%s%s%s%s%s CBSR=%d", temp, + dev_dbg (*dev, "control: 0x%08x%s%s%s HCFS=%s%s%s%s%s CBSR=%d\n", temp, (temp & OHCI_CTRL_RWE) ? " RWE" : "", (temp & OHCI_CTRL_RWC) ? " RWC" : "", (temp & OHCI_CTRL_IR) ? " IR" : "", @@ -132,7 +133,7 @@ static void ohci_dump_status (struct ohci_hcd *controller) ); temp = readl (®s->cmdstatus); - dbg ("cmdstatus: 0x%08x SOC=%d%s%s%s%s", temp, + dev_dbg (*dev, "cmdstatus: 0x%08x SOC=%d%s%s%s%s\n", temp, (temp & OHCI_SOC) >> 16, (temp & OHCI_OCR) ? " OCR" : "", (temp & OHCI_BLF) ? " BLF" : "", @@ -140,20 +141,20 @@ static void ohci_dump_status (struct ohci_hcd *controller) (temp & OHCI_HCR) ? " HCR" : "" ); - ohci_dump_intr_mask ("intrstatus", readl (®s->intrstatus)); - ohci_dump_intr_mask ("intrenable", readl (®s->intrenable)); + ohci_dump_intr_mask (dev, "intrstatus", readl (®s->intrstatus)); + ohci_dump_intr_mask (dev, "intrenable", readl (®s->intrenable)); // intrdisable always same as intrenable - // ohci_dump_intr_mask ("intrdisable", readl (®s->intrdisable)); + // ohci_dump_intr_mask (dev, "intrdisable", readl (®s->intrdisable)); - maybe_print_eds ("ed_periodcurrent", readl (®s->ed_periodcurrent)); + maybe_print_eds (dev, "ed_periodcurrent", readl (®s->ed_periodcurrent)); - maybe_print_eds ("ed_controlhead", readl (®s->ed_controlhead)); - maybe_print_eds ("ed_controlcurrent", readl (®s->ed_controlcurrent)); + maybe_print_eds (dev, "ed_controlhead", readl (®s->ed_controlhead)); + maybe_print_eds (dev, "ed_controlcurrent", readl (®s->ed_controlcurrent)); - maybe_print_eds ("ed_bulkhead", readl (®s->ed_bulkhead)); - maybe_print_eds ("ed_bulkcurrent", readl (®s->ed_bulkcurrent)); + maybe_print_eds (dev, "ed_bulkhead", readl (®s->ed_bulkhead)); + maybe_print_eds (dev, "ed_bulkcurrent", readl (®s->ed_bulkcurrent)); - maybe_print_eds ("donehead", readl (®s->donehead)); + maybe_print_eds (dev, "donehead", readl (®s->donehead)); } static void ohci_dump_roothub (struct ohci_hcd *controller, int verbose) @@ -166,7 +167,8 @@ static void ohci_dump_roothub (struct ohci_hcd *controller, int verbose) ndp = (temp & RH_A_NDP); if (verbose) { - dbg ("roothub.a: %08x POTPGT=%d%s%s%s%s%s NDP=%d", temp, + dev_dbg (*controller->hcd.controller, + "roothub.a: %08x POTPGT=%d%s%s%s%s%s NDP=%d\n", temp, ((temp & RH_A_POTPGT) >> 24) & 0xff, (temp & RH_A_NOCP) ? " NOCP" : "", (temp & RH_A_OCPM) ? " OCPM" : "", @@ -176,13 +178,15 @@ static void ohci_dump_roothub (struct ohci_hcd *controller, int verbose) ndp ); temp = roothub_b (controller); - dbg ("roothub.b: %08x PPCM=%04x DR=%04x", + dev_dbg (*controller->hcd.controller, + "roothub.b: %08x PPCM=%04x DR=%04x\n", temp, (temp & RH_B_PPCM) >> 16, (temp & RH_B_DR) ); temp = roothub_status (controller); - dbg ("roothub.status: %08x%s%s%s%s%s%s", + dev_dbg (*controller->hcd.controller, + "roothub.status: %08x%s%s%s%s%s%s\n", temp, (temp & RH_HS_CRWE) ? " CRWE" : "", (temp & RH_HS_OCIC) ? " OCIC" : "", @@ -201,12 +205,14 @@ static void ohci_dump_roothub (struct ohci_hcd *controller, int verbose) static void ohci_dump (struct ohci_hcd *controller, int verbose) { - dbg ("OHCI controller %s state", controller->hcd.self.bus_name); + dev_dbg (*controller->hcd.controller, + "OHCI controller state\n"); // dumps some of the state we know about ohci_dump_status (controller); if (controller->hcca) - dbg ("hcca frame #%04x", controller->hcca->frame_no); + dev_dbg (*controller->hcd.controller, + "hcca frame #%04x\n", controller->hcca->frame_no); ohci_dump_roothub (controller, 1); } @@ -312,16 +318,13 @@ ohci_dump_ed (struct ohci_hcd *ohci, char *label, struct ed *ed, int verbose) } } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,32) -# define DRIVERFS_DEBUG_FILES -#endif +#else +static inline void ohci_dump (struct ohci_hcd *controller, int verbose) {} #endif /* DEBUG */ /*-------------------------------------------------------------------------*/ -#ifdef DRIVERFS_DEBUG_FILES - static ssize_t show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed) { @@ -510,7 +513,7 @@ static inline void create_debug_files (struct ohci_hcd *bus) device_create_file (bus->hcd.controller, &dev_attr_async); device_create_file (bus->hcd.controller, &dev_attr_periodic); // registers - dbg ("%s: created debug files", bus->hcd.self.bus_name); + dev_dbg (*bus->hcd.controller, "created debug files\n"); } static inline void remove_debug_files (struct ohci_hcd *bus) @@ -519,12 +522,5 @@ static inline void remove_debug_files (struct ohci_hcd *bus) device_remove_file (bus->hcd.controller, &dev_attr_periodic); } -#else /* empty stubs for creating those files */ - -static inline void create_debug_files (struct ohci_hcd *bus) { } -static inline void remove_debug_files (struct ohci_hcd *bus) { } - -#endif /* DRIVERFS_DEBUG_FILES */ - /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 17a794b3ce54..46d8beaf6b8b 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -71,6 +71,13 @@ */ #include <linux/config.h> + +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#else +# undef DEBUG +#endif + #include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h> @@ -84,13 +91,6 @@ #include <linux/timer.h> #include <linux/list.h> #include <linux/interrupt.h> /* for in_interrupt () */ - -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#else -# undef DEBUG -#endif - #include <linux/usb.h> #include <linux/version.h> #include "../core/hcd.h" @@ -383,7 +383,7 @@ static int hc_reset (struct ohci_hcd *ohci) /* SMM owns the HC? not for long! */ if (readl (&ohci->regs->control) & OHCI_CTRL_IR) { - dbg ("USB HC TakeOver from BIOS/SMM"); + dev_dbg (*ohci->hcd.controller, "USB HC TakeOver from BIOS/SMM\n"); /* this timeout is arbitrary. we make it long, so systems * depending on usb keyboards may be usable even if the @@ -396,7 +396,7 @@ static int hc_reset (struct ohci_hcd *ohci) while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { wait_ms (10); if (--temp == 0) { - err ("USB HC TakeOver failed!"); + dev_err (*ohci->hcd.controller, "USB HC TakeOver failed!\n"); return -1; } } @@ -405,7 +405,7 @@ static int hc_reset (struct ohci_hcd *ohci) /* Disable HC interrupts */ writel (OHCI_INTR_MIE, &ohci->regs->intrdisable); - dbg ("USB HC reset_hc %s: ctrl = 0x%x ;", + dev_dbg (*ohci->hcd.controller, "USB HC reset_hc %s: ctrl = 0x%x ;\n", ohci->hcd.self.bus_name, readl (&ohci->regs->control)); @@ -422,7 +422,7 @@ static int hc_reset (struct ohci_hcd *ohci) temp = 30; /* ... allow extra time */ while ((readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) { if (--temp == 0) { - err ("USB HC reset timed out!"); + dev_err (*ohci->hcd.controller, "USB HC reset timed out!"); return -1; } udelay (1); @@ -562,9 +562,7 @@ static void ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs) hcd->self.bus_name); // e.g. due to PCI Master/Target Abort -#ifdef DEBUG ohci_dump (ohci, 1); -#endif hc_reset (ohci); } @@ -596,14 +594,11 @@ static void ohci_stop (struct usb_hcd *hcd) { struct ohci_hcd *ohci = hcd_to_ohci (hcd); - dbg ("%s: stop %s controller%s", - hcd->self.bus_name, + dev_dbg (*hcd->controller, "stop %s controller%s\n", hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS), ohci->disabled ? " (disabled)" : "" ); -#ifdef DEBUG ohci_dump (ohci, 1); -#endif if (!ohci->disabled) hc_reset (ohci); diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 9fd76677717d..167f732be345 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c @@ -41,9 +41,10 @@ static u32 roothub_portstatus (struct ohci_hcd *hc, int i) /*-------------------------------------------------------------------------*/ #define dbg_port(hc,label,num,value) \ - dbg ("%s: %s roothub.portstatus [%d] " \ - "= 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s", \ - hc->hcd.self.bus_name, label, num, temp, \ + dev_dbg (*hc->hcd.controller, \ + "%s roothub.portstatus [%d] " \ + "= 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \ + label, num, temp, \ (temp & RH_PS_PRSC) ? " PRSC" : "", \ (temp & RH_PS_OCIC) ? " OCIC" : "", \ (temp & RH_PS_PSSC) ? " PSSC" : "", \ diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index b5bcac0df2d1..1c965df28434 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c @@ -206,8 +206,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) default: branch = balance (ohci, ed->interval, ed->load); if (branch < 0) { - dbg ("%s: ERR %d, interval %d msecs, load %d", - ohci->hcd.self.bus_name, + dev_dbg (*ohci->hcd.controller, + "ERR %d, interval %d msecs, load %d\n", branch, ed->interval, ed->load); // FIXME if there are TDs queued, fail them! return branch; @@ -786,7 +786,8 @@ ed_halted (struct ohci_hcd *ohci, struct td *td, int cc, struct td *rev) } /* help for troubleshooting: */ - dbg ("urb %p usb-%s-%s ep-%d-%s cc %d --> status %d", + dev_dbg (urb->dev->dev, + "urb %p usb-%s-%s ep-%d-%s cc %d --> status %d\n", urb, urb->dev->bus->bus_name, urb->dev->devpath, usb_pipeendpoint (urb->pipe), diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 4a0e09a4851c..af2b94ac94ac 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c @@ -18,7 +18,7 @@ #include "uhci-hcd.h" /* Handle REALLY large printk's so we don't overflow buffers */ -static void inline lprintk(char *buf) +static inline void lprintk(char *buf) { char *p; @@ -34,7 +34,7 @@ static void inline lprintk(char *buf) } } -static int inline uhci_is_skeleton_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) +static inline int uhci_is_skeleton_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) { int i; diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index 3b5768ee1812..b3a8d06d6c19 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c @@ -165,7 +165,7 @@ static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci, struct usb_device *d return td; } -static void inline uhci_fill_td(struct uhci_td *td, __u32 status, +static inline void uhci_fill_td(struct uhci_td *td, __u32 status, __u32 token, __u32 buffer) { td->status = cpu_to_le32(status); diff --git a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c index 645591463439..601686c3b71c 100644 --- a/drivers/usb/misc/speedtouch.c +++ b/drivers/usb/misc/speedtouch.c @@ -1007,7 +1007,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf) * ****************************************************************************/ -int udsl_usb_init (void) +static int udsl_usb_init (void) { int i; @@ -1022,25 +1022,15 @@ int udsl_usb_init (void) return usb_register (&udsl_usb_driver); } -int udsl_usb_cleanup (void) +static void udsl_usb_cleanup (void) { /* killing threads */ udsl_atm_sar_stop (); usb_deregister (&udsl_usb_driver); - return 0; -} - -#ifdef MODULE -int init_module (void) -{ - return udsl_usb_init (); } -int cleanup_module (void) -{ - return udsl_usb_cleanup (); -} -#endif +module_init(udsl_usb_init); +module_exit(udsl_usb_cleanup); #ifdef DEBUG_PACKET /******************************************************************************* diff --git a/drivers/video/sticore.h b/drivers/video/sticore.h index 0572f4fb1d5e..7e7e1546f6e7 100644 --- a/drivers/video/sticore.h +++ b/drivers/video/sticore.h @@ -42,7 +42,7 @@ #define STI_PTR(p) (p) #define PTR_STI(p) (p) -static int inline STI_CALL( unsigned long func, +static inline int STI_CALL( unsigned long func, void *flags, void *inptr, void *outptr, void *glob_cfg ) { int (*f)(void *,void *,void *,void *); diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c index 230f0c971e66..8cc9094311e6 100644 --- a/drivers/video/tgafb.c +++ b/drivers/video/tgafb.c @@ -39,6 +39,9 @@ static int tgafb_setcolreg(unsigned, unsigned, unsigned, unsigned, unsigned, struct fb_info *); static int tgafb_blank(int, struct fb_info *); static void tgafb_init_fix(struct fb_info *); + +static void tgafb_imageblit(struct fb_info *, struct fb_image *); + static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *); #ifdef MODULE static void tgafb_pci_unregister(struct pci_dev *); @@ -59,7 +62,7 @@ static struct fb_ops tgafb_ops = { .fb_blank = tgafb_blank, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, + .fb_imageblit = tgafb_imageblit, .fb_cursor = soft_cursor, }; @@ -500,6 +503,256 @@ tgafb_blank(int blank, struct fb_info *info) /* + * Acceleration. + */ + +static void +tgafb_imageblit(struct fb_info *info, struct fb_image *image) +{ + static unsigned char const bitrev[256] = { + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, + 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, + 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, + 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, + 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, + 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, + 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, + 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, + 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff + }; + + struct tga_par *par = (struct tga_par *) info->par; + u32 fgcolor, bgcolor, dx, dy, width, height, vxres, vyres, pixelmask; + unsigned long rincr, line_length, shift, pos, is8bpp; + unsigned long i, j, k; + const unsigned char *data; + void *regs_base, *fb_base; + + dx = image->dx; + dy = image->dy; + width = image->width; + height = image->height; + vxres = info->var.xres_virtual; + vyres = info->var.yres_virtual; + line_length = info->fix.line_length; + rincr = (width + 7) / 8; + + /* Crop the image to the screen. */ + if (dx > vxres || dy > vyres) + return; + if (dx + width > vxres) + width = vxres - dx; + if (dy + height > vyres) + height = vyres - dy; + + /* For copies that aren't pixel expansion, there's little we + can do better than the generic code. */ + /* ??? There is a DMA write mode; I wonder if that could be + made to pull the data from the image buffer... */ + if (image->depth > 1) { + cfb_imageblit(info, image); + return; + } + + regs_base = par->tga_regs_base; + fb_base = par->tga_fb_base; + is8bpp = par->tga_type == TGA_TYPE_8PLANE; + + /* Expand the color values to fill 32-bits. */ + /* ??? Would be nice to notice colour changes elsewhere, so + that we can do this only when necessary. */ + fgcolor = image->fg_color; + bgcolor = image->bg_color; + if (is8bpp) { + fgcolor |= fgcolor << 8; + fgcolor |= fgcolor << 16; + bgcolor |= bgcolor << 8; + bgcolor |= bgcolor << 16; + } else { + fgcolor = ((u32 *)info->pseudo_palette)[fgcolor]; + bgcolor = ((u32 *)info->pseudo_palette)[bgcolor]; + } + __raw_writel(fgcolor, regs_base + TGA_FOREGROUND_REG); + __raw_writel(bgcolor, regs_base + TGA_BACKGROUND_REG); + + /* Acquire proper alignment; set up the PIXELMASK register + so that we only write the proper character cell. */ + pos = dy * line_length + dx; + if (is8bpp) { + shift = pos & 3; + pos &= -4; + } else { + shift = (pos & 7) >> 2; + pos &= -8; + } + + data = (const unsigned char *) image->data; + + /* Enable opaque stipple mode. */ + __raw_writel((is8bpp + ? TGA_MODE_SBM_8BPP | TGA_MODE_OPAQUE_STIPPLE + : TGA_MODE_SBM_24BPP | TGA_MODE_OPAQUE_STIPPLE), + regs_base + TGA_MODE_REG); + + if (width + shift <= 32) { + unsigned long bwidth; + + /* Handle common case of imaging a single character, in + a font less than 32 pixels wide. */ + + pixelmask = (1 << width) - 1; + pixelmask <<= shift; + __raw_writel(pixelmask, regs_base + TGA_PIXELMASK_REG); + wmb(); + + bwidth = (width + 7) / 8; + + for (i = 0; i < height; ++i) { + u32 mask = 0; + + /* The image data is bit big endian; we need + little endian. */ + for (j = 0; j < bwidth; ++j) + mask |= bitrev[data[j]] << (j * 8); + + __raw_writel(mask << shift, fb_base + pos); + + pos += line_length; + data += rincr; + } + wmb(); + __raw_writel(0xffffffff, regs_base + TGA_PIXELMASK_REG); + } else if (shift == 0) { + unsigned long pos0 = pos; + const unsigned char *data0 = data; + unsigned long bincr = (is8bpp ? 8 : 8*4); + unsigned long bwidth; + + /* Handle another common case in which accel_putcs + generates a large bitmap, which happens to be aligned. + Allow the tail to be misaligned. This case is + interesting because we've not got to hold partial + bytes across the words being written. */ + + wmb(); + + bwidth = (width / 8) & -4; + for (i = 0; i < height; ++i) { + for (j = 0; j < bwidth; j += 4) { + u32 mask = 0; + for (k = 0; k < 4; ++k) + mask |= bitrev[data[j+k]] << (k * 8); + __raw_writel(mask, fb_base + pos + j*bincr); + } + pos += line_length; + data += rincr; + } + wmb(); + + pixelmask = (1ul << (width & 31)) - 1; + if (pixelmask) { + __raw_writel(pixelmask, regs_base + TGA_PIXELMASK_REG); + wmb(); + + pos = pos0 + bwidth*bincr; + data = data0 + bwidth; + bwidth = ((width & 31) + 7) / 8; + + for (i = 0; i < height; ++i) { + u32 mask = 0; + for (k = 0; k < bwidth; ++k) + mask |= bitrev[data[k]] << (k * 8); + __raw_writel(mask, fb_base + pos); + pos += line_length; + data += rincr; + } + wmb(); + __raw_writel(0xffffffff, regs_base + TGA_PIXELMASK_REG); + } + } else { + unsigned long pos0 = pos; + const unsigned char *data0 = data; + unsigned long bincr = (is8bpp ? 8 : 8*4); + unsigned long bwidth; + + /* Finally, handle the generic case of misaligned start. + Here we split the write into 16-bit spans. This allows + us to use only one pixel mask, instead of four as would + be required by writing 24-bit spans. */ + + pixelmask = 0xffff << shift; + __raw_writel(pixelmask, regs_base + TGA_PIXELMASK_REG); + wmb(); + + bwidth = (width / 8) & -2; + for (i = 0; i < height; ++i) { + for (j = 0; j < bwidth; j += 2) { + u32 mask; + mask = bitrev[data[j]]; + mask |= bitrev[data[j+1]] << 8; + mask <<= shift; + __raw_writel(mask, fb_base + pos + j*bincr); + } + pos += line_length; + data += rincr; + } + wmb(); + + pixelmask = ((1ul << (width & 15)) - 1) << shift; + if (pixelmask) { + __raw_writel(pixelmask, regs_base + TGA_PIXELMASK_REG); + wmb(); + + pos = pos0 + bwidth*bincr; + data = data0 + bwidth; + bwidth = (width & 15) > 8; + + for (i = 0; i < height; ++i) { + u32 mask = bitrev[data[0]]; + if (bwidth) + mask |= bitrev[data[1]] << 8; + mask <<= shift; + __raw_writel(mask, fb_base + pos); + pos += line_length; + data += rincr; + } + wmb(); + } + __raw_writel(0xffffffff, regs_base + TGA_PIXELMASK_REG); + } + + /* Disable opaque stipple mode. */ + __raw_writel((is8bpp + ? TGA_MODE_SBM_8BPP | TGA_MODE_SIMPLE + : TGA_MODE_SBM_24BPP | TGA_MODE_SIMPLE), + regs_base + TGA_MODE_REG); +} + + +/* * Initialisation */ diff --git a/fs/befs/btree.c b/fs/befs/btree.c index 0a7164836b11..42a81113a396 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c @@ -86,7 +86,7 @@ typedef struct { } befs_btree_node; /* local constants */ -const static befs_off_t befs_bt_inval = 0xffffffffffffffff; +static const befs_off_t befs_bt_inval = 0xffffffffffffffff; /* local functions */ static int befs_btree_seekleaf(struct super_block *sb, befs_data_stream * ds, diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index cf279a4b6d30..d3f6e465cc5e 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -187,7 +187,7 @@ inet_addr(char *cp) convert a NT status code to a dos class/code *****************************************************************************/ /* NT status -> dos error map */ -const static struct { +static const struct { __u8 dos_class; __u16 dos_code; __u32 ntstatus; diff --git a/fs/dquot.c b/fs/dquot.c index 4d8ea00be1f9..cfef15182227 100644 --- a/fs/dquot.c +++ b/fs/dquot.c @@ -103,7 +103,7 @@ static struct quota_format_type *find_quota_format(int id) lock_kernel(); for (actqf = quota_formats; actqf && actqf->qf_fmt_id != id; actqf = actqf->qf_next); - if (actqf && !try_module_get:(actqf->qf_owner)) + if (actqf && !try_module_get(actqf->qf_owner)) actqf = NULL; unlock_kernel(); return actqf; diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 4a3e6315f9a9..630dbff4001c 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -704,7 +704,7 @@ static inline int ext3_match (int len, const char * const name, /* * Returns 0 if not found, -1 on failure, and 1 on success */ -static int inline search_dirblock(struct buffer_head * bh, +static inline int search_dirblock(struct buffer_head * bh, struct inode *dir, struct dentry *dentry, unsigned long offset, diff --git a/fs/proc/base.c b/fs/proc/base.c index 9fa201bb6f9e..3867d87354b1 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -259,10 +259,11 @@ static int proc_pid_wchan(struct task_struct *task, char *buffer) char *modname; const char *sym_name; unsigned long wchan, size, offset; + char namebuf[128]; wchan = get_wchan(task); - sym_name = kallsyms_lookup(wchan, &size, &offset, &modname); + sym_name = kallsyms_lookup(wchan, &size, &offset, &modname, namebuf); if (sym_name) return sprintf(buffer, "%s", sym_name); return sprintf(buffer, "%lu", wchan); diff --git a/fs/qnx4/bitmap.c b/fs/qnx4/bitmap.c index dd3ccbc9033f..72327856f893 100644 --- a/fs/qnx4/bitmap.c +++ b/fs/qnx4/bitmap.c @@ -29,7 +29,7 @@ int qnx4_new_block(struct super_block *sb) return 0; } -void count_bits(const register char *bmPart, register int size, +void count_bits(register const char *bmPart, register int size, int *const tf) { char b; diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index d16eae31dbe2..65d2824a0cbf 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c @@ -474,7 +474,7 @@ int reiserfs_parse_alloc_options(struct super_block * s, char * options) return 0; } -static void inline new_hashed_relocation (reiserfs_blocknr_hint_t * hint) +static inline void new_hashed_relocation (reiserfs_blocknr_hint_t * hint) { char * hash_in; if (hint->formatted_node) { @@ -493,7 +493,7 @@ static void inline new_hashed_relocation (reiserfs_blocknr_hint_t * hint) hint->search_start = hint->beg + keyed_hash(hash_in, 4) % (hint->end - hint->beg); } -static void inline get_left_neighbor(reiserfs_blocknr_hint_t *hint) +static inline void get_left_neighbor(reiserfs_blocknr_hint_t *hint) { struct path * path; struct buffer_head * bh; @@ -539,7 +539,7 @@ static void inline get_left_neighbor(reiserfs_blocknr_hint_t *hint) specified as number of percent with mount option device, else try to put on last of device. This is not to say it is good code to do so, but the effect should be measured. */ -static void inline set_border_in_hint(struct super_block *s, reiserfs_blocknr_hint_t *hint) +static inline void set_border_in_hint(struct super_block *s, reiserfs_blocknr_hint_t *hint) { b_blocknr_t border = SB_BLOCK_COUNT(s) / REISERFS_SB(s)->s_alloc_options.border; @@ -549,7 +549,7 @@ static void inline set_border_in_hint(struct super_block *s, reiserfs_blocknr_hi hint->beg = border; } -static void inline displace_large_file(reiserfs_blocknr_hint_t *hint) +static inline void displace_large_file(reiserfs_blocknr_hint_t *hint) { if ( TEST_OPTION(displace_based_on_dirid, hint->th->t_super)) hint->search_start = hint->beg + keyed_hash((char *)(&INODE_PKEY(hint->inode)->k_dir_id), 4) % (hint->end - hint->beg); @@ -557,7 +557,7 @@ static void inline displace_large_file(reiserfs_blocknr_hint_t *hint) hint->search_start = hint->beg + keyed_hash((char *)(&INODE_PKEY(hint->inode)->k_objectid), 4) % (hint->end - hint->beg); } -static void inline hash_formatted_node(reiserfs_blocknr_hint_t *hint) +static inline void hash_formatted_node(reiserfs_blocknr_hint_t *hint) { char * hash_in; @@ -571,13 +571,13 @@ static void inline hash_formatted_node(reiserfs_blocknr_hint_t *hint) hint->search_start = hint->beg + keyed_hash(hash_in, 4) % (hint->end - hint->beg); } -static int inline this_blocknr_allocation_would_make_it_a_large_file(reiserfs_blocknr_hint_t *hint) +static inline int this_blocknr_allocation_would_make_it_a_large_file(reiserfs_blocknr_hint_t *hint) { return hint->block == REISERFS_SB(hint->th->t_super)->s_alloc_options.large_file_size; } #ifdef DISPLACE_NEW_PACKING_LOCALITIES -static void inline displace_new_packing_locality (reiserfs_blocknr_hint_t *hint) +static inline void displace_new_packing_locality (reiserfs_blocknr_hint_t *hint) { struct key * key = &hint->key; @@ -586,7 +586,7 @@ static void inline displace_new_packing_locality (reiserfs_blocknr_hint_t *hint) } #endif -static int inline old_hashed_relocation (reiserfs_blocknr_hint_t * hint) +static inline int old_hashed_relocation (reiserfs_blocknr_hint_t * hint) { unsigned long border; unsigned long hash_in; @@ -603,7 +603,7 @@ static int inline old_hashed_relocation (reiserfs_blocknr_hint_t * hint) return 1; } -static int inline old_way (reiserfs_blocknr_hint_t * hint) +static inline int old_way (reiserfs_blocknr_hint_t * hint) { unsigned long border; @@ -618,7 +618,7 @@ static int inline old_way (reiserfs_blocknr_hint_t * hint) return 1; } -static void inline hundredth_slices (reiserfs_blocknr_hint_t * hint) +static inline void hundredth_slices (reiserfs_blocknr_hint_t * hint) { struct key * key = &hint->key; unsigned long slice_start; @@ -629,7 +629,7 @@ static void inline hundredth_slices (reiserfs_blocknr_hint_t * hint) } } -static void inline determine_search_start(reiserfs_blocknr_hint_t *hint, +static inline void determine_search_start(reiserfs_blocknr_hint_t *hint, int amount_needed) { struct super_block *s = hint->th->t_super; diff --git a/fs/xfs/linux/xfs_iops.c b/fs/xfs/linux/xfs_iops.c index 23af0da7eab3..24b36a4308d8 100644 --- a/fs/xfs/linux/xfs_iops.c +++ b/fs/xfs/linux/xfs_iops.c @@ -58,7 +58,7 @@ validate_fields( * * XXX(hch): nfsd is broken, better fix it instead. */ -STATIC int inline +STATIC inline int has_fs_struct(struct task_struct *task) { return (task->fs != init_task.fs); diff --git a/fs/xfs/xfs_bit.c b/fs/xfs/xfs_bit.c index e5deb3dc40e6..758998976200 100644 --- a/fs/xfs/xfs_bit.c +++ b/fs/xfs/xfs_bit.c @@ -117,7 +117,7 @@ static const char xfs_countbit[256] = { /* * xfs_highbit32: get high bit set out of 32-bit argument, -1 if none set. */ -int inline +inline int xfs_highbit32( __uint32_t v) { diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h index cc8a6dfe1978..f5716139ec89 100644 --- a/include/asm-alpha/types.h +++ b/include/asm-alpha/types.h @@ -9,6 +9,8 @@ * need to be careful to avoid a name clashes. */ +#ifndef __ASSEMBLY__ + typedef unsigned int umode_t; /* @@ -28,11 +30,17 @@ typedef unsigned int __u32; typedef __signed__ long __s64; typedef unsigned long __u64; +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 64 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -45,10 +53,9 @@ typedef unsigned int u32; typedef signed long s64; typedef unsigned long u64; -#define BITS_PER_LONG 64 - typedef u64 dma_addr_t; typedef u64 dma64_addr_t; +#endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _ALPHA_TYPES_H */ diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h index 7b66b95e5451..22992ee0627a 100644 --- a/include/asm-arm/types.h +++ b/include/asm-arm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_ARM_TYPES_H #define __ASM_ARM_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -22,11 +24,17 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -39,13 +47,13 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - /* Dma addresses are 32-bits wide. */ typedef u32 dma_addr_t; typedef u32 dma64_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h index 787ff7b1d86e..25425c09ddbc 100644 --- a/include/asm-cris/types.h +++ b/include/asm-cris/types.h @@ -1,6 +1,8 @@ #ifndef _ETRAX_TYPES_H #define _ETRAX_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -22,11 +24,17 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -39,12 +47,12 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - /* Dma addresses are 32-bits wide, just like our other addresses. */ typedef u32 dma_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 70011938c229..a537cc4d233e 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h @@ -131,8 +131,9 @@ static inline int unregister_profile_notifier(struct notifier_block * nb) #endif /* CONFIG_PROFILING */ -#ifdef CONFIG_X86_IO_APIC /*more of this file should probably be ifdefed SMP */ -static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) { +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) +static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) +{ if (IO_APIC_IRQ(i)) send_IPI_self(IO_APIC_VECTOR(i)); } diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h index 6175dba50238..b0d095271284 100644 --- a/include/asm-i386/types.h +++ b/include/asm-i386/types.h @@ -1,6 +1,8 @@ #ifndef _I386_TYPES_H #define _I386_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -22,11 +24,17 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + #include <linux/config.h> typedef signed char s8; @@ -41,8 +49,6 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - /* DMA addresses come in generic and 64-bit flavours. */ #ifdef CONFIG_HIGHMEM @@ -57,6 +63,8 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h index 52d0b3b47c81..cbdc4247a4c9 100644 --- a/include/asm-ia64/types.h +++ b/include/asm-ia64/types.h @@ -14,6 +14,11 @@ #ifdef __ASSEMBLY__ # define __IA64_UL(x) (x) # define __IA64_UL_CONST(x) x + +# ifdef __KERNEL__ +# define BITS_PER_LONG 64 +# endif + #else # define __IA64_UL(x) ((unsigned long)(x)) # define __IA64_UL_CONST(x) x##UL diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h index 92104425be80..b5a1febc97d4 100644 --- a/include/asm-m68k/types.h +++ b/include/asm-m68k/types.h @@ -9,6 +9,8 @@ * need to be careful to avoid a name clashes. */ +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -30,11 +32,17 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -47,13 +55,13 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - /* DMA addresses are always 32-bits wide */ typedef u32 dma_addr_t; typedef u32 dma64_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif /* _M68K_TYPES_H */ diff --git a/include/asm-m68knommu/types.h b/include/asm-m68knommu/types.h index 74d147dd6ba8..e1153959754e 100644 --- a/include/asm-m68knommu/types.h +++ b/include/asm-m68knommu/types.h @@ -9,6 +9,8 @@ * need to be careful to avoid a name clashes. */ +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -30,11 +32,17 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -47,12 +55,12 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - /* Dma addresses are 32-bits wide. */ typedef u32 dma_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif /* _M68K_TYPES_H */ diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h index 638f75163c36..d4796beca3f5 100644 --- a/include/asm-mips/types.h +++ b/include/asm-mips/types.h @@ -10,6 +10,8 @@ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -40,11 +42,17 @@ typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG _MIPS_SZLONG + +#ifndef __ASSEMBLY__ + typedef __signed char s8; typedef unsigned char u8; @@ -68,10 +76,10 @@ typedef unsigned long long u64; #endif -#define BITS_PER_LONG _MIPS_SZLONG - typedef unsigned long dma_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif /* _ASM_TYPES_H */ diff --git a/include/asm-mips64/types.h b/include/asm-mips64/types.h index 26dd2a505a72..5cba0f4857f1 100644 --- a/include/asm-mips64/types.h +++ b/include/asm-mips64/types.h @@ -9,6 +9,8 @@ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned int umode_t; /* @@ -39,11 +41,17 @@ typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG _MIPS_SZLONG + +#ifndef __ASSEMBLY__ + typedef __signed char s8; typedef unsigned char u8; @@ -67,10 +75,10 @@ typedef unsigned long long u64; #endif -#define BITS_PER_LONG _MIPS_SZLONG - typedef unsigned long dma_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif /* _ASM_TYPES_H */ diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h index 86fb267f2ab7..d21b9d0d63ea 100644 --- a/include/asm-parisc/types.h +++ b/include/asm-parisc/types.h @@ -1,6 +1,8 @@ #ifndef _PARISC_TYPES_H #define _PARISC_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -22,11 +24,21 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#ifdef __LP64__ +#define BITS_PER_LONG 64 +#else +#define BITS_PER_LONG 32 +#endif + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -39,17 +51,13 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#ifdef __LP64__ -#define BITS_PER_LONG 64 -#else -#define BITS_PER_LONG 32 -#endif - /* Dma addresses are 32-bits wide. */ typedef u32 dma_addr_t; typedef u64 dma64_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h index 26dd36dec197..3c74a27697d5 100644 --- a/include/asm-ppc/types.h +++ b/include/asm-ppc/types.h @@ -21,10 +21,22 @@ typedef struct { __u32 u[4]; } __attribute((aligned(16))) __vector128; +/* + * XXX allowed outside of __KERNEL__ for now, until glibc gets + * a proper set of asm headers of its own. -- paulus + */ +typedef unsigned short umode_t; + +#endif /* __ASSEMBLY__ */ + #ifdef __KERNEL__ /* * These aren't exported outside the kernel to avoid name space clashes */ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -39,8 +51,6 @@ typedef unsigned long long u64; typedef __vector128 vector128; -#define BITS_PER_LONG 32 - /* DMA addresses are 32-bits wide */ typedef u32 dma_addr_t; typedef u64 dma64_addr_t; @@ -50,14 +60,8 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif -#endif /* __KERNEL__ */ - -/* - * XXX allowed outside of __KERNEL__ for now, until glibc gets - * a proper set of asm headers of its own. -- paulus - */ -typedef unsigned short umode_t; - #endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ + #endif diff --git a/include/asm-ppc64/types.h b/include/asm-ppc64/types.h index a2a362bd5a71..08b5757e3d07 100644 --- a/include/asm-ppc64/types.h +++ b/include/asm-ppc64/types.h @@ -39,10 +39,16 @@ typedef struct { __u32 u[4]; } __attribute((aligned(16))) __vector128; +#endif /* __ASSEMBLY__ */ + #ifdef __KERNEL__ /* * These aren't exported outside the kernel to avoid name space clashes */ +#define BITS_PER_LONG 64 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -57,12 +63,11 @@ typedef unsigned long u64; typedef __vector128 vector128; -#define BITS_PER_LONG 64 - typedef u32 dma_addr_t; typedef u64 dma64_addr_t; -#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ + #endif /* _PPC64_TYPES_H */ diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h index 0f4c3fdf5a93..dc52bf8a7acb 100644 --- a/include/asm-s390/types.h +++ b/include/asm-s390/types.h @@ -9,6 +9,8 @@ #ifndef _S390_TYPES_H #define _S390_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -34,11 +36,18 @@ typedef unsigned long long __u64; */ typedef __u32 addr_t; typedef __s32 saddr_t; + +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -51,8 +60,6 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - typedef u32 dma_addr_t; typedef union { @@ -68,5 +75,7 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-s390x/compat.h b/include/asm-s390x/compat.h new file mode 100644 index 000000000000..e376c77f391c --- /dev/null +++ b/include/asm-s390x/compat.h @@ -0,0 +1,61 @@ +#ifndef _ASM_S390X_COMPAT_H +#define _ASM_S390X_COMPAT_H +/* + * Architecture specific compatibility types + */ +#include <linux/types.h> + +#define COMPAT_USER_HZ 100 + +typedef u32 compat_size_t; +typedef s32 compat_ssize_t; +typedef s32 compat_time_t; +typedef s32 compat_clock_t; +typedef s32 compat_pid_t; +typedef u16 compat_uid_t; +typedef u16 compat_gid_t; +typedef u16 compat_mode_t; +typedef u32 compat_ino_t; +typedef u16 compat_dev_t; +typedef s32 compat_off_t; +typedef s64 compat_loff_t; +typedef u16 compat_nlink_t; +typedef u16 compat_ipc_pid_t; +typedef s32 compat_daddr_t; +typedef u32 compat_caddr_t; +typedef __kernel_fsid_t compat_fsid_t; + +struct compat_timespec { + compat_time_t tv_sec; + s32 tv_nsec; +}; + +struct compat_timeval { + compat_time_t tv_sec; + s32 tv_usec; +}; + +struct compat_stat { + compat_dev_t st_dev; + u16 __pad1; + compat_ino_t st_ino; + compat_mode_t st_mode; + compat_nlink_t st_nlink; + compat_uid_t st_uid; + compat_gid_t st_gid; + compat_dev_t st_rdev; + u16 __pad2; + u32 st_size; + u32 st_blksize; + u32 st_blocks; + u32 st_atime; + u32 __unused1; + u32 st_mtime; + u32 __unused2; + u32 st_ctime; + u32 __unused3; + u32 __unused4; + u32 __unused5; +}; + +#endif /* _ASM_S390X_COMPAT_H */ diff --git a/include/asm-s390x/types.h b/include/asm-s390x/types.h index b8436bf5d54f..2ee9dcb2260b 100644 --- a/include/asm-s390x/types.h +++ b/include/asm-s390x/types.h @@ -9,6 +9,8 @@ #ifndef _S390_TYPES_H #define _S390_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -36,11 +38,17 @@ typedef unsigned long __u64; typedef unsigned long addr_t; typedef signed long saddr_t; +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 64 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -53,9 +61,9 @@ typedef unsigned int u32; typedef signed long s64; typedef unsigned long u64; -#define BITS_PER_LONG 64 - typedef u32 dma_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h index cb0f9f83af4f..c65c391e3f5c 100644 --- a/include/asm-sh/types.h +++ b/include/asm-sh/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_SH_TYPES_H #define __ASM_SH_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -22,11 +24,17 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef __signed__ char s8; typedef unsigned char u8; @@ -39,12 +47,12 @@ typedef unsigned int u32; typedef __signed__ long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - /* Dma addresses are 32-bits wide. */ typedef u32 dma_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif /* __ASM_SH_TYPES_H */ diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h index 8e726708e1cd..42fc6ed98156 100644 --- a/include/asm-sparc/types.h +++ b/include/asm-sparc/types.h @@ -15,6 +15,8 @@ * need to be careful to avoid a name clashes. */ +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; typedef __signed__ char __s8; @@ -29,8 +31,14 @@ typedef unsigned int __u32; typedef __signed__ long long __s64; typedef unsigned long long __u64; +#endif /* __ASSEMBLY__ */ + #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef __signed__ char s8; typedef unsigned char u8; @@ -43,11 +51,11 @@ typedef unsigned int u32; typedef __signed__ long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - typedef u32 dma_addr_t; typedef u32 dma64_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif /* defined(_SPARC_TYPES_H) */ diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h index e993f2af43bc..d0ee7f105838 100644 --- a/include/asm-sparc64/types.h +++ b/include/asm-sparc64/types.h @@ -10,6 +10,8 @@ * need to be careful to avoid a name clashes. */ +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -29,8 +31,14 @@ typedef unsigned int __u32; typedef __signed__ long __s64; typedef unsigned long __u64; +#endif /* __ASSEMBLY__ */ + #ifdef __KERNEL__ +#define BITS_PER_LONG 64 + +#ifndef __ASSEMBLY__ + typedef __signed__ char s8; typedef unsigned char u8; @@ -43,13 +51,13 @@ typedef unsigned int u32; typedef __signed__ long s64; typedef unsigned long u64; -#define BITS_PER_LONG 64 - /* Dma addresses come in generic and 64-bit flavours. */ typedef u32 dma_addr_t; typedef u64 dma64_addr_t; +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif /* defined(_SPARC64_TYPES_H) */ diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h index 6d144379f13e..dcef57196875 100644 --- a/include/asm-v850/types.h +++ b/include/asm-v850/types.h @@ -32,11 +32,17 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif +#endif /* !__ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 32 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -49,14 +55,12 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - /* Dma addresses are 32-bits wide. */ typedef u32 dma_addr_t; -#endif /* __KERNEL__ */ - #endif /* !__ASSEMBLY__ */ +#endif /* __KERNEL__ */ + #endif /* __V850_TYPES_H__ */ diff --git a/include/asm-x86_64/types.h b/include/asm-x86_64/types.h index 8192e910bb4b..5b2dc01b7969 100644 --- a/include/asm-x86_64/types.h +++ b/include/asm-x86_64/types.h @@ -1,6 +1,8 @@ #ifndef _X86_64_TYPES_H #define _X86_64_TYPES_H +#ifndef __ASSEMBLY__ + typedef unsigned short umode_t; /* @@ -20,11 +22,17 @@ typedef unsigned int __u32; typedef __signed__ long long __s64; typedef unsigned long long __u64; +#endif /* __ASSEMBLY__ */ + /* * These aren't exported outside the kernel to avoid name space clashes */ #ifdef __KERNEL__ +#define BITS_PER_LONG 64 + +#ifndef __ASSEMBLY__ + typedef signed char s8; typedef unsigned char u8; @@ -37,8 +45,6 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 64 - typedef u64 dma64_addr_t; typedef u64 dma_addr_t; @@ -47,6 +53,8 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif +#endif /* __ASSEMBLY__ */ + #endif /* __KERNEL__ */ #endif diff --git a/include/linux/compiler.h b/include/linux/compiler.h index f88889740949..99aab023173f 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -17,10 +17,9 @@ * Allow us to mark functions as 'deprecated' and have gcc emit a nice * warning for each use, in hopes of speeding the functions removal. * Usage is: - * int deprecated foo(void) - * and then gcc will emit a warning for each usage of the function. + * int __deprecated foo(void) */ -#if __GNUC__ >= 3 +#if ( __GNUC__ == 3 && __GNUC_MINOR > 0 ) || __GNUC__ > 3 #define __deprecated __attribute__((deprecated)) #else #define __deprecated diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h index ee6ddba913bb..84bede1ed6ac 100644 --- a/include/linux/i2c-dev.h +++ b/include/linux/i2c-dev.h @@ -21,9 +21,8 @@ /* $Id: i2c-dev.h,v 1.11 2002/07/07 15:42:47 mds Exp $ */ -#ifndef I2C_DEV_H -#define I2C_DEV_H - +#ifndef _LINUX_I2C_DEV_H +#define _LINUX_I2C_DEV_H #include <linux/types.h> #include <linux/i2c.h> @@ -45,174 +44,4 @@ struct i2c_rdwr_ioctl_data { int nmsgs; /* number of i2c_msgs */ }; -#ifndef __KERNEL__ - -#include <sys/ioctl.h> - -static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command, - int size, union i2c_smbus_data *data) -{ - struct i2c_smbus_ioctl_data args; - - args.read_write = read_write; - args.command = command; - args.size = size; - args.data = data; - return ioctl(file,I2C_SMBUS,&args); -} - - -static inline __s32 i2c_smbus_write_quick(int file, __u8 value) -{ - return i2c_smbus_access(file,value,0,I2C_SMBUS_QUICK,NULL); -} - -static inline __s32 i2c_smbus_read_byte(int file) -{ - union i2c_smbus_data data; - if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data)) - return -1; - else - return 0x0FF & data.byte; -} - -static inline __s32 i2c_smbus_write_byte(int file, __u8 value) -{ - return i2c_smbus_access(file,I2C_SMBUS_WRITE,value, - I2C_SMBUS_BYTE,NULL); -} - -static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command) -{ - union i2c_smbus_data data; - if (i2c_smbus_access(file,I2C_SMBUS_READ,command, - I2C_SMBUS_BYTE_DATA,&data)) - return -1; - else - return 0x0FF & data.byte; -} - -static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command, - __u8 value) -{ - union i2c_smbus_data data; - data.byte = value; - return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, - I2C_SMBUS_BYTE_DATA, &data); -} - -static inline __s32 i2c_smbus_read_word_data(int file, __u8 command) -{ - union i2c_smbus_data data; - if (i2c_smbus_access(file,I2C_SMBUS_READ,command, - I2C_SMBUS_WORD_DATA,&data)) - return -1; - else - return 0x0FFFF & data.word; -} - -static inline __s32 i2c_smbus_write_word_data(int file, __u8 command, - __u16 value) -{ - union i2c_smbus_data data; - data.word = value; - return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, - I2C_SMBUS_WORD_DATA, &data); -} - -static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value) -{ - union i2c_smbus_data data; - data.word = value; - if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command, - I2C_SMBUS_PROC_CALL,&data)) - return -1; - else - return 0x0FFFF & data.word; -} - - -/* Returns the number of read bytes */ -static inline __s32 i2c_smbus_read_block_data(int file, __u8 command, - __u8 *values) -{ - union i2c_smbus_data data; - int i; - if (i2c_smbus_access(file,I2C_SMBUS_READ,command, - I2C_SMBUS_BLOCK_DATA,&data)) - return -1; - else { - for (i = 1; i <= data.block[0]; i++) - values[i-1] = data.block[i]; - return data.block[0]; - } -} - -static inline __s32 i2c_smbus_write_block_data(int file, __u8 command, - __u8 length, __u8 *values) -{ - union i2c_smbus_data data; - int i; - if (length > 32) - length = 32; - for (i = 1; i <= length; i++) - data.block[i] = values[i-1]; - data.block[0] = length; - return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, - I2C_SMBUS_BLOCK_DATA, &data); -} - -/* Returns the number of read bytes */ -static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command, - __u8 *values) -{ - union i2c_smbus_data data; - int i; - if (i2c_smbus_access(file,I2C_SMBUS_READ,command, - I2C_SMBUS_I2C_BLOCK_DATA,&data)) - return -1; - else { - for (i = 1; i <= data.block[0]; i++) - values[i-1] = data.block[i]; - return data.block[0]; - } -} - -static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command, - __u8 length, __u8 *values) -{ - union i2c_smbus_data data; - int i; - if (length > 32) - length = 32; - for (i = 1; i <= length; i++) - data.block[i] = values[i-1]; - data.block[0] = length; - return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, - I2C_SMBUS_I2C_BLOCK_DATA, &data); -} - -/* Returns the number of read bytes */ -static inline __s32 i2c_smbus_block_process_call(int file, __u8 command, - __u8 length, __u8 *values) -{ - union i2c_smbus_data data; - int i; - if (length > 32) - length = 32; - for (i = 1; i <= length; i++) - data.block[i] = values[i-1]; - data.block[0] = length; - if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command, - I2C_SMBUS_BLOCK_PROC_CALL,&data)) - return -1; - else { - for (i = 1; i <= data.block[0]; i++) - values[i-1] = data.block[i]; - return data.block[0]; - } -} - -#endif /* ndef __KERNEL__ */ - -#endif +#endif /* _LINUX_I2C_DEV_H */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 765a95af3a4e..c176ca672cc7 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -25,31 +25,17 @@ /* $Id: i2c.h,v 1.59 2002/07/19 20:53:45 phil Exp $ */ -#ifndef I2C_H -#define I2C_H +#ifndef _LINUX_I2C_H +#define _LINUX_I2C_H #define I2C_DATE "20020719" #define I2C_VERSION "2.6.4" #include <linux/i2c-id.h> /* id values of adapters et. al. */ #include <linux/types.h> - - -struct i2c_msg; - - -#ifdef __KERNEL__ - -/* --- Includes and compatibility declarations ------------------------ */ - -#include <linux/version.h> -#ifndef KERNEL_VERSION -#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c)) -#endif - -#include <asm/page.h> /* for 2.2.xx */ -#include <asm/semaphore.h> #include <linux/config.h> +#include <asm/semaphore.h> + /* --- General options ------------------------------------------------ */ @@ -59,6 +45,7 @@ struct i2c_msg; #define I2C_CLIENT_MAX 32 #define I2C_DUMMY_MAX 4 +struct i2c_msg; struct i2c_algorithm; struct i2c_adapter; struct i2c_client; @@ -212,10 +199,6 @@ struct i2c_algorithm { u32 (*functionality) (struct i2c_adapter *); }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29) -struct proc_dir_entry; -#endif - /* * i2c_adapter is the structure used to identify a physical i2c bus along * with the access algorithms necessary to access it. @@ -250,9 +233,6 @@ struct i2c_adapter { #ifdef CONFIG_PROC_FS /* No need to set this when you initialize the adapter */ int inode; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29) - struct proc_dir_entry *proc_entry; -#endif #endif /* def CONFIG_PROC_FS */ }; @@ -355,8 +335,6 @@ extern u32 i2c_get_functionality (struct i2c_adapter *adap); /* Return 1 if adapter supports everything we need, 0 if not. */ extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); -#endif /* __KERNEL__ */ - /* * I2C Message - used for pure i2c transaction, also from /dev interface */ @@ -506,8 +484,6 @@ union i2c_smbus_data { #define I2C_MAJOR 89 /* Device major number */ -#ifdef __KERNEL__ - # ifndef NULL # define NULL ( (void *) 0 ) # endif @@ -577,5 +553,4 @@ union i2c_smbus_data { #define i2c_is_isa_adapter(adapptr) \ ((adapptr)->algo->id == I2C_ALGO_ISA) -#endif /* def __KERNEL__ */ -#endif /* I2C_H */ +#endif /* _LINUX_I2C_H */ diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h index 7008adef1677..3e03c39fbc40 100644 --- a/include/linux/isapnp.h +++ b/include/linux/isapnp.h @@ -24,6 +24,7 @@ #include <linux/config.h> #include <linux/errno.h> +#include <linux/pnp.h> /* * Configuration registers (TODO: change by specification) @@ -54,79 +55,7 @@ #ifdef __KERNEL__ -#include <linux/pci.h> - -#define ISAPNP_PORT_FLAG_16BITADDR (1<<0) -#define ISAPNP_PORT_FLAG_FIXED (1<<1) - -struct isapnp_port { - unsigned short min; /* min base number */ - unsigned short max; /* max base number */ - unsigned char align; /* align boundary */ - unsigned char size; /* size of range */ - unsigned char flags; /* port flags */ - unsigned char pad; /* pad */ - struct isapnp_resources *res; /* parent */ - struct isapnp_port *next; /* next port */ -}; - -struct isapnp_irq { - unsigned short map; /* bitmaks for IRQ lines */ - unsigned char flags; /* IRQ flags */ - unsigned char pad; /* pad */ - struct isapnp_resources *res; /* parent */ - struct isapnp_irq *next; /* next IRQ */ -}; - -struct isapnp_dma { - unsigned char map; /* bitmask for DMA channels */ - unsigned char flags; /* DMA flags */ - struct isapnp_resources *res; /* parent */ - struct isapnp_dma *next; /* next port */ -}; - -struct isapnp_mem { - unsigned int min; /* min base number */ - unsigned int max; /* max base number */ - unsigned int align; /* align boundary */ - unsigned int size; /* size of range */ - unsigned char flags; /* memory flags */ - unsigned char pad; /* pad */ - struct isapnp_resources *res; /* parent */ - struct isapnp_mem *next; /* next memory resource */ -}; - -struct isapnp_mem32 { - /* TODO */ - unsigned char data[17]; - struct isapnp_resources *res; /* parent */ - struct isapnp_mem32 *next; /* next 32-bit memory resource */ -}; - -struct isapnp_fixup { - unsigned short vendor; /* matching vendor */ - unsigned short device; /* matching device */ - void (*quirk_function)(struct pci_dev *dev); /* fixup function */ -}; - - -#define ISAPNP_RES_PRIORITY_PREFERRED 0 -#define ISAPNP_RES_PRIORITY_ACCEPTABLE 1 -#define ISAPNP_RES_PRIORITY_FUNCTIONAL 2 -#define ISAPNP_RES_PRIORITY_INVALID 65535 - -struct isapnp_resources { - unsigned short priority; /* priority */ - unsigned short dependent; /* dependent resources */ - struct isapnp_port *port; /* first port */ - struct isapnp_irq *irq; /* first IRQ */ - struct isapnp_dma *dma; /* first DMA */ - struct isapnp_mem *mem; /* first memory resource */ - struct isapnp_mem32 *mem32; /* first 32-bit memory */ - struct pci_dev *dev; /* parent */ - struct isapnp_resources *alt; /* alternative resource (aka dependent resources) */ - struct isapnp_resources *next; /* next resource */ -}; +#define DEVICE_COUNT_COMPATIBLE 4 #define ISAPNP_ANY_ID 0xffff #define ISAPNP_CARD_DEVS 8 @@ -162,14 +91,6 @@ struct isapnp_device_id { unsigned long driver_data; /* data private to the driver */ }; -struct isapnp_driver { - struct list_head node; - char *name; - const struct isapnp_device_id *id_table; /* NULL if wants all devices */ - int (*probe) (struct pci_dev *dev, const struct isapnp_device_id *id); /* New device inserted */ - void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ -}; - #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE)) #define __ISAPNP__ @@ -188,7 +109,6 @@ void isapnp_wake(unsigned char csn); void isapnp_device(unsigned char device); void isapnp_activate(unsigned char device); void isapnp_deactivate(unsigned char device); -void isapnp_fixup_device(struct pci_dev *dev); void *isapnp_alloc(long size); #ifdef CONFIG_PROC_FS @@ -199,40 +119,8 @@ static inline isapnp_proc_init(void) { return 0; } static inline isapnp_proc_done(void) { return 0; } #endif -/* misc */ -void isapnp_resource_change(struct resource *resource, - unsigned long start, - unsigned long size); /* init/main.c */ int isapnp_init(void); -/* manager */ -static inline struct pci_bus *isapnp_find_card(unsigned short vendor, - unsigned short device, - struct pci_bus *from) { return NULL; } -static inline struct pci_dev *isapnp_find_dev(struct pci_bus *card, - unsigned short vendor, - unsigned short function, - struct pci_dev *from) { return NULL; } -static inline int isapnp_probe_cards(const struct isapnp_card_id *ids, - int (*probe)(struct pci_bus *card, - const struct isapnp_card_id *id)) { return -ENODEV; } -static inline int isapnp_probe_devs(const struct isapnp_device_id *ids, - int (*probe)(struct pci_dev *dev, - const struct isapnp_device_id *id)) { return -ENODEV; } -static inline int isapnp_activate_dev(struct pci_dev *dev, const char *name) { return -ENODEV; } - -static inline int isapnp_register_driver(struct isapnp_driver *drv) { return 0; } - -static inline void isapnp_unregister_driver(struct isapnp_driver *drv) { } - -extern struct list_head isapnp_cards; -extern struct list_head isapnp_devices; -extern struct pnp_protocol isapnp_protocol; - -#define isapnp_for_each_card(card) \ - for(card = to_pnp_card(isapnp_cards.next); card != to_pnp_card(&isapnp_cards); card = to_pnp_card(card->node.next)) -#define isapnp_for_each_dev(dev) \ - for(dev = protocol_to_pnp_dev(isapnp_protocol.devices.next); dev != protocol_to_pnp_dev(&isapnp_protocol.devices); dev = protocol_to_pnp_dev(dev->dev_list.next)) #else /* !CONFIG_ISAPNP */ @@ -250,28 +138,6 @@ static inline void isapnp_wake(unsigned char csn) { ; } static inline void isapnp_device(unsigned char device) { ; } static inline void isapnp_activate(unsigned char device) { ; } static inline void isapnp_deactivate(unsigned char device) { ; } -/* manager */ -static inline struct pci_bus *isapnp_find_card(unsigned short vendor, - unsigned short device, - struct pci_bus *from) { return NULL; } -static inline struct pci_dev *isapnp_find_dev(struct pci_bus *card, - unsigned short vendor, - unsigned short function, - struct pci_dev *from) { return NULL; } -static inline int isapnp_probe_cards(const struct isapnp_card_id *ids, - int (*probe)(struct pci_bus *card, - const struct isapnp_card_id *id)) { return -ENODEV; } -static inline int isapnp_probe_devs(const struct isapnp_device_id *ids, - int (*probe)(struct pci_dev *dev, - const struct isapnp_device_id *id)) { return -ENODEV; } -static inline void isapnp_resource_change(struct resource *resource, - unsigned long start, - unsigned long size) { ; } -static inline int isapnp_activate_dev(struct pci_dev *dev, const char *name) { return -ENODEV; } - -static inline int isapnp_register_driver(struct isapnp_driver *drv) { return 0; } - -static inline void isapnp_unregister_driver(struct isapnp_driver *drv) { } #endif /* CONFIG_ISAPNP */ diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index dcba85045308..d2a90b7766a1 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -12,7 +12,7 @@ const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, - char **modname); + char **modname, char *namebuf); /* Replace "%s" in format with address, if found */ extern void __print_symbol(const char *fmt, unsigned long address); @@ -22,7 +22,7 @@ extern void __print_symbol(const char *fmt, unsigned long address); static inline const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, - char **modname) + char **modname, char *namebuf) { return NULL; } diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index a15a7ac2f6a3..9e2f1923ce5c 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h @@ -248,7 +248,7 @@ int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); /* linux/fs/ncpfs/sock.c */ int ncp_request2(struct ncp_server *server, int function, void* reply, int max_reply_size); -static int inline ncp_request(struct ncp_server *server, int function) { +static inline int ncp_request(struct ncp_server *server, int function) { return ncp_request2(server, function, server->packet, server->packet_size); } int ncp_connect(struct ncp_server *server); diff --git a/include/linux/pci.h b/include/linux/pci.h index 9d4e269ac1db..7b693e39425f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -362,7 +362,7 @@ enum pci_mmap_state { #define PCI_ANY_ID (~0) /* - * The pci_dev structure is used to describe both PCI and ISAPnP devices. + * The pci_dev structure is used to describe PCI devices. */ struct pci_dev { struct list_head global_list; /* node in list of all PCI devices */ @@ -410,16 +410,9 @@ struct pci_dev { struct resource irq_resource[DEVICE_COUNT_IRQ]; char slot_name[8]; /* slot name */ - int active; /* ISAPnP: device is active */ - int ro; /* ISAPnP: read only */ - unsigned short regs; /* ISAPnP: supported registers */ /* These fields are used by common fixups */ - unsigned short transparent:1; /* Transparent PCI bridge */ - - int (*prepare)(struct pci_dev *dev); /* ISAPnP hooks */ - int (*activate)(struct pci_dev *dev); - int (*deactivate)(struct pci_dev *dev); + unsigned int transparent:1; /* Transparent PCI bridge */ }; #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) @@ -463,13 +456,7 @@ struct pci_bus { unsigned char subordinate; /* max number of subordinate buses */ char name[48]; - unsigned short vendor; - unsigned short device; - unsigned int serial; /* serial number */ - unsigned char pnpver; /* Plug & Play version */ - unsigned char productver; /* product version */ - unsigned char checksum; /* if zero - checksum passed */ - unsigned char pad1; + struct device * dev; }; @@ -605,23 +592,23 @@ static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) { return pci_bus_read_config_byte (dev->bus, dev->devfn, where, val); } -static int inline pci_read_config_word(struct pci_dev *dev, int where, u16 *val) +static inline int pci_read_config_word(struct pci_dev *dev, int where, u16 *val) { return pci_bus_read_config_word (dev->bus, dev->devfn, where, val); } -static int inline pci_read_config_dword(struct pci_dev *dev, int where, u32 *val) +static inline int pci_read_config_dword(struct pci_dev *dev, int where, u32 *val) { return pci_bus_read_config_dword (dev->bus, dev->devfn, where, val); } -static int inline pci_write_config_byte(struct pci_dev *dev, int where, u8 val) +static inline int pci_write_config_byte(struct pci_dev *dev, int where, u8 val) { return pci_bus_write_config_byte (dev->bus, dev->devfn, where, val); } -static int inline pci_write_config_word(struct pci_dev *dev, int where, u16 val) +static inline int pci_write_config_word(struct pci_dev *dev, int where, u16 val) { return pci_bus_write_config_word (dev->bus, dev->devfn, where, val); } -static int inline pci_write_config_dword(struct pci_dev *dev, int where, u32 val) +static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val) { return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); } diff --git a/include/linux/pnp.h b/include/linux/pnp.h index d666c6a92b9f..7d4e9fd6ae0e 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -26,6 +26,7 @@ struct pnp_resource; struct pnp_protocol; struct pnp_id; +struct pnp_cfg; struct pnp_card { char name[80]; @@ -50,11 +51,15 @@ struct pnp_card { #define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list) #define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list) -#define to_pnp_card(n) list_entry(n, struct pnp_card, dev) +#define to_pnp_card(n) container_of(n, struct pnp_card, dev) #define pnp_for_each_card(card) \ - for(dev = global_to_pnp_card(pnp_cards.next); \ - dev != global_to_pnp_card(&cards); \ - dev = global_to_pnp_card(card>global_list.next)) + for((card) = global_to_pnp_card(pnp_cards.next); \ + (card) != global_to_pnp_card(&pnp_cards); \ + (card) = global_to_pnp_card((card)->global_list.next)) +#define pnp_card_for_each_dev(card,dev) \ + for((dev) = card_to_pnp_dev((card)->devices.next); \ + (dev) != card_to_pnp_dev(&(card)->devices); \ + (dev) = card_to_pnp_dev((dev)->card_list.next)) static inline void *pnpc_get_drvdata (struct pnp_card *pcard) { @@ -79,7 +84,6 @@ static inline void pnpc_set_protodata (struct pnp_card *pcard, void *data) struct pnp_dev { char name[80]; /* device name */ int active; /* status of the device */ - int ro; /* read only */ struct list_head global_list; /* node in global list of devices */ struct list_head protocol_list; /* node in list of device's protocol */ struct list_head card_list; /* node in card's list of devices */ @@ -93,6 +97,7 @@ struct pnp_dev { unsigned short regs; /* ISAPnP: supported registers */ struct pnp_resources *res; /* possible resource information */ + int lock_resources; /* resources are locked */ struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ struct resource dma_resource[DEVICE_COUNT_DMA]; struct resource irq_resource[DEVICE_COUNT_IRQ]; @@ -112,6 +117,13 @@ struct pnp_dev { dev != global_to_pnp_dev(&pnp_global); \ dev = global_to_pnp_dev(dev->global_list.next)) +static inline int pnp_dev_has_driver(struct pnp_dev *pdev) +{ + if (pdev->driver || (pdev->card && pdev->card->driver)) + return 1; + return 0; +} + static inline void *pnp_get_drvdata (struct pnp_dev *pdev) { return dev_get_drvdata(&pdev->dev); @@ -160,10 +172,13 @@ struct pnp_card_id { } devs[MAX_DEVICES]; /* logical devices */ }; +#define PNP_DRIVER_DO_NOT_ACTIVATE (1<<0) + struct pnp_driver { struct list_head node; char *name; const struct pnp_device_id *id_table; + unsigned int flags; int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); void (*remove) (struct pnp_dev *dev); struct device_driver driver; @@ -171,10 +186,13 @@ struct pnp_driver { #define to_pnp_driver(drv) container_of(drv,struct pnp_driver, driver) +#define PNPC_DRIVER_DO_NOT_ACTIVATE (1<<0) + struct pnpc_driver { struct list_head node; char *name; const struct pnp_card_id *id_table; + unsigned int flags; int (*probe) (struct pnp_card *card, const struct pnp_card_id *card_id); void (*remove) (struct pnp_card *card); struct device_driver driver; @@ -279,6 +297,12 @@ struct pnp_resources { struct pnp_resources *dep; /* dependent resources */ }; +struct pnp_res_cfg { + struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ + struct resource dma_resource[DEVICE_COUNT_DMA]; + struct resource irq_resource[DEVICE_COUNT_IRQ]; +}; + #define PNP_DYNAMIC 0 /* get or set current resource */ #define PNP_STATIC 1 /* get or set resource for next boot */ @@ -287,7 +311,7 @@ struct pnp_cfg { struct pnp_irq *irq[2]; struct pnp_dma *dma[2]; struct pnp_mem *mem[4]; - struct pnp_dev request; + struct pnp_res_cfg request; }; @@ -340,9 +364,11 @@ int pnp_add_dma_resource(struct pnp_dev *dev, int depnum, struct pnp_dma *data); int pnp_add_port_resource(struct pnp_dev *dev, int depnum, struct pnp_port *data); int pnp_add_mem_resource(struct pnp_dev *dev, int depnum, struct pnp_mem *data); int pnp_add_mem32_resource(struct pnp_dev *dev, int depnum, struct pnp_mem32 *data); -int pnp_activate_dev(struct pnp_dev *dev); +int pnp_init_res_cfg(struct pnp_res_cfg *template); +int pnp_activate_dev(struct pnp_dev *dev, struct pnp_res_cfg *template); int pnp_disable_dev(struct pnp_dev *dev); -int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode); +int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, struct pnp_res_cfg *template, int mode); +void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); /* driver */ int compare_pnp_id(struct pnp_id * pos, const char * id); @@ -366,9 +392,10 @@ static inline int pnp_add_dma_resource(struct pnp_dev *dev, int depnum, struct p static inline int pnp_add_port_resource(struct pnp_dev *dev, int depnum, struct pnp_irq *data) { return -ENODEV; } static inline int pnp_add_mem_resource(struct pnp_dev *dev, int depnum, struct pnp_irq *data) { return -ENODEV; } static inline int pnp_add_mem32_resource(struct pnp_dev *dev, int depnum, struct pnp_irq *data) { return -ENODEV; } -static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } +static inline int pnp_init_res_cfg(struct pnp_res_cfg *template) { return -ENODEV; } +static inline int pnp_activate_dev(struct pnp_dev *dev, struct pnp_res_cfg *template) { return -ENODEV; } static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } -static inline int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode) { return -ENODEV; } +static inline int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, struct pnp_res_cfg *template, int mode) { return -ENODEV; } static inline int compare_pnp_id(struct list_head * id_list, const char * id) { return -ENODEV; } static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 3d37e47dd968..74e53a04907e 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -244,7 +244,7 @@ static inline struct cache_head *cache_get(struct cache_head *h) } -static int inline cache_put(struct cache_head *h, struct cache_detail *cd) +static inline int cache_put(struct cache_head *h, struct cache_detail *cd) { atomic_dec(&h->refcnt); if (!atomic_read(&h->refcnt) && diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index cb36271f1376..9408ba6dbe34 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -171,7 +171,7 @@ xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) return vec->iov_len <= PAGE_SIZE; } -static int inline svc_take_page(struct svc_rqst *rqstp) +static inline int svc_take_page(struct svc_rqst *rqstp) { if (rqstp->rq_arghi <= rqstp->rq_argused) return -ENOMEM; @@ -180,7 +180,7 @@ static int inline svc_take_page(struct svc_rqst *rqstp) return 0; } -static void inline svc_pushback_allpages(struct svc_rqst *rqstp) +static inline void svc_pushback_allpages(struct svc_rqst *rqstp) { while (rqstp->rq_resused) { if (rqstp->rq_respages[--rqstp->rq_resused] == NULL) @@ -191,7 +191,7 @@ static void inline svc_pushback_allpages(struct svc_rqst *rqstp) } } -static void inline svc_pushback_unused_pages(struct svc_rqst *rqstp) +static inline void svc_pushback_unused_pages(struct svc_rqst *rqstp) { while (rqstp->rq_resused) { if (rqstp->rq_respages[--rqstp->rq_resused] != NULL) { @@ -204,7 +204,7 @@ static void inline svc_pushback_unused_pages(struct svc_rqst *rqstp) } } -static void inline svc_free_allpages(struct svc_rqst *rqstp) +static inline void svc_free_allpages(struct svc_rqst *rqstp) { while (rqstp->rq_resused) { if (rqstp->rq_respages[--rqstp->rq_resused] == NULL) diff --git a/include/linux/types.h b/include/linux/types.h index 87985824b16e..94ceb057eb64 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -6,6 +6,8 @@ #define DECLARE_BITMAP(name,bits) \ unsigned long name[((bits)+BITS_PER_LONG-1)/BITS_PER_LONG] +#define CLEAR_BITMAP(name,bits) \ + memset(name, 0, ((bits)+BITS_PER_LONG-1)/8) #endif #include <linux/posix_types.h> diff --git a/include/video/tgafb.h b/include/video/tgafb.h index fbfae108a525..0e76dda6fc4d 100644 --- a/include/video/tgafb.h +++ b/include/video/tgafb.h @@ -31,7 +31,10 @@ #define TGA_24PLANE_FB_OFFSET 0x0804000 #define TGA_24PLUSZ_FB_OFFSET 0x1004000 +#define TGA_FOREGROUND_REG 0x0020 +#define TGA_BACKGROUND_REG 0x0024 #define TGA_PLANEMASK_REG 0x0028 +#define TGA_PIXELMASK_ONESHOT_REG 0x002c #define TGA_MODE_REG 0x0030 #define TGA_RASTEROP_REG 0x0034 #define TGA_PIXELSHIFT_REG 0x0038 @@ -47,6 +50,14 @@ #define TGA_RAMDAC_SETUP_REG 0x00c0 #define TGA_BLOCK_COLOR0_REG 0x0140 #define TGA_BLOCK_COLOR1_REG 0x0144 +#define TGA_BLOCK_COLOR2_REG 0x0148 +#define TGA_BLOCK_COLOR3_REG 0x014c +#define TGA_BLOCK_COLOR4_REG 0x0150 +#define TGA_BLOCK_COLOR5_REG 0x0154 +#define TGA_BLOCK_COLOR6_REG 0x0158 +#define TGA_BLOCK_COLOR7_REG 0x015c +#define TGA_COPY64_SRC 0x0160 +#define TGA_COPY64_DST 0x0164 #define TGA_CLOCK_REG 0x01e8 #define TGA_RAMDAC_REG 0x01f0 #define TGA_CMD_STAT_REG 0x01f8 @@ -76,6 +87,22 @@ #define TGA_VALID_BLANK 0x02 #define TGA_VALID_CURSOR 0x04 +#define TGA_MODE_SBM_8BPP 0x000 +#define TGA_MODE_SBM_24BPP 0x300 + +#define TGA_MODE_SIMPLE 0x00 +#define TGA_MODE_SIMPLEZ 0x10 +#define TGA_MODE_OPAQUE_STIPPLE 0x01 +#define TGA_MODE_OPAQUE_FILL 0x21 +#define TGA_MODE_TRANSPARENT_STIPPLE 0x03 +#define TGA_MODE_TRANSPARENT_FILL 0x23 +#define TGA_MODE_BLOCK_STIPPLE 0x0d +#define TGA_MODE_BLOCK_FILL 0x2d +#define TGA_MODE_COPY 0x07 +#define TGA_MODE_DMA_READ_COPY_ND 0x17 +#define TGA_MODE_DMA_READ_COPY_D 0x37 +#define TGA_MODE_DMA_WRITE_COPY 0x1f + /* * Useful defines for managing the ICS1562 PLL clock diff --git a/ipc/msg.c b/ipc/msg.c index f4c494e3c93b..8a7d035dfefc 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -584,7 +584,7 @@ static int testmsg(struct msg_msg* msg,long type,int mode) return 0; } -static int inline pipelined_send(struct msg_queue* msq, struct msg_msg* msg) +static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg) { struct list_head* tmp; @@ -693,7 +693,7 @@ out_free: return err; } -static int inline convert_mode(long* msgtyp, int msgflg) +static inline int convert_mode(long* msgtyp, int msgflg) { /* * find message of correct type. diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index bb880ba4e776..b2d21f78e229 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -4,6 +4,7 @@ * Rewritten and vastly simplified by Rusty Russell for in-kernel * module loader: * Copyright 2002 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation + * Stem compression by Andi Kleen. */ #include <linux/kallsyms.h> #include <linux/module.h> @@ -22,7 +23,7 @@ extern char _stext[], _etext[]; const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, - char **modname) + char **modname, char *namebuf) { unsigned long i, best = 0; @@ -30,6 +31,8 @@ const char *kallsyms_lookup(unsigned long addr, if ((void *)kallsyms_addresses == &kallsyms_dummy) BUG(); + namebuf[127] = 0; + if (addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) { unsigned long symbol_end; char *name = kallsyms_names; @@ -42,8 +45,11 @@ const char *kallsyms_lookup(unsigned long addr, } /* Grab name */ - for (i = 0; i < best; i++) + for (i = 0; i < best; i++) { + ++name; + strncpy(namebuf + name[-1], name, 127); name += strlen(name)+1; + } /* Base symbol size on next symbol. */ if (best + 1 < kallsyms_num_syms) @@ -54,7 +60,7 @@ const char *kallsyms_lookup(unsigned long addr, *symbolsize = symbol_end - kallsyms_addresses[best]; *modname = NULL; *offset = addr - kallsyms_addresses[best]; - return name; + return namebuf; } return module_address_lookup(addr, symbolsize, offset, modname); @@ -66,8 +72,9 @@ void __print_symbol(const char *fmt, unsigned long address) char *modname; const char *name; unsigned long offset, size; + char namebuf[128]; - name = kallsyms_lookup(address, &size, &offset, &modname); + name = kallsyms_lookup(address, &size, &offset, &modname, namebuf); if (!name) { char addrstr[sizeof("0x%lx") + (BITS_PER_LONG*3/10)]; diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c index 1ded416880e8..1499b946b5f5 100644 --- a/net/ipv4/netfilter/ip_nat_snmp_basic.c +++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c @@ -606,7 +606,7 @@ struct snmp_v1_trap #define SERR_NSI 1 #define SERR_EOM 2 -static void inline mangle_address(unsigned char *begin, +static inline void mangle_address(unsigned char *begin, unsigned char *addr, const struct oct1_map *map, u_int16_t *check); @@ -995,7 +995,7 @@ static void fast_csum(unsigned char *csum, * - begin points to the start of the snmp messgae * - addr points to the start of the address */ -static void inline mangle_address(unsigned char *begin, +static inline void mangle_address(unsigned char *begin, unsigned char *addr, const struct oct1_map *map, u_int16_t *check) diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c index 148f21db53b5..d14e7cce6cac 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN.c @@ -22,7 +22,7 @@ MODULE_LICENSE("GPL"); * return 0 in case there was no ECT codepoint * return 1 in case ECT codepoint has been overwritten * return < 0 in case there was error */ -static int inline +static inline int set_ect_ip(struct sk_buff **pskb, struct iphdr *iph, const struct ipt_ECN_info *einfo) { @@ -55,7 +55,7 @@ set_ect_ip(struct sk_buff **pskb, struct iphdr *iph, return 0; } -static int inline +static inline int set_ect_tcp(struct sk_buff **pskb, struct iphdr *iph, const struct ipt_ECN_info *einfo) { diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 4bccbe923690..2db7cc59c2bd 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -106,7 +106,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< quiet_cmd_cc_lst_c = MKLST $@ cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ - $(CONFIG_SHELL) $(src)/scripts/makelst $*.o \ + $(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \ System.map $(OBJDUMP) > $@ %.lst: %.c FORCE @@ -286,7 +286,7 @@ targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ .PHONY: $(subdir-ym) $(subdir-ym): - $(Q)$(MAKE) -f scripts/Makefile.build obj=$@ + $(Q)$(MAKE) $(build)=$@ # Add FORCE to the prequisites of a target to force it to be always rebuilt. # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index e7c392fd5788..07af41d7933e 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -56,8 +56,13 @@ endif .PHONY: $(subdir-ymn) $(subdir-ymn): - $(Q)$(MAKE) -f scripts/Makefile.clean obj=$@ + $(Q)$(MAKE) $(clean)=$@ # If quiet is set, only print short version of command cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) + +# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir +# Usage: +# $(Q)$(MAKE) $(clean)=dir +clean := -f scripts/Makefile.clean obj diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f9136c459970..bc1d58cb93c1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -244,5 +244,10 @@ endef # $(call descend,<dir>,<target>) # Recursively call a sub-make in <dir> with target <target> - +# Usage is deprecated, because make do not see this as an invocation of make. descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2) + +# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= +# Usage: +# $(Q)$(MAKE) $(build)=dir +build := -f scripts/Makefile.build obj diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index ef6736744506..bb0f57dc1cd4 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -93,11 +93,21 @@ write_src(void) { unsigned long long last_addr; int i, valid = 0; + char *prev; + + printf("#include <asm/types.h>\n"); + printf("#if BITS_PER_LONG == 64\n"); + printf("#define PTR .quad\n"); + printf("#define ALGN .align 8\n"); + printf("#else\n"); + printf("#define PTR .long\n"); + printf("#define ALGN .align 4\n"); + printf("#endif\n"); printf(".data\n"); printf(".globl kallsyms_addresses\n"); - printf("\t.align 8\n"); + printf("\tALGN\n"); printf("kallsyms_addresses:\n"); for (i = 0, last_addr = 0; i < cnt; i++) { if (!symbol_valid(&table[i])) @@ -106,30 +116,37 @@ write_src(void) if (table[i].addr == last_addr) continue; - printf("\t.long\t%#llx\n", table[i].addr); + printf("\tPTR\t%#llx\n", table[i].addr); valid++; last_addr = table[i].addr; } printf("\n"); printf(".globl kallsyms_num_syms\n"); - printf("\t.align 8\n"); + printf("\tALGN\n"); printf("kallsyms_num_syms:\n"); - printf("\t.long\t%d\n", valid); + printf("\tPTR\t%d\n", valid); printf("\n"); printf(".globl kallsyms_names\n"); - printf("\t.align 8\n"); + printf("\tALGN\n"); printf("kallsyms_names:\n"); + prev = ""; for (i = 0, last_addr = 0; i < cnt; i++) { + int k; + if (!symbol_valid(&table[i])) continue; if (table[i].addr == last_addr) continue; - printf("\t.string\t\"%s\"\n", table[i].sym); + for (k = 0; table[i].sym[k] && table[i].sym[k] == prev[k]; ++k) + ; + + printf("\t.asciz\t\"\\x%02x%s\"\n", k, table[i].sym + k); last_addr = table[i].addr; + prev = table[i].sym; } printf("\n"); } diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index a6ebd0173b02..927d00fe7814 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -38,7 +38,7 @@ MOC = $(QTDIR)/bin/moc # QT needs some extra effort... $(obj)/.tmp_qtcheck: - @set -e; for d in $$QTDIR /usr/share/qt /usr/lib/qt3; do \ + @set -e; for d in $$QTDIR /usr/share/qt /usr/lib/qt*3*; do \ if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \ done; \ if [ -z "$$DIR" ]; then \ diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c index c3ac13446810..ecbe731fcb6a 100644 --- a/sound/oss/esssolo1.c +++ b/sound/oss/esssolo1.c @@ -266,7 +266,7 @@ static inline int read_seq(struct solo1_state *s, unsigned char *data) return 0; } -static int inline reset_ctrl(struct solo1_state *s) +static inline int reset_ctrl(struct solo1_state *s) { int i; diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c index b0c360a24992..569ba8fd386c 100644 --- a/sound/oss/nec_vrc5477.c +++ b/sound/oss/nec_vrc5477.c @@ -882,7 +882,7 @@ static int drain_dac(struct vrc5477_ac97_state *s, int nonblock) /* --------------------------------------------------------------------- */ -static int inline +static inline int copy_two_channel_adc_to_user(struct vrc5477_ac97_state *s, char *buffer, int copyCount) @@ -912,7 +912,7 @@ copy_two_channel_adc_to_user(struct vrc5477_ac97_state *s, } /* return the total bytes that is copied */ -static int inline +static inline int copy_adc_to_user(struct vrc5477_ac97_state *s, char * buffer, size_t count, @@ -1039,7 +1039,7 @@ vrc5477_ac97_read(struct file *file, return ret; } -static int inline +static inline int copy_two_channel_dac_from_user(struct vrc5477_ac97_state *s, const char *buffer, int copyCount) @@ -1073,7 +1073,7 @@ copy_two_channel_dac_from_user(struct vrc5477_ac97_state *s, } /* return the total bytes that is copied */ -static int inline +static inline int copy_dac_from_user(struct vrc5477_ac97_state *s, const char *buffer, size_t count, diff --git a/sound/synth/Makefile b/sound/synth/Makefile index 65909dddea39..6ce9c8e630d7 100644 --- a/sound/synth/Makefile +++ b/sound/synth/Makefile @@ -10,7 +10,7 @@ snd-util-mem-objs := util_mem.o # Toplevel Module Dependency obj-$(CONFIG_SND_EMU10K1) += snd-util-mem.o obj-$(CONFIG_SND_TRIDENT) += snd-util-mem.o -ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y) +ifdef CONFIG_SND_SEQUENCER obj-$(CONFIG_SND_SBAWE) += snd-util-mem.o obj-$(CONFIG_SND) += emux/ endif diff --git a/sound/synth/emux/Makefile b/sound/synth/emux/Makefile index fdf79a1860b2..8667a1badabc 100644 --- a/sound/synth/emux/Makefile +++ b/sound/synth/emux/Makefile @@ -5,14 +5,9 @@ export-objs := emux.o -snd-emux-synth-objs := emux.o emux_synth.o emux_seq.o emux_nrpn.o \ - emux_effect.o emux_proc.o soundfont.o -ifeq ($(CONFIG_SND_SEQUENCER_OSS),y) - snd-emux-synth-objs += emux_oss.o -endif +snd-emux-synth-y := emux.o emux_synth.o emux_seq.o emux_nrpn.o \ + emux_effect.o emux_proc.o soundfont.o +snd-emux-synth-$(CONFIG_SND_SEQUENCER_OSS) += emux_oss.o -# Toplevel Module Dependency -ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y) - obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o - obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o -endif +obj-$(CONFIG_SND_SBAWE) += snd-emux-synth.o +obj-$(CONFIG_SND_EMU10K1) += snd-emux-synth.o |
