linux/drivers
Bjorn Helgaas ea44c1d60d PNP: fix formatting of dbg_pnp_show_resources() output
Each resource should be printed on its own line, so start snprintf'ing
at the beginning of the buffer every time through the loop.

Also, use scnprintf() rather than snprintf() when building up the
buffer to print.  scnprintf() returns the number of characters actually
written into the buffer (not including the trailing NULL).

snprintf() returns the number of characters that *would be* written,
assuming everything would fit in the buffer.  That's nice if we want to
resize the buffer to make sure everything fits, but in this case, I
just want to keep from overflowing the buffer, and it's OK if the
output is truncated.

Using snprintf() meant that my "len" could grow to be more than the
the buffer size, which makes "sizeof(buf) - len" negative, which causes
this alarming WARN_ON:
    http://marc.info/?l=linux-kernel&m=121736480005656&w=2

More useful snprintf/scnprintf discussion:
    http://lwn.net/Articles/69419/

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reported-by: Pete Clements <clem@clem.clem-digital.net>
Cc: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-01 12:46:41 -07:00
..
accessibility
acpi Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
amba
ata pata_it821x: Driver updates and reworking 2008-07-31 02:04:50 -04:00
atm atm: fix direct casts of pointers to u32 in the InterPhase driver 2008-07-30 16:33:05 -07:00
auxdisplay auxdisplay: small cleanups 2008-07-24 10:47:41 -07:00
base Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-08-01 11:52:39 -07:00
block Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
bluetooth bluetooth: add quirks for a few hci_usb devices 2008-07-30 17:19:35 -07:00
cdrom sh: More header path fixups for mach dir refactoring. 2008-07-29 22:10:01 +09:00
char Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2008-07-30 10:43:56 -07:00
clocksource Fix printk format warning in clocksource/acpi_pm.c 2008-07-15 11:01:39 -07:00
connector
cpufreq cpufreq acpi: only call _PPC after cpufreq ACPI init funcs got called already 2008-07-30 09:41:43 -07:00
cpuidle ACPI/CPUIDLE: prevent setting pm_idle to NULL 2008-07-28 08:31:58 -07:00
crypto crypto: talitos - sparse fix 2008-07-17 20:20:59 +08:00
dca Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2008-07-23 12:03:18 -07:00
dio dio: use dio_match_device() in dio_bus_match() 2008-07-20 17:24:40 -07:00
dma I/OAT: I/OAT version 3.0 support 2008-07-22 17:30:57 -07:00
edac edac: mpc85xx fix pci ofdev 2nd pass 2008-07-25 10:53:49 -07:00
eisa driver core: remove DEVICE_NAME_SIZE define 2008-07-21 21:54:53 -07:00
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2008-07-27 10:24:06 -07:00
firmware iscsi_ibft_find: fix modpost warning 2008-07-30 09:41:44 -07:00
gpio gpio: max732x driver 2008-07-25 10:53:30 -07:00
gpu Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
hid Merge branches 'upstream' and 'upstream-fixes' into for-linus 2008-07-23 15:26:10 +02:00
hwmon Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6 2008-08-01 11:33:19 -07:00
i2c i2c: Blackfin I2C Driver: Functional power management support 2008-07-28 12:41:03 +01:00
ide ide/powermac: Fix use of uninitialized pointer on media-bay 2008-07-30 15:26:53 +10:00
ieee1394 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
infiniband Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
input sh: More header path fixups for mach dir refactoring. 2008-07-29 22:10:01 +09:00
isdn hysdn: remove the packed attribute from PofTimStamp_tag 2008-07-30 16:48:05 -07:00
leds leds: Ensure led->trigger is set earlier 2008-07-23 09:49:56 +01:00
lguest lguest: use cpu capability accessors 2008-07-29 09:58:34 +10:00
macintosh device create: macintosh: convert device_create to device_create_drvdata 2008-07-21 21:54:43 -07:00
mca driver core: remove DEVICE_NAME_SIZE define 2008-07-21 21:54:53 -07:00
md Merge branch 'for-linus' of git://neil.brown.name/md 2008-08-01 11:56:07 -07:00
media Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
memstick memstick: use fully asynchronous request processing 2008-07-26 12:00:04 -07:00
message Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-27 10:04:52 -07:00
mfd mfd: accept pure device as a parent, not only platform_device 2008-07-29 01:30:26 +02:00
misc add reverse dependency of CONFIG_SGI_XP upon CONFIG_SGI_GRU 2008-08-01 12:26:03 -07:00
mmc au1xmmc: raise segment size limit. 2008-08-01 19:04:26 +02:00
mtd Merge git://git.infradead.org/mtd-2.6 2008-08-01 11:29:54 -07:00
net Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
nubus
of spi: Add OF binding support for SPI busses 2008-07-25 22:34:40 -04:00
oprofile
parisc
parport make parport_cs_release() static 2008-07-26 12:00:11 -07:00
pci PCI: add D3 power state avoidance quirk 2008-07-28 15:12:11 -07:00
pcmcia [ARM] 5179/1: Replace obsolete IRQT_* and __IRQT_* values with IRQ_TYPE_* 2008-07-27 09:46:18 +01:00
pnp PNP: fix formatting of dbg_pnp_show_resources() output 2008-08-01 12:46:41 -07:00
power Merge branch 'master' of /home/cbou/linux-2.6 2008-07-30 02:05:23 +04:00
ps3
rapidio
regulator regulator: TI bq24022 Li-Ion Charger driver 2008-07-30 10:10:23 +01:00
rtc rtc-dev: stop periodic interrupts on device release 2008-07-30 09:41:47 -07:00
s390 [S390] qeth: avoid use of include/asm-s390 2008-08-01 16:39:36 +02:00
sbus sparc64: fix up bus_id changes in sparc core code 2008-07-21 21:55:03 -07:00
scsi [SCSI] qla2xxx: fix msleep compile error 2008-07-28 10:13:22 -05:00
serial Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2008-08-01 10:53:43 -07:00
sh sh/maple: clean maple bus code 2008-07-29 22:10:56 +09:00
sn
spi spi_s3c24xx: really assign busnum 2008-07-28 16:30:21 -07:00
ssb
tc
telephony ixj: push BKL into driver and wrap ioctls 2008-07-25 10:53:43 -07:00
thermal
uio UIO: add generic UIO platform driver 2008-07-21 21:54:55 -07:00
usb USB: m66592-udc: Fix up dev_set_name() badness. 2008-07-30 09:41:46 -07:00
video Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
virtio virtio: Add transport feature handling stub for virtio_ring. 2008-07-25 12:06:14 +10:00
w1 w1/ds2482: Convert to a new-style driver 2008-07-16 19:30:07 +02:00
watchdog hpwdt: don't use static flags 2008-07-30 09:41:45 -07:00
xen sysdev: Pass the attribute to the low level sysdev show/store function 2008-07-21 21:55:02 -07:00
zorro move memory_read_from_buffer() from fs.h to string.h 2008-07-24 10:47:13 -07:00
Kconfig
Makefile regulator: core kbuild files 2008-07-30 10:10:22 +01:00