aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2007-07-18UBI: bugfix in error pathArtem Bityutskiy
When volume creation fails, we have to set ubi->volumes[vol_id] back to NULL. This patch also tweaks some debugging stuff. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: use is_power_of_2()Vignesh Babu
Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2 Signed-off-by: Vignesh Babu <vignesh.babu@wipro.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: fix freeing ubi->vtbl while unloadingVinit Agnihotri
ubi->vtbl is allocated using vmalloc() in vtbl.c empty_create_lvol(), but it is freed in build.c with kfree() Signed-off-by: Vinit Agnihotri <vinit.agnihotri@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: bugfix in ubi_leb_change()Artem Bityutskiy
Do not call 'ubi_wl_put_peb()' if the LEB was unmapped. Reported-by: Gabor Loki <loki@inf.u-szeged.hu> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: kill homegrown endian macrosChristoph Hellwig
Kill UBI's homegrown endianess handling and replace it with the standard kernel endianess handling. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: cleanup ioctl handlingChristoph Hellwig
- don't do access_ok + get/put user but use the proper macro - remove useless checks Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: error path bugfixArtem Bityutskiy
No need to unlock the lock, this will be done at out_unlock. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: minor comma fixArtem Bityutskiy
Use coma at the the last elements of structure initializer. Daniel Stone's explanation: Because it turns: - .attr = foo + .attr = foo, + .bar = baz into: + .bar = baz, i.e., far less likely to screw up a merge. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: use vmalloc for large buffersArtem Bityutskiy
UBI allocates temporary buffers of PEB size, which may be 256KiB. Use vmalloc instead of kmalloc for such big temporary buffers. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: add few more commentsArtem Bityutskiy
Add few comments above ubi_scan_add_used() to explain why it is so complex. Requested by Satyam Sharma <satyam.sharma@gmail.com>. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: set correct gluebi device sizeArtem Bityutskiy
In case of static volumes, make emulated MTD device size to be equivalent to data size, rather then volume size. Reported-by: John Smith <john@arrows.demon.co.uk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: do not let to read too muchArtem Bityutskiy
In case of static volumes it is prohibited to read more data then available. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: fix error path in create_vtbl()Artem Bityutskiy
There were several bugs in volume table creation error path. Thanks to Satyam Sharma <satyam.sharma@gmail.com> and Florin Malita <fmalita@gmail.com> for finding and analysing them: http://lkml.org/lkml/2007/5/3/274 This patch makes ubi_scan_add_to_list() static and renames it to add_to_list(), just because it is not needed outside scan.c anymore. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: fix dereference after kfreeFlorin Malita
Coverity (CID 1614) spotted new_seb being dereferenced after kfree() in create_vtbl's write_error path. Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18UBI: fix memory leak in checking codeArtem Bityutskiy
Reported-by: Eric Sesterhenn / Snakebyte <snakebyte@gmx.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-17Revert drivers/ide/ide.c scsi_cmd_ioctl() usage changesLinus Torvalds
The old IDE driver is not ready to take generic SCSI commands, even if it uses them for some specific issues (ie the tray open/close ioctls for IDE CD-ROM's). Pointed out by Bartlomiej. I'm sure we'll have it fixed properly soon enough, but for now we should not allow it to cause problems. Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17Make the "z/VM unit record device driver" depend on S390Linus Torvalds
I really don't see anybody else wanting to select it ;) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6Linus Torvalds
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [S390] Fix broken logic, SIGA flags must be bitwise ORed [S390] cio: Dont print trailing \0 in modalias_show(). [S390] Simplify stack trace. [S390] z/VM unit record device driver [S390] vmcp cleanup [S390] qdio: output queue stall on FCP and network devices [S390] Fix disassembly of RX_URRD, SI_URD & PC-relative instructions. [S390] Update default configuration.
2007-07-17Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdogLinus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog: (21 commits) [WATCHDOG] at32ap700x_wdt.c - Fix compilation warnings [WATCHDOG] at32ap700x_wdt.c - Add spinlock support [WATCHDOG] at32ap700x_wdt.c - Add nowayout + MAGICCLOSE features [WATCHDOG] at32ap700x_wdt.c - timeout module parameter patch [WATCHDOG] at32ap700x_wdt.c - checkpatch.pl-0.05 clean-up's [WATCHDOG] change s3c2410_wdt to using dev_() macros for output [WATCHDOG] s3c2410_wdt announce initialisation [WATCHDOG] at32ap700x-wdt: add iounmap if probe function fails [WATCHDOG] at32ap700x-wdt: add missing iounmap in _remove [WATCHDOG] watchdog-driver-for-at32ap700x-devices-fix-2 [WATCHDOG] watchdog-driver-for-at32ap700x-devices-fix [WATCHDOG] Watchdog driver for AT32AP700X devices [WATCHDOG] Mixcom Watchdog - CodingStyle clean-up [WATCHDOG] Mixcom Watchdog - clean-up printk's [WATCHDOG] Mixcom Watchdog - clean-up printk's [WATCHDOG] Mixcom Watchdog - checkcard part 2 [WATCHDOG] Mixcom Watchdog - checkcard [WATCHDOG] Mixcom Watchdog - get rid of port offset's [WATCHDOG] Mixcom Watchdog - update "Documentation" [WATCHDOG] Remove the redundant check for pwrite() in EP93XXX watchdog. ...
2007-07-17Merge branch 'isdn-cleanup' of ↵Linus Torvalds
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 * 'isdn-cleanup' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6: [ISDN] HiSax hfc_pci: minor cleanups [ISDN] HiSax bkm_a4t: split setup into two smaller functions [ISDN] HiSax enternow: split setup into 3 smaller functions [ISDN] HiSax netjet_u: split setup into 3 smaller functions [ISDN] HiSax netjet_s: code movement, prep for hotplug [ISDN] HiSax: move card state alloc/setup code into separate functions [ISDN] HiSax: move card setup into separate function
2007-07-17Merge branch 'uninit-var' of ↵Linus Torvalds
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 * 'uninit-var' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6: arch/i386/* fs/* ipc/*: mark variables with uninitialized_var() drivers/*: mark variables with uninitialized_var()
2007-07-17Merge branch 'warnings' of ↵Linus Torvalds
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 * 'warnings' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6: drivers/atm/ambassador: kill uninit'd var warning, and fix bug [libata] sata_mv: use pci_try_set_mwi() drivers/infiniband/hw/mthca/mthca_qp: kill uninit'd var warning drivers/net/wan/sbni: kill uninit'd var warning drivers/mtd/ubi/eba: minor cleanup: tighten scope of a local var drivers/telephony/ixj: cleanup and fix gcc warning drivers/net/wan/pc300_drv: fix bug caught by gcc warning drivers/usb/misc/auerswald: fix status check, remove redundant check [netdrvr] eepro100, ne2k-pci: abort resume if pci_enable_device() fails [netdrvr] natsemi: Fix device removal bug kernel/auditfilter: kill bogus uninit'd-var compiler warning
2007-07-17[ISDN] HiSax hfc_pci: minor cleanupsJeff Garzik
* trim trailing whitespace * remove CONFIG_PCI ifdefs, this driver is always PCI (Kconfig enforced) * remove return statements at the tail of a function * remove indentation levels by returning an error code immediately. Makes the code much more readable, and easier to update to PCI hotplug API. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[ISDN] HiSax bkm_a4t: split setup into two smaller functionsJeff Garzik
No behavior changes, just code movement. Prep for PCI hotplug API. Well, CONFIG_PCI useless ifdef was removed. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[ISDN] HiSax enternow: split setup into 3 smaller functionsJeff Garzik
No behavior changes, just code movement. Prep for PCI hotplug API. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[ISDN] HiSax netjet_u: split setup into 3 smaller functionsJeff Garzik
No behavior changes, just code movement. Prep for PCI hotplug API. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[ISDN] HiSax netjet_s: code movement, prep for hotplugJeff Garzik
1) Remove CONFIG_PCI ifdefs. PCI is required in Kconfig. 2) Break up setup_netjet_s() into three separate internal functions. This helps facilitate upcoming use of PCI hotplug API, and in addition makes the code much easier to follow. No code is changed, just moved around. I even kept the out-of-favor "return(0)" style used in the current source code. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[ISDN] HiSax: move card state alloc/setup code into separate functionsJeff Garzik
Just code movement. No code changes or cleanups besides that which is required to call the new functions from the old code site. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[ISDN] HiSax: move card setup into separate functionJeff Garzik
No behavior changes, just code movement. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17hppb: Add missing dma-mapping.h includeFrank Lichtenheld
This fixes the following build-error: CC drivers/parisc/hppb.o drivers/parisc/hppb.c: In function ‘hppb_probe’: drivers/parisc/hppb.c:73: error: implicit declaration of function ‘ccio_request_resource’ Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17drivers/*: mark variables with uninitialized_var()Jeff Garzik
Mark variables in drivers/* with uninitialized_var() if such a warning appears, and analysis proves that the var is initialized properly on all paths it is used. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17drivers/atm/ambassador: kill uninit'd var warning, and fix bugJeff Garzik
An uninitialized variable warning illuminated an area where indeed the variable was being used without initialization. Unfortunately, after verifying all such paths were fixed, the warning still appears. So we follow the initialization practice of other variables in this function. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[libata] sata_mv: use pci_try_set_mwi()Jeff Garzik
Because sometimes in life, it's ok to fail. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17drivers/infiniband/hw/mthca/mthca_qp: kill uninit'd var warningJeff Garzik
drivers/infiniband/hw/mthca/mthca_qp.c: In function ‘mthca_tavor_post_send’: drivers/infiniband/hw/mthca/mthca_qp.c:1594: warning: ‘f0’ may be used uninitialized in this function drivers/infiniband/hw/mthca/mthca_qp.c: In function ‘mthca_arbel_post_send’: drivers/infiniband/hw/mthca/mthca_qp.c:1949: warning: ‘f0’ may be used uninitialized in this function Initializing 'f0' is not strictly necessary in either case, AFAICS. I was considering use of uninitialized_var(), but looking at the complex flow of control in each function, I feel it is wiser and safer to simply zero the var and be certain of ourselves. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17drivers/net/wan/sbni: kill uninit'd var warningJeff Garzik
It's actually convenient in the code to initialize this and a sister variable to zero. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17drivers/mtd/ubi/eba: minor cleanup: tighten scope of a local varJeff Garzik
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17drivers/telephony/ixj: cleanup and fix gcc warningJeff Garzik
1) Fix gcc uninit'd var warnings by adding 'default' switch stmt labels in two cases. It was lightning-strikes unlikely that a problem would ever arise, but not impossible. 2) Tighten the scope of 'blankword' in two cases. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17drivers/net/wan/pc300_drv: fix bug caught by gcc warningJeff Garzik
The warning drivers/net/wan/pc300_drv.c: In function ‘cpc_open’: drivers/net/wan/pc300_drv.c:2942: warning: ‘br’ may be used uninitialized in this function was valid. Ensure 'br' is initialized in all cases. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17drivers/usb/misc/auerswald: fix status check, remove redundant checkJeff Garzik
1) We should only set 'actual_length' output variable if usb length is known to be good. 2) No need to check actual_length for NULL. The only caller always passes non-NULL value. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[netdrvr] eepro100, ne2k-pci: abort resume if pci_enable_device() failsJeff Garzik
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17[netdrvr] natsemi: Fix device removal bugJeff Garzik
This episode illustrates how an overused warning can train people to ignore that warning, which winds up hiding bugs. The warning drivers/net/natsemi.c: In function ‘natsemi_remove1’: drivers/net/natsemi.c:3222: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result is oft-ignored, even though at close inspection one notices this occurs in the /remove/ function, not normally where creation occurs. A quick s/create/remove/ and we are fixed, with the warning gone. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-17Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (80 commits) KVM: Use CPU_DYING for disabling virtualization KVM: Tune hotplug/suspend IPIs KVM: Keep track of which cpus have virtualization enabled SMP: Allow smp_call_function_single() to current cpu i386: Allow smp_call_function_single() to current cpu x86_64: Allow smp_call_function_single() to current cpu HOTPLUG: Adapt thermal throttle to CPU_DYING HOTPLUG: Adapt cpuset hotplug callback to CPU_DYING HOTPLUG: Add CPU_DYING notifier KVM: Clean up #includes KVM: Remove kvmfs in favor of the anonymous inodes source KVM: SVM: Reliably detect if SVM was disabled by BIOS KVM: VMX: Remove unnecessary code in vmx_tlb_flush() KVM: MMU: Fix Wrong tlb flush order KVM: VMX: Reinitialize the real-mode tss when entering real mode KVM: Avoid useless memory write when possible KVM: Fix x86 emulator writeback KVM: Add support for in-kernel pio handlers KVM: VMX: Fix interrupt checking on lightweight exit KVM: Adds support for in-kernel mmio handlers ...
2007-07-17atl1: missing includeAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17mark a bunch of ISA|EISA|PCI drivers as suchAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17no USB on M32RAl Viro
Won't build due to lack of dma-mapping. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17md: change bitmap_unplug and others to void functionsNeilBrown
bitmap_unplug only ever returns 0, so it may as well be void. Two callers try to print a message if it returns non-zero, but that message is already printed by bitmap_file_kick. write_page returns an error which is not consistently checked. It always causes BITMAP_WRITE_ERROR to be set on an error, and that can more conveniently be checked. When the return of write_page is checked, an error causes bitmap_file_kick to be called - so move that call into write_page - and protect against recursive calls into bitmap_file_kick. bitmap_update_sb returns an error that is never checked. So make these 'void' and be consistent about checking the bit. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17md: check that internal bitmap does not overlap other dataNeilBrown
We current completely trust user-space to set up metadata describing an consistant array. In particlar, that the metadata, data, and bitmap do not overlap. But userspace can be buggy, and it is better to report an error than corrupt data. So put in some appropriate checks. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17md: improve the is_mddev_idle test fixNeilBrown
Don't use 'unsigned' variable to track sync vs non-sync IO, as the only thing we want to do with them is a signed comparison, and fix up the comment which had become quite wrong. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17md: improve message about invalid superblock during autodetectNeilBrown
People try to use raid auto-detect with version-1 superblocks (which is not supported) and get confused when they are told they have an invalid superblock. So be more explicit, and say it it is not a valid v0.90 superblock. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17Use menuconfig objects II - MDJan Engelhardt
Change Kconfig objects from "menu, config" into "menuconfig" so that the user can disable the whole feature without having to enter the menu first. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>