Skip to contentSkip to conversation

Linux 2.5.21

PATCH New Linus Torvalds 25 participants 99 messages Jun 9, 2002 – Jun 16, 2002 Page 1 of 2

Subsystems (23)
lore
Share & tools
lore
#0 lore raw

The bulk of the changes are the s390 merge bits, but there are small details like fixing some races in the new unplugging code etc, more driverfs, USB, framebuffer updates etc.

The most noticeable changes (and that people will probably find some nagging missing things with) are the header file cleanups - expect some missing headers here and there - and the kernel build changes. Different dependency stuff etc.

Linus

-----

Summary of changes from v2.5.20 to v2.5.21
============================================

<[email protected]>:
o ipchains_core netlink fix
o ipchains_core GFP_KERNEL fix

<[email protected]>:
o USB SA-1111 patch against usb-2.5 bitkeeper

<[email protected]>:
o fix NULL dereferencing in dcache.c

<[email protected]>:
o must be __KERNEL__ for byteorder/generic.h

<[email protected]>:
o USB pwc webcam patch

<[email protected]>:
o Missing include in mm/bootmem.c

<[email protected]>:
o fix for /proc operation

<[email protected]>:
o 2.5.20 ov511.c compile fixes

<[email protected]>:
o s/390 patches for 2.5.20 (1..4)

<[email protected]>:
o fs/locks.c: Only yield once for flocks
o fs/locks.c: remove MSNFS define
o fs/locks.c: more cleanup

<[email protected]>:
o correct zone_table comment
o duplicate decl in sched_init()
o make memclass() an inline
o remove antiquated comment
o remove macros from page_alloc.c
o static list init page_alloc.c

<[email protected]>:
o bluesmoke merge

Adrian Bunk <[email protected]>:
o UHCI bix for build error under unstable debian

Alexey Kuznetsov <[email protected]>:
o net/sched fixes
o ipv6 raw fixes

Anton Altaparmakov <[email protected]>:
o NTFS: Remove unused source file
o NTFS: The beginning of 2.0.8. - Major updates for handling of case sensitivity
o NTFS: Fix really dumb logic bug in boot sector recovery
o NTFS: Fix potential 1 byte overflow in fs/ntfs/unistr.c::ntfs_ucstonls()
o NTFS: 2.0.8 release. Major updates for dcache aliasing issues wrt short/long file names

Anton Blanchard <[email protected]>:
o Fix for recent swap changes on 64 bit archs

Arnaldo Carvalho de Melo <[email protected]>:
o net/ipv4/af_inet.c
o net/ipv4/devinet.c
o net/ipv4/icmp.c
o net/core/dev.c
o net/ipv4/tcp_ipv4.c
o arch/* drivers/cdrom/* drivers/char/*

Brad Hards <[email protected]>:
o "General options" - begone

Brian Gerst <[email protected]>:
o fs/inode.c list_del_init
o missing GET_CPU_IDX in i386 entry.S

Christoph Hellwig <[email protected]>:
o kbuild: remove CLEAN_DIRS from Makfile
o kbuild: small toplevel makefile tidyup

Dave Jones <[email protected]>:
o large x86 setup cleanup

Dave Kleikamp <[email protected]>:
o JFS: Fix structure alignment problem on 64-bit machines
o JFS: Add hch's copyright
o JFS: remove obsolete declaration

David Brownell <[email protected]>:
o ohci-hcd, fix urb unlink races
o synchronous control/bulk messaging
o uhci-hcd misc
o relocate error checks

David S. Miller <[email protected]>:
o net/core/dev.c: Do not cast pointers to int, use long
o sk->num no longer exists in 2.5, use inet_sk(sk)->num
o net/core/dev.c: Make handle_diverter return 0
o Bonding driver: Merge 2.4.x driver updates into 2.5
o asm-generic.h: Add forward siginfo decl for the sake of HAVE_ARCH_SIGINFO_T platforms.
o init/main.c: Revert recent GCC requirement change
o Fix generic device layer init sequence
o SunRPC: Fix size_t vs. unsigned int arg descrepancy
o register_netdevice: Fix return value handling on success
o sparc64/kernel/Makefile: Remove bogus binfmt_elf32.o dependency target
o Sparc64: Propagate exec MM handling changes to sparc32 emulation layer
o Sparc64: Propagate forget_pte changes to sparc64 ioremap
o Sparc: Adjust to new {clear,copy}_user_page calling convention
o IDE: Print I/O ports more portably
o IDE: Add missing printf format specifier when printing Sparc IRQ.
o IDE: Print 64-bit types more portably

David Woodhouse <[email protected]>:
o Shared zlib include fix for 2.5 and 2.4-ac

Ghozlane Toumi <[email protected]>:
o update to pci_quirks.c

Greg Kroah-Hartman <[email protected]>:
o USB: emi26.c small fix to enable the driver to build properly
o USB: formatting cleanups for some USB drivers from the 2.5.20-dj3 tree
o Added usb-midi driver from NAGANO Daisuke with some porting from me
o USB: split some pci specific pieces out of hcd.c into a separate file
o USB: usb-midi driver: fixed memory flag, as pointed out by Oliver Neukum
o USB: hcd cleanups and documentation
o IBM PCI Hotplug driver: polling thread locking cleanup
o PCI Hotplug core: added #include <linux/namei.h> to fix compile time warning
o IBM PCI Hotplug driver: added __init and __exit to functions that needed it

James Simmons <[email protected]>:
o Reversed a mistake in cyber200fb.c Finshed porting the 3Dfx driver over to the new api
o Ported over NeoMagic over to new api
o Fixed a nasty bug in the 3Dfx driver and added the ahrdware routines for the NeoMagic chipset
o Bug fixes for NeoMagic and 3Dfx driver
o More bug fixes. When will it end?
o Ported over the apollo framebuffer device. Updated the Permedia 2 fbdev driver to the latest code. Small bug fix for the NeoMagic driver.
o Ported the Maxine framebuffer driver to the new api
o A few small fixes from porting it over to the new api. ALso a few more drivers from the MIPS platform ported over
o Ported over the TX3912 framebuffer to the new api. Fixed a NODEV error for the Permedia framebuffer driver and patched fbcmap.c to prevent another Oops
o Bug fixes for the fbdev layer

Jens Axboe <[email protected]>:
o unplugging fix

Kai Germaschewski <[email protected]>:
o kbuild: Split Makefile into needs / needs not .config
o kbuild: Fix make -s (silent) and add a quiet mode
o kbuild: Fix 'make some/dir/foo.lst'
o kbuild: Fix calling of scripts
o kbuild: Make dependencies at compile time
o kbuild: Use deep directory structure for include/linux/modules
o kbuild: Clean up descending into subdirs
o kbuild: Really stick with verbose output by default
o kbuild: modversions improvements
o kbuild: Build modules by default
o kbuild: Use a standard "update-if-changed"
o kbuild: -DMODULE for assembler source
o kbuild: Additional config targets for testing
o kbuild: Remove 2048 symbol limit from make xconfig
o kbuild
o kbuild: Fix tolower() usage in scripts/fixdep.c
o kbuild: Use -nostdinc with kernel sources
o kbuild: Enforce UTS limit, use LANG=C for date/time
o kbuild: Add rules for compiling programs on the host
o kbuild: Fix extracting of CONFIG_ references
o kbuild: dependency generation fixes
o ISDN: Add missing #include <linux/init.h>
o ISDN: Fix a typo in drivers/isdn/hisax/elsa.c
o ISDN/CAPI: Remove some left-over from the capi_driver removal
o ISDN: Add PPP statistics in bytes
o ISDN: Export all hisax symbols from drivers/isdn/hisax/config.o
o ISDN: hisax/hfc_pci.c: sync with 2.4
o ISDN: Add support for USR PCI TA
o ISDN: Cisco HDLC update
o ISDN: Add support for Eicon Diva 2.02
o ISDN: Add DoV (Data over Voice) support
o ISDN: Add support for Formula-n enter:now, a.k.a. Gerdes Power ISDN
o ISDN: Add in-kernel ISAPnP support to HiSax driven cards
o ISDN: MPPP crash fix
o ISDN: LED support for netjet driver
o ISDN/CAPI: Don't use special slab caches for CAPI objects

Linus Torvalds <[email protected]>:
o Split up "iput()" and make it more readable
o Fix extra parenthesis in the constant-address rwlock case
o ACPI sleep depends on software suspend (at least for now)
o Fall-out from header file cleanups
o "make clean": get rid of temporary directories too
o Kernel version 2.5.21
o Clean up and fix Makefile from x86 CPU split
o Fix x86 CPU merge dangling ends
o Fix sound compile error exposed by header file cleanups

Martin Dalecki <[email protected]>:
o 2.5.20 airo wireless - "I can't get no, compilation..."
o 2.5.20 IDE 83..85

Nicolas Pitre <[email protected]>:
o [ARM PATCH] 1166/1: further cleanup of SA1110 suspend/resume code

    (2.5) Same thing as patch #1165/1 but for 2.5.x

Patrick Mochel <[email protected]>:
o device model udpate
o Do manual traversing of drivers' devices list when unbinding the driver
o PCI driver mgmt
o Change unused_initcall to postcore_initcall for things that must be initialized early, but not too early (after the core is done)
o s/subsys_initcall/postcore_initcall/ for sys_bys and pci, so they get initialized early enough for arch and subsys initcalls to use them
o device model update s/{driver,device}_bind/{driver,device}_attach/ and s/{driver,device}_unbind/{driver,device}_detach/ call bus's match callback instead of bind callback
o Attempt to better locking in device model core
o Don't reference driver after you set pointer to NULL in device_detach
o device detach locking, one more time: get driver and reset it in struct device before calling remove()

Pavel Machek <[email protected]>:
o Re: Fix suspend-to-RAM in 2.5.20

Pavel Machek <[email protected]>:
o Fix suspend-to-RAM in 2.5.20
o Cleanup swsusp in 2.5.20
o 2.5.20 swsusp: stop abusing headers with non-inlined functions

Peter Chubb <[email protected]>:
o bogus casts in ide-cd.c

Petr Vandrovec <[email protected]>:
o matroxfb dies when you try to use secondary head in 2.5.x

Randy Hron <[email protected]>:
o remove space in cache names

Rob Radez <[email protected]>:
o Sparc32 code cleanups from 2.4.x

Robert Love <[email protected]>:
o remove wq_lock_t cruft
o capability.c cleanup
o trivial misc. scheduler cleanups
o maintainers update
o make smp.c preempt-safe
o sys_sysinfo cleanup
o remove suser()
o remove fsuser()
o capability.c thinko
o set_cpus_allowed fix

Russell King <[email protected]>:
o fix 2.5.20 ramdisk
o Allow mpage.c to build

Russell King <[email protected]>:
o [ARM] Makefile and page.h ARM updates for 2.5.20
o [ARM] Clean up map_desc structure
o [ARM] Cast thread_saved_{pc,fp} to unsigned long

Rusty Russell <[email protected]>:
o Spelling
o TAGS creation should go into arch dirs
o Futex update I: Trivial comment removal
o Futex II: Copy-from-user can fail
o Futex update III: don't use put_page
o Futex update IV: use a waitqueue

Simon Evans <[email protected]>:
o fix urb->next removal in konicawc driver
o fix urb->next removal in usbvideo

Stephen Rothwell <[email protected]>:
o fs/locks.c use list_del_init
o fcntl_[sg]etlk() only need the file *
o fs/locks.c: add and use IS_{POSIX, FLOCK, LEASE} macros

Tom Rini <[email protected]>:
o Cleanup i386 <linux/init.h> abuses
o Have core/drivers.c include <linux/gfp.h>
o Move vmalloc wrappers out of include/linux/vmalloc.h
o Remove <linux/mm.h> from <linux/vmalloc.h>
o More work on removing <linux/mm.h> from <linux/vmalloc.h>

Trond Myklebust <[email protected]>:
o Fix Oops due to use of incorrect km_type in RPC socket code
o Reduce number of LOOKUP calls in nfs_lookup_revalidate()
o Catch a few more cases where we need to renew inode->d_time

#1 lore raw

2.5.21 -- suspend.h:58: parse error before "__nosavedata"

gcc -Wp,-MD,.suspend.o.d -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -nostdinc -iwithprefix include -DKBUILD_BASENAME=suspend -DEXPORT_SYMTAB -c -o suspend.o suspend.c
In file included from suspend.c:40:
/usr/src/linux/include/linux/suspend.h:58: parse error before "__nosavedata" /usr/src/linux/include/linux/suspend.h:58: warning: type defaults to int' in declaration of __nosavedata' /usr/src/linux/include/linux/suspend.h:58: warning: data definition has no type or storage class /usr/src/linux/include/linux/suspend.h:59: parse error before "__nosavedata" /usr/src/linux/include/linux/suspend.h:59: warning: type defaults to int' in declaration of __nosavedata' /usr/src/linux/include/linux/suspend.h:59: warning: data definition has no type or storage class suspend.c:306:2: warning: #warning This might be broken. We need to somehow wait for data to reach the disk suspend.c: In function `count_and_copy_data_pages':
suspend.c:533: warning: passing arg 1 of mmx_copy_page' makes pointer from integer without a cast suspend.c:533: warning: passing arg 2 of mmx_copy_page' makes pointer from integer without a cast suspend.c: In function `resume_try_to_read':
suspend.c:1054: warning: unused variable `blksize'
make[1]: *** [suspend.o] Error 1
make[1]: Leaving directory `/usr/src/linux/kernel'

Gnu C                  3.0.4
Gnu make               3.79.1
binutils               2.11.90.0.8
util-linux             2.11f
mount                  2.11g
modutils               2.4.14
e2fsprogs              1.26
reiserfsprogs          3.x.0j
pcmcia-cs              3.1.22
PPP                    2.4.1
isdn4k-utils           3.1pre1
Linux C Library        2.2.4
Dynamic linker (ldd)   2.2.4
Procps                 2.0.7
Net-tools              1.60
Console-tools          0.3.3
Sh-utils               2.0.11
Modules Loaded         sr_mod emu10k1 soundcore binfmt_misc ds yenta_socket pcmcia_core autofs 3c59x appletalk ipx ipchains ide-scsi ide-cd cdrom reiserfs nls_iso8859-1 nls_cp437 vfat fat mousedev hid input usb-ohci usbcore ext3 jbd raid0 aic7xxx sd_mod scsi_mod
#2 lore raw

Re: 2.5.21 -- suspend.h:58: parse error before "__nosavedata"

In reply to Linus Torvalds
Quoted 8 lines · Miles Lane

gcc -Wp,-MD,.suspend.o.d -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -nostdinc -iwithprefix include -DKBUILD_BASENAME=suspend -DEXPORT_SYMTAB -c -o suspend.o suspend.c
In file included from suspend.c:40:
/usr/src/linux/include/linux/suspend.h:58: parse error before "__nosavedata" /usr/src/linux/include/linux/suspend.h:58: warning: type defaults to int' in declaration of __nosavedata' /usr/src/linux/include/linux/suspend.h:58: warning: data definition has no type or storage class /usr/src/linux/include/linux/suspend.h:59: parse error before "__nosavedata" /usr/src/linux/include/linux/suspend.h:59: warning: type defaults to int' in declaration of __nosavedata' /usr/src/linux/include/linux/suspend.h:59: warning: data definition has no type or storage class

Looks like suspend.h needs init.h

include/linux/suspend.h renamed from include/linux/suspend.h~ +1 -0
@@ -7,6 +7,7 @@
 #include <linux/swap.h>
 #include <linux/notifier.h>
 #include <linux/config.h>
+#include <linux/init.h>
 
 extern unsigned char software_suspend_enabled;
 
Signature · 1 line
Skip
#3 lore raw

PATCH 1/1 2.5.20 IDE 86

In reply to Linus Torvalds

Most importantly this makes ide-scsi work again, which I broke IDE 85. And we are starting to be serious about locking issues. However the locking issues will take some patches until they stabilize.

Wed Jun 5 22:08:15 CEST 2002 ide-clean-86

- Add spin locks in ata_special_intr.

- Add Server Works CSB6 handling by Matt Domsch.

- Atari updates by Geert Uytterhoeven:
* irq_lock is used in more than one file, so make it global and rename it to ide_irq_lock
* hwgroup' is dead, use channel' instead
* ide_irq_lock depends on ATA_ARCH_LOCK, not on m68k or APUS

- Small janitorial tidbits by Angus Sawyer.

- PIIX driver updates by Vojtech Pavlik:

* Removes the CONFIG_BLK_DEV_PIIX_TRY133 option. I've got an official statement from Intel saying that the controller definitely isn't intended to operate at this speed and doing so may cause severe trouble.

* Fixes a bug in ata-timing.c, where EIDE timing data was discarded by accident.

* Fixed a couple bugs in the Artop driver (UDMA clocks, active/recovery timing), 8-bit timing merging.

* Removes an unused variable from piix.c

- Move locking out from ide_set_handler(). There are places where it incurred too frequent lock grab and release or where we did miss to lock against concurrent hardware access.

Generally the locking appears to be too fine grained and inconsistent at many places. This is the first cut. We will deal with it step by step.

- Make sure message string is initialized even if FANCY_STATUS_DUMPS is disabled.

- Don't lock directly inside udma_init and implementations of this method.

- Guard against REQ_SPECIAL issued by the SCSI layer on us. Use REQ_PC in ide-scsi.c instead.

#4 lore raw

PATCH 1/1 2.5.20 locks.h

In reply to Linus Torvalds

Since I have been looking in to the lcoking issues recently the following rather trivial gabrage code collection became obvious...

- Remove "not jet used" code from 1995 in asm/locks.h. It's garbage.

- Remove useless DEBUG_SPINLOCK code from generic spinlock.h code. Just compiling for SMP does the trick already.

- Replace all usages of SPINLOCK_DEBUG with the now global CONFIG_DEBUG_SPINLOCK.

arch/alpha/kernel/smc37c669.c +4 -62
diff -urN linux-2.5.20/arch/alpha/kernel/smc37c669.c linux/arch/alpha/kernel/smc37c669.c
@@ -7,6 +7,7 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/spinlock.h>
 
 #include <asm/hwrpb.h>
 #include <asm/io.h>
@@ -1103,66 +1104,7 @@
     unsigned int drq 
 );
 
-#if 0
-/*
-** External Data Declarations
-*/
-
-extern struct LOCK spl_atomic;
-
-/*
-** External Function Prototype Declarations
-*/
-
-/* From kernel_alpha.mar */
-extern spinlock( 
-    struct LOCK *spl 
-);
-
-extern spinunlock( 
-    struct LOCK *spl 
-);
-
-/* From filesys.c */
-int allocinode(
-    char *name, 
-    int can_create, 
-    struct INODE **ipp
-);
-
-extern int null_procedure( void );
-
-int smcc669_init( void );
-int smcc669_open( struct FILE *fp, char *info, char *next, char *mode );
-int smcc669_read( struct FILE *fp, int size, int number, unsigned char *buf );
-int smcc669_write( struct FILE *fp, int size, int number, unsigned char *buf );
-int smcc669_close( struct FILE *fp );
-
-struct DDB smc_ddb = {
-	"smc",			/* how this routine wants to be called	*/
-	smcc669_read,		/* read routine				*/
-	smcc669_write,		/* write routine			*/
-	smcc669_open,		/* open routine				*/
-	smcc669_close,		/* close routine			*/
-	null_procedure,		/* name expansion routine		*/
-	null_procedure,		/* delete routine			*/
-	null_procedure,		/* create routine			*/
-	null_procedure,		/* setmode				*/
-	null_procedure,		/* validation routine			*/
-	0,			/* class specific use			*/
-	1,			/* allows information			*/
-	0,			/* must be stacked			*/
-	0,			/* is a flash update driver		*/
-	0,			/* is a block device			*/
-	0,			/* not seekable				*/
-	0,			/* is an Ethernet device		*/
-	0,			/* is a filesystem driver		*/
-};
-#endif
-
-#define spinlock(x)
-#define spinunlock(x)
-
+static spinlock_t smc_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED;
 
 /*
 **++
@@ -2042,10 +1984,10 @@
 ** mode.  Therefore, a spinlock is placed around the two writes to 
 ** guarantee that they complete uninterrupted.
 */
-	spinlock( &spl_atomic );
+	spin_lock(&smc_lock);
     	wb( &SMC37c669->index_port, SMC37c669_CONFIG_ON_KEY );
     	wb( &SMC37c669->index_port, SMC37c669_CONFIG_ON_KEY );
-	spinunlock( &spl_atomic );
+	spin_unlock(&smc_lock);
     }
     else {
     	wb( &SMC37c669->index_port, SMC37c669_CONFIG_OFF_KEY );
arch/ppc/kernel/ppc_ksyms.c +1 -1
diff -urN linux-2.5.20/arch/ppc/kernel/ppc_ksyms.c linux/arch/ppc/kernel/ppc_ksyms.c
@@ -217,7 +217,7 @@
 EXPORT_SYMBOL(__global_sti);
 EXPORT_SYMBOL(__global_save_flags);
 EXPORT_SYMBOL(__global_restore_flags);
-#ifdef SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 EXPORT_SYMBOL(_raw_spin_lock);
 EXPORT_SYMBOL(_raw_spin_unlock);
 EXPORT_SYMBOL(_raw_spin_trylock);
arch/ppc/lib/locks.c +1 -1
diff -urN linux-2.5.20/arch/ppc/lib/locks.c linux/arch/ppc/lib/locks.c
@@ -16,7 +16,7 @@
 #include <asm/system.h>
 #include <asm/io.h>
 
-#ifdef SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 
 #undef INIT_STUCK
 #define INIT_STUCK 200000000 /*0xffffffff*/
drivers/scsi/tmscsim.c +2 -4
diff -urN linux-2.5.20/drivers/scsi/tmscsim.c linux/drivers/scsi/tmscsim.c
@@ -254,8 +254,6 @@
  * undef  : traditional save_flags; cli; restore_flags;
  */
 
-//#define DEBUG_SPINLOCKS 2	/* Set to 0, 1 or 2 in include/linux/spinlock.h */
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,30)
 # include <linux/init.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,30)
@@ -293,7 +291,7 @@
 
 # if USE_SPINLOCKS == 3 /* both */
 
-#  if defined (CONFIG_SMP) || DEBUG_SPINLOCKS > 0
+#  if defined (CONFIG_SMP)
 #   define DC390_LOCKA_INIT { spinlock_t __unlocked = SPIN_LOCK_UNLOCKED; pACB->lock = __unlocked; };
 #  else
 #   define DC390_LOCKA_INIT
@@ -322,7 +320,7 @@
 
 #  if USE_SPINLOCKS == 2 /* adapter specific locks */
 
-#   if defined (CONFIG_SMP) || DEBUG_SPINLOCKS > 0
+#   if defined (CONFIG_SMP)
 #    define DC390_LOCKA_INIT { spinlock_t __unlocked = SPIN_LOCK_UNLOCKED; pACB->lock = __unlocked; };
 #   else
 #    define DC390_LOCKA_INIT
include/asm-cris/locks.h +0 -133

133 lines not on this page · raw message

include/asm-i386/locks.h +0 -135

135 lines not on this page · raw message

include/asm-i386/spinlock.h +9 -19
diff -urN linux-2.5.20/include/asm-i386/spinlock.h linux/include/asm-i386/spinlock.h
@@ -9,30 +9,20 @@
 extern int printk(const char * fmt, ...)
 	__attribute__ ((format (printf, 1, 2)));
 
-/* It seems that people are forgetting to
- * initialize their spinlocks properly, tsk tsk.
- * Remember to turn this off in 2.4. -ben
- */
-#if defined(CONFIG_DEBUG_SPINLOCK)
-#define SPINLOCK_DEBUG	1
-#else
-#define SPINLOCK_DEBUG	0
-#endif
-
 /*
  * Your basic SMP spinlocks, allowing only a single CPU anywhere
  */
 
 typedef struct {
 	volatile unsigned int lock;
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	unsigned magic;
 #endif
 } spinlock_t;
 
 #define SPINLOCK_MAGIC	0xdead4ead
 
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 #define SPINLOCK_MAGIC_INIT	, SPINLOCK_MAGIC
 #else
 #define SPINLOCK_MAGIC_INIT	/* */
@@ -79,7 +69,7 @@
 
 static inline void _raw_spin_unlock(spinlock_t *lock)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	if (lock->magic != SPINLOCK_MAGIC)
 		BUG();
 	if (!spin_is_locked(lock))
@@ -100,7 +90,7 @@
 static inline void _raw_spin_unlock(spinlock_t *lock)
 {
 	char oldval = 1;
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	if (lock->magic != SPINLOCK_MAGIC)
 		BUG();
 	if (!spin_is_locked(lock))
@@ -125,7 +115,7 @@
 
 static inline void _raw_spin_lock(spinlock_t *lock)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	__label__ here;
 here:
 	if (lock->magic != SPINLOCK_MAGIC) {
@@ -151,14 +141,14 @@
  */
 typedef struct {
 	volatile unsigned int lock;
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	unsigned magic;
 #endif
 } rwlock_t;
 
 #define RWLOCK_MAGIC	0xdeaf1eed
 
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 #define RWLOCK_MAGIC_INIT	, RWLOCK_MAGIC
 #else
 #define RWLOCK_MAGIC_INIT	/* */
@@ -181,7 +171,7 @@
 
 static inline void _raw_read_lock(rwlock_t *rw)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	if (rw->magic != RWLOCK_MAGIC)
 		BUG();
 #endif
@@ -190,7 +180,7 @@
 
 static inline void _raw_write_lock(rwlock_t *rw)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	if (rw->magic != RWLOCK_MAGIC)
 		BUG();
 #endif
include/asm-ppc/spinlock.h +6 -8
diff -urN linux-2.5.20/include/asm-ppc/spinlock.h linux/include/asm-ppc/spinlock.h
@@ -7,22 +7,20 @@
 #include <asm/system.h>
 #include <asm/processor.h>
 
-#undef SPINLOCK_DEBUG
-
 /*
  * Simple spin lock operations.
  */
 
 typedef struct {
 	volatile unsigned long lock;
-#ifdef SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	volatile unsigned long owner_pc;
 	volatile unsigned long owner_cpu;
 #endif
 } spinlock_t;
 
 #ifdef __KERNEL__
-#if SPINLOCK_DEBUG
+#if CONFIG_DEBUG_SPINLOCK
 #define SPINLOCK_DEBUG_INIT     , 0, 0
 #else
 #define SPINLOCK_DEBUG_INIT     /* */
@@ -34,7 +32,7 @@
 #define spin_is_locked(x)	((x)->lock != 0)
 #define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
 
-#ifndef SPINLOCK_DEBUG
+#ifndef CONFIG_DEBUG_SPINLOCK
 
 static inline void _raw_spin_lock(spinlock_t *lock)
 {
@@ -88,12 +86,12 @@
  */
 typedef struct {
 	volatile unsigned long lock;
-#ifdef SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	volatile unsigned long owner_pc;
 #endif
 } rwlock_t;
 
-#if SPINLOCK_DEBUG
+#if CONFIG_DEBUG_SPINLOCK
 #define RWLOCK_DEBUG_INIT     , 0
 #else
 #define RWLOCK_DEBUG_INIT     /* */
@@ -102,7 +100,7 @@
 #define RW_LOCK_UNLOCKED (rwlock_t) { 0 RWLOCK_DEBUG_INIT }
 #define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
 
-#ifndef SPINLOCK_DEBUG
+#ifndef CONFIG_DEBUG_SPINLOCK
 
 static __inline__ void _raw_read_lock(rwlock_t *rw)
 {
include/asm-x86_64/locks.h +0 -135

135 lines not on this page · raw message

include/asm-x86_64/spinlock.h +8 -18
diff -urN linux-2.5.20/include/asm-x86_64/spinlock.h linux/include/asm-x86_64/spinlock.h
@@ -9,30 +9,20 @@
 extern int printk(const char * fmt, ...)
 	__attribute__ ((format (printf, 1, 2)));
 
-/* It seems that people are forgetting to
- * initialize their spinlocks properly, tsk tsk.
- * Remember to turn this off in 2.4. -ben
- */
-#if defined(CONFIG_DEBUG_SPINLOCK)
-#define SPINLOCK_DEBUG	1
-#else
-#define SPINLOCK_DEBUG	0
-#endif
-
 /*
  * Your basic SMP spinlocks, allowing only a single CPU anywhere
  */
 
 typedef struct {
 	volatile unsigned int lock;
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	unsigned magic;
 #endif
 } spinlock_t;
 
 #define SPINLOCK_MAGIC	0xdead4ead
 
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 #define SPINLOCK_MAGIC_INIT	, SPINLOCK_MAGIC
 #else
 #define SPINLOCK_MAGIC_INIT	/* */
@@ -82,7 +72,7 @@
 
 static inline void _raw_spin_lock(spinlock_t *lock)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	__label__ here;
 here:
 	if (lock->magic != SPINLOCK_MAGIC) {
@@ -97,7 +87,7 @@
 
 static inline void _raw_spin_unlock(spinlock_t *lock)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	if (lock->magic != SPINLOCK_MAGIC)
 		BUG();
 	if (!spin_is_locked(lock))
@@ -120,14 +110,14 @@
  */
 typedef struct {
 	volatile unsigned int lock;
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	unsigned magic;
 #endif
 } rwlock_t;
 
 #define RWLOCK_MAGIC	0xdeaf1eed
 
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 #define RWLOCK_MAGIC_INIT	, RWLOCK_MAGIC
 #else
 #define RWLOCK_MAGIC_INIT	/* */
@@ -150,7 +140,7 @@
 
 extern inline void _raw_read_lock(rwlock_t *rw)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	if (rw->magic != RWLOCK_MAGIC)
 		BUG();
 #endif
@@ -159,7 +149,7 @@
 
 static inline void _raw_write_lock(rwlock_t *rw)
 {
-#if SPINLOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
 	if (rw->magic != RWLOCK_MAGIC)
 		BUG();
 #endif
include/linux/spinlock.h +4 -44

69 lines not on this page · raw message

#5 lore raw

PATCH 1/1 2.5.21 "I can't get no compilation"

In reply to Linus Torvalds

The subject says it all...

Contrary to other proposed patches I realized that there is no such thing as vmalloc_dma.

drivers/media/video/tda9875.c +1 -0
diff -urN linux-2.5.21/drivers/media/video/tda9875.c linux/drivers/media/video/tda9875.c
@@ -28,6 +28,7 @@
 #include <linux/videodev.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
+#include <linux/init.h>
 
 #include "bttv.h"
 #include "audiochip.h"
drivers/pnp/pnpbios_proc.c +1 -0
diff -urN linux-2.5.21/drivers/pnp/pnpbios_proc.c linux/drivers/pnp/pnpbios_proc.c
@@ -28,6 +28,7 @@
 #include <linux/types.h>
 #include <linux/proc_fs.h>
 #include <linux/pnpbios.h>
+#include <linux/init.h>
 
 static struct proc_dir_entry *proc_pnp = NULL;
 static struct proc_dir_entry *proc_pnp_boot = NULL;
include/linux/vmalloc.h +0 -1
diff -urN linux-2.5.21/include/linux/vmalloc.h linux/include/linux/vmalloc.h
@@ -28,7 +28,6 @@
  */
 
 extern void * vmalloc(unsigned long size);
-extern void * vmalloc_dma(unsigned long size);
 extern void * vmalloc_32(unsigned long size);
 
 /*
kernel/ksyms.c +2 -0
diff -urN linux-2.5.21/kernel/ksyms.c linux/kernel/ksyms.c
@@ -108,6 +108,8 @@
 EXPORT_SYMBOL(kfree);
 EXPORT_SYMBOL(vfree);
 EXPORT_SYMBOL(__vmalloc);
+EXPORT_SYMBOL(vmalloc);
+EXPORT_SYMBOL(vmalloc_32);
 EXPORT_SYMBOL(vmalloc_to_page);
 EXPORT_SYMBOL(mem_map);
 EXPORT_SYMBOL(remap_page_range);
#6 lore raw

Re: [PATCH] 2.5.21 "I can't get no compilation"

Quoted 4 lines · Martin Dalecki

The subject says it all...

Contrary to other proposed patches I realized that there is no such thing as vmalloc_dma.

Perhaps you ought to look in mm/vmalloc.c which contains:

void * vmalloc_dma (unsigned long size)

{
        return __vmalloc(size, GFP_KERNEL|GFP_DMA, PAGE_KERNEL);
}

Or are you going to tell me that is a figment of my imagination?

Best regards,

Anton

Signature · 5 lines
  "I've not lost my mind. It's backed up on tape somewhere." - Unknown
-- 
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
#7 lore raw

PATCH 1/1 2.5.21 kill warnings 1/19

In reply to Linus Torvalds

This is fixing missing ; after branch label at two places.

arch/i386/kernel/apm.c +1 -0
diff -urN linux-2.5.21/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
@@ -848,6 +848,7 @@
 			case 1: apm_idle_done = 1;
 				break;
 			default: /* BIOS refused */
+				;
 			}
 		}
 		if (original_pm_idle)
arch/i386/kernel/smpboot.c +2 -2
diff -urN linux-2.5.21/arch/i386/kernel/smpboot.c linux/arch/i386/kernel/smpboot.c
@@ -189,10 +189,10 @@
 		/* If we get here, it's not a certified SMP capable AMD system. */
 		printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n");
 		tainted |= TAINT_UNSAFE_SMP;
-		
 	}
-valid_k7:
 
+valid_k7:
+	;
 }
 
 /*
#8 lore raw

PATCH 1/1 2.5.21 kill warnings 2/19

In reply to Linus Torvalds

This is fixing warnings about unused variables in
pd.c and pcd.c

drivers/block/paride/pcd.c +2 -2
diff -urN linux-2.5.21/drivers/block/paride/pcd.c linux/drivers/block/paride/pcd.c
@@ -329,8 +329,8 @@
 }
 
 int pcd_init (void)	/* preliminary initialisation */
-
-{       int 	i, unit;
+{
+	int unit;
 
 	if (disable) return -1;
 
drivers/block/paride/pd.c +2 -3
diff -urN linux-2.5.21/drivers/block/paride/pd.c linux/drivers/block/paride/pd.c
@@ -381,9 +381,8 @@
 }
 
 int pd_init (void)
-
-{       int i;
-	request_queue_t * q; 
+{
+	request_queue_t * q;
 
 	if (disable) return -1;
         if (devfs_register_blkdev(MAJOR_NR,name,&pd_fops)) {
#9 lore raw

PATCH 1/1 2.5.21 kill warnings 3/19

In reply to Linus Torvalds

Kill unused variables in legacy cdrom drivers,
after the janitorial patch got in.

drivers/cdrom/optcd.c +0 -3
diff -urN linux-2.5.21/drivers/cdrom/optcd.c linux/drivers/cdrom/optcd.c
@@ -1507,7 +1507,6 @@
 
 static int cdromreadtochdr(unsigned long arg)
 {
-	int status;
 	struct cdrom_tochdr tochdr;
 
 	tochdr.cdth_trk0 = disk_info.first;
@@ -1519,7 +1518,6 @@
 
 static int cdromreadtocentry(unsigned long arg)
 {
-	int status;
 	struct cdrom_tocentry entry;
 	struct cdrom_subchnl *tocptr;
 
@@ -1646,7 +1644,6 @@
 #ifdef MULTISESSION
 static int cdrommultisession(unsigned long arg)
 {
-	int status;
 	struct cdrom_multisession ms;
 
 	if (copy_from_user(&ms, (void*) arg, sizeof ms))
drivers/cdrom/sonycd535.c +0 -1
diff -urN linux-2.5.21/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
@@ -1012,7 +1012,6 @@
 sony_get_subchnl_info(long arg)
 {
 	struct cdrom_subchnl schi;
-	int err;
 
 	/* Get attention stuff */
 	if (check_drive_status() != 0)
#10 lore raw

PATCH 1/1 2.5.21 kill warnings 4/19

In reply to Linus Torvalds

Fix improper usage of __FUNCTION__ in usb code. Fix unpleasant results from some code formatting editor (propably emacs) in i2c, which broke an error message altogether.

drivers/hotplug/pci_hotplug_core.c +1 -1
diff -urN linux-2.5.21/drivers/hotplug/pci_hotplug_core.c linux/drivers/hotplug/pci_hotplug_core.c
@@ -48,7 +48,7 @@
 	#define MY_NAME	THIS_MODULE->name
 #endif
 
-#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: "__FUNCTION__": " fmt , MY_NAME , ## arg); } while (0)
+#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __FUNCTION__, ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
drivers/hotplug/pci_hotplug_util.c +1 -1
diff -urN linux-2.5.21/drivers/hotplug/pci_hotplug_util.c linux/drivers/hotplug/pci_hotplug_util.c
@@ -41,7 +41,7 @@
 	#define MY_NAME	THIS_MODULE->name
 #endif
 
-#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: "__FUNCTION__": " fmt , MY_NAME , ## arg); } while (0)
+#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __FUNCTION__, ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
drivers/i2c/i2c-core.c +4 -4
diff -urN linux-2.5.21/drivers/i2c/i2c-core.c linux/drivers/i2c/i2c-core.c
@@ -381,10 +381,10 @@
 						printk("i2c-core.o: while "
 						       "unregistering driver "
 						       "`%s', the client at "
-						       "address %02x of
-						       adapter `%s' could not
-						       be detached; driver
-						       not unloaded!",
+						       "address %02x of "
+						       "adapter `%s' could not "
+						       "be detached; driver "
+						       "not unloaded!",
 						       driver->name,
 						       client->addr,
 						       adap->name);
#11 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed. Here is how I did it in Bluetooth code:

        #define BT_DBG(fmt, arg...)  printk(KERN_INFO "%s: " fmt "\n" , 

__func__ , ## arg)
no more warnings from gcc.

Max

Quoted 4 lines

Fix improper usage of __FUNCTION__ in usb code. Fix unpleasant results from some code formatting editor (propably emacs) in i2c, which broke an error message altogether.

#12 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Quoted 4 lines · Maksim (Max) Krasnyanskiy

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed.

is __func__ already supported for gcc 2.96?

and what about C99 style named initializers for structs?

struct blah = {
.open = driver_open
};

tm

Signature · 1 line
in some way i do, and in some way i don't.
#13 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Mirlacher <Thomas> writes:

Thomas> and what about C99 style named initializers for structs?

Thomas> struct blah = { .open = driver_open };

C99 named initializers were already supported at least as early as gcc 2.95.2

Best,
Roland

#14 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

thanks roland ...

Quoted 8 lines · Roland Dreier
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Mirlacher <Thomas> writes:

Thomas> and what about C99 style named initializers for structs?

Thomas> struct blah = { .open = driver_open };

C99 named initializers were already supported at least as early as gcc 2.95.2

good. which means we can switch over to those for future patches.

tm

Signature · 1 line
in some way i do, and in some way i don't.
#15 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Maksim (Max) Krasnyanskiy
Quoted 8 lines · Thomas 'Dent' Mirlacher
Quoted 4 lines · Maksim (Max) Krasnyanskiy

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed.

is __func__ already supported for gcc 2.96?

Well it works with 2.95.3, which is the important part...

Signature · 2 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
#16 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Maksim (Max) Krasnyanskiy
Quoted 4 lines · Tom Rini
Quoted 2 lines · Thomas 'Dent' Mirlacher

On Mon, 10 Jun 2002, Maksim (Max) Krasnyanskiy wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed.

is __func__ already supported for gcc 2.96?

Well it works with 2.95.3, which is the important part...

The 2.5 kernel must be buildable on gcc-2.91.66, aka egcs-1.1.2.

The 2.95.x requirement was reverted because sparc (or sparc64?) needs egcs-1.1.2.

__func__ does *not* work on egcs-1.1.2 and so cannot be used in Linux.

`struct blah = { .open = driver_open };' *does* work in egcs-1.1.2 and is OK to use.

-

#17 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Hi,

Quoted 4 lines · Andrew Morton

__func__ does *not* work on egcs-1.1.2 and so cannot be used in Linux.

`struct blah = { .open = driver_open };' *does* work in egcs-1.1.2 and is OK to use.

Gee. I guess we need a special host gcc to support our needs - on sparc(|64). We might have a patch that easily renames it in the sources of egcs...

Anyway, what is the problem about new gcc on old sparc? It works at least on my sparc64, I can't complain.

Regards,
Thunder

Signature · 4 lines
German attitude becoming        |	Thunder from the hill at ngforever
rightaway popular:		|
       "Get outa my way,  	|	free inhabitant not directly
    for I got a mobile phone!"	|	belonging anywhere
#18 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Andrew Morton
Quoted 4 lines · Thunder from the hill

Hi,

On Mon, 10 Jun 2002, Andrew Morton wrote:

Quoted 8 lines
Quoted 4 lines

__func__ does *not* work on egcs-1.1.2 and so cannot be used in Linux.

`struct blah = { .open = driver_open };' *does* work in egcs-1.1.2 and is OK to use.

Gee. I guess we need a special host gcc to support our needs - on sparc(|64). We might have a patch that easily renames it in the sources of egcs...

?

Quoted 2 lines

Anyway, what is the problem about new gcc on old sparc? It works at least on my sparc64, I can't complain.

I don't know - we need to find a davem to answer that question.

egcs-1.1.2 has a problem with the percpu infrastructure - it fails to put the right things in the right sections. The workaround for that is to ensure that the percpu data structures are always initialised at the definition site:

	/* Some compilers disobey section attribute on statics when not
	   initialized -- RR */
	static struct tasklet_head tasklet_vec __per_cpu_data = { NULL };
	static struct tasklet_head tasklet_hi_vec __per_cpu_data = { NULL };

Note the (otherwise unneeded) `= { NULL }'. The result of getting this wrong is a nasty and subtly-dead kernel.

It's not a very happy state of affairs. I'll be using
2.91.66 on x86 from now on, so any problems (in the stuff which I build and test) will be picked up.

-

#19 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Maksim (Max) Krasnyanskiy
Quoted 16 lines · Andrew Morton
Quoted 4 lines · Tom Rini
Quoted 2 lines · Thomas 'Dent' Mirlacher

On Mon, 10 Jun 2002, Maksim (Max) Krasnyanskiy wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed.

is __func__ already supported for gcc 2.96?

Well it works with 2.95.3, which is the important part...

The 2.5 kernel must be buildable on gcc-2.91.66, aka egcs-1.1.2.

Quoted 7 lines

The 2.95.x requirement was reverted because sparc (or sparc64?) needs egcs-1.1.2.

__func__ does *not* work on egcs-1.1.2 and so cannot be used in Linux.

`struct blah = { .open = driver_open };' *does* work in egcs-1.1.2 and is OK to use.

This reminds me of another slightly annoying issue. At least for toolchains, Documentation/Changes works poorly for !i386. How about we try and take care of things like this in <linux/compiler.h> ? Eg:

#if defined(CONFIG_SPARC) || defined(CONFIG_SPARC64) ... egcs 1.1.2 check ...

#define __func__ __FUNCTION__
#endif

#if defined(CONFIG_X86) || ...
... gcc-2.95.3 check ...
#endif

Or not, I'm not really sure..

Signature · 2 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
#20 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Maksim (Max) Krasnyanskiy
Quoted 10 lines · Tom Rini

...
This reminds me of another slightly annoying issue. At least for toolchains, Documentation/Changes works poorly for !i386. How about we try and take care of things like this in <linux/compiler.h> ? Eg:

#if defined(CONFIG_SPARC) || defined(CONFIG_SPARC64) ... egcs 1.1.2 check ...

Quoted 7 lines

#define __func__ __FUNCTION__
#endif

#if defined(CONFIG_X86) || ...
... gcc-2.95.3 check ...
#endif

That won't work very well - if SPARC wants 2.91.66 then we need to support that compiler on x86 as well. So that people won't use later-supported compiler features. And because many compiler bugs are platform-independent, so they will be detected (and worked around) on x86.

wrt the __func__ thing: is it possible to do:

#if (compiler version test)
#define __FUNCTION__ __func__
#endif

to kill the 3.x warning?

-

#21 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Hi,

Quoted 7 lines · Andrew Morton

wrt the __func__ thing: is it possible to do:

#if (compiler version test)
#define __FUNCTION__ __func__
#endif

to kill the 3.x warning?

#include <stdio.h>
#define __FUNCTION__ __func__

int main(int argc, char **argv) {
int i;

  for (i = 0; i < argc; i++) {
    printf(__FUNCTION__ " encountered argument ");
    printf("%s\n", argv[i]);
  }

exit(0);
}

Obviously, yes.

Regards,
Thunder

Signature · 4 lines
German attitude becoming        |	Thunder from the hill at ngforever
rightaway popular:		|
       "Get outa my way,  	|	free inhabitant not directly
    for I got a mobile phone!"	|	belonging anywhere
#22 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Hi,

Quoted 1 line · Thunder from the hill

#define __FUNCTION__ __func__

Hmmm... that's just logical. If they just remove the __FUNCTION__ constant, there's nothing to complain about if we redefine it. Even my chaos brain sees that.

Regards,
Thunder

Signature · 4 lines
German attitude becoming        |	Thunder from the hill at ngforever
rightaway popular:		|
       "Get outa my way,  	|	free inhabitant not directly
    for I got a mobile phone!"	|	belonging anywhere
#23 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Thunder from the hill
Quoted 8 lines · Thunder from the hill

Hi,

Quoted 1 line · Thunder from the hill

#define __FUNCTION__ __func__

Hmmm... that's just logical. If they just remove the __FUNCTION__ constant, there's nothing to complain about if we redefine it. Even my chaos brain sees that.

What? __FUNCTION__ and __func__ can't be used interchangably. But for older compilers which lack __func__, you can do:
#define __func__ __FUNCTION__

And provided that __func__ is only used like this:
printk("Something bad happened in %s\n", __func__);

egcs-1.1.2 will be happy, gcc-2.95.x will be happy and gcc-3.x will be happy and we won't be doing the now 'bad' thing of:
printk("Something bad happened in " __FUNCTION__ "\n");

(And if gcc-3.x ever drops __FUNCTION__, which I have nfc if they will, we'll be ok still).

Signature · 2 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
#24 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Thunder from the hill
Quoted 36 lines · Maksim (Max) Krasnyanskiy
Quoted 25 lines
Quoted 20 lines
Quoted 8 lines

wrt the __func__ thing: is it possible to do:

#if (compiler version test)
#define __FUNCTION__ __func__
#endif

to kill the 3.x warning?

#include <stdio.h>
#define __FUNCTION__ __func__

int main(int argc, char **argv) {
int i;

  for (i = 0; i < argc; i++) {
    printf(__FUNCTION__ " encountered argument ");
    printf("%s\n", argv[i]);
  }
Quoted 4 lines

exit(0);
}

Obviously, yes.

Quoted 7 lines

Nope.

$ gcc-3.1 -Wall -o foo foo.c
foo.c: In function `main':
foo.c:8: parse error before string constant

And line 8 is:
printf(__FUNCTION__ " encountered argument ");

Well, those will brake. But in general it's possible. And I already do that in Bluetooth code (it's been converted recently).

Quoted 7 lines

So

#if __GNUC__ <= 2 && __GNUC_MINOR__ < 95
#define __func__ __FUNCTION__
#endif

does the trick. All gcc's newer than 2.95 support __func__.

Right. Maybe it should even go in <linux/compiler.h> if it's not already there.

Signature · 2 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
#25 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Hi,

Quoted 2 lines · Tom Rini

Right. Maybe it should even go in <linux/compiler.h> if it's not already there.

You want this?

Index: include/linux/compiler.h
===================================================================
RCS file: /var/cvs/thunder-2.5/include/linux/compiler.h,v retrieving revision 1.1.1.1

linux/compiler.h 10 Jun 2002 21:33:38 -0000 renamed from linux/compiler.h 10 Jun 2002 15:19:48 -0000 1.1.1.1 +4 -1
diff -u -3 -p -r1.1.1.1 compiler.h
@@ -8,7 +8,15 @@
 
 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96
 #define __builtin_expect(x, expected_value) (x)
-#endif
+#endif /* GCC < 2.96 */
+
+/*
+ * There may or may not be a __func__. For GCC < 2.95, there is none, so 

we
+ * define it as __FUNCTION__ there, even though it's NOT equivalent.
+ */
+#if __GNUC__ == 2 && __GNUC_MINOR__ < 95
+#define __func__ __FUNCTION__
+#endif /* GCC < 2.95 */

#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)

Regards,
Thunder

Signature · 4 lines
German attitude becoming        |	Thunder from the hill at ngforever
rightaway popular:		|
       "Get outa my way,  	|	free inhabitant not directly
    for I got a mobile phone!"	|	belonging anywhere
#26 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Andrew Morton
Quoted 22 lines · Thunder from the hill

Hi,

Quoted 7 lines · Andrew Morton

wrt the __func__ thing: is it possible to do:

#if (compiler version test)
#define __FUNCTION__ __func__
#endif

to kill the 3.x warning?

#include <stdio.h>
#define __FUNCTION__ __func__

int main(int argc, char **argv) {
int i;

  for (i = 0; i < argc; i++) {
    printf(__FUNCTION__ " encountered argument ");
    printf("%s\n", argv[i]);
  }
Quoted 4 lines

exit(0);
}

Obviously, yes.

Nope.

$ gcc-3.1 -Wall -o foo foo.c
foo.c: In function `main':
foo.c:8: parse error before string constant

And line 8 is:
printf(__FUNCTION__ " encountered argument ");

Signature · 2 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
#27 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Quoted 25 lines
Quoted 20 lines
Quoted 8 lines

wrt the __func__ thing: is it possible to do:

#if (compiler version test)
#define __FUNCTION__ __func__
#endif

to kill the 3.x warning?

#include <stdio.h>
#define __FUNCTION__ __func__

int main(int argc, char **argv) {
int i;

  for (i = 0; i < argc; i++) {
    printf(__FUNCTION__ " encountered argument ");
    printf("%s\n", argv[i]);
  }
Quoted 4 lines

exit(0);
}

Obviously, yes.

Quoted 7 lines

Nope.

$ gcc-3.1 -Wall -o foo foo.c
foo.c: In function `main':
foo.c:8: parse error before string constant

And line 8 is:
printf(__FUNCTION__ " encountered argument ");

Well, those will brake. But in general it's possible. And I already do that in Bluetooth code (it's been converted recently).

So

#if __GNUC__ <= 2 && __GNUC_MINOR__ < 95
#define __func__ __FUNCTION__
#endif

does the trick. All gcc's newer than 2.95 support __func__.

Bluetooth code compiles just fine with everything from:

        ultrablue:/#sparc64-linux-gcc --version
        egcs-2.92.11
to
        champ:/usr/src/linux/include/net/bluetooth#gcc --version
        gcc (GCC) 3.1

Max

#28 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Andrew Morton
Quoted 9 lines · Tom Rini

...
Nope.

$ gcc-3.1 -Wall -o foo foo.c
foo.c: In function `main':
foo.c:8: parse error before string constant

And line 8 is:
printf(__FUNCTION__ " encountered argument ");

That's OK. We need to convert all those to

	printf("%s encountered argument ", __FUNCTION__);

anyway. That seems to be happening pretty quickly.

-

#29 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Maksim (Max) Krasnyanskiy
Quoted 19 lines · Andrew Morton
Quoted 10 lines · Tom Rini

...
This reminds me of another slightly annoying issue. At least for toolchains, Documentation/Changes works poorly for !i386. How about we try and take care of things like this in <linux/compiler.h> ? Eg:

#if defined(CONFIG_SPARC) || defined(CONFIG_SPARC64) ... egcs 1.1.2 check ...

Quoted 7 lines

#define __func__ __FUNCTION__
#endif

#if defined(CONFIG_X86) || ...
... gcc-2.95.3 check ...
#endif

Quoted 5 lines

That won't work very well - if SPARC wants 2.91.66 then we need to support that compiler on x86 as well. So that people won't use later-supported compiler features. And because many compiler bugs are platform-independent, so they will be detected (and worked around) on x86.

Well, didn't someone just find a bug where egcs-1.1.2 falls down on x86 in an important area?

Quoted 7 lines

wrt the __func__ thing: is it possible to do:

#if (compiler version test)
#define __FUNCTION__ __func__
#endif

to kill the 3.x warning?

Well, the warning (at least from what I've seen) is when you do:
"In " __FUNCTION__ " something bad happened\n", which __func__ just won't do. Doing:
"In %s something bad happened\n", __FUNCTION__
Is OK[1].

Signature · 5 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

[1]: gcc version 3.1.1 20020606 (Debian prerelease), just a simple
program with -Wall.
#30 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

--snip/snip

Quoted 7 lines
Quoted 1 line

to kill the 3.x warning?

Well, the warning (at least from what I've seen) is when you do:
"In " __FUNCTION__ " something bad happened\n", which __func__ just won't do. Doing:
"In %s something bad happened\n", __FUNCTION__
Is OK[1].

from gcc3/Function-Names:
--------------
Note that these semantics are deprecated, and that GCC 3.2 will handle __FUNCTION__ and __PRETTY_FUNCTION__ the same way as __func__.

__func__ is defined by the ISO standard C99:

The identifier __func__ is implicitly declared by the translator as if, immediately following the opening brace of each function definition, the declaration

static const char __func__[] = "function-name";

appeared, where function-name is the name of the lexically-enclosing function. This name is the unadorned name of the function.

By this definition, __func__ is a variable, not a string literal. In particular, __func__ does not catenate with other string literals.
--------------

which means, __FUNCTION__ will still be supported (gcc3.2), you just cannot catenate it as it was the case before.

so Toms snipplet above should be ok for all versions of gcc which are recommended today, and will also work with gcc3.2

tm

Signature · 1 line
in some way i do, and in some way i don't.
#31 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Maksim (Max) Krasnyanskiy
Quoted 19 lines · Andrew Morton
Quoted 5 lines · Tom Rini
Quoted 3 lines · Thomas 'Dent' Mirlacher

On Mon, 10 Jun 2002, Maksim (Max) Krasnyanskiy wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed.

is __func__ already supported for gcc 2.96?

Well it works with 2.95.3, which is the important part...

The 2.5 kernel must be buildable on gcc-2.91.66, aka egcs-1.1.2.

Quoted 7 lines

The 2.95.x requirement was reverted because sparc (or sparc64?) needs egcs-1.1.2.

__func__ does *not* work on egcs-1.1.2 and so cannot be used in Linux.

`struct blah = { .open = driver_open };' *does* work in egcs-1.1.2 and is OK to use.

As far as I know all GCC compilers before 3.1 where utter crap on sparc64!

#32 lore raw

PATCH 1/1 2.5.21 kill warnings 5/19

In reply to Linus Torvalds

Fix improper __FUNCTION__ usage in st680 driver code, cdc-ether.c. Fix namespace clash in cdc-ether.h

drivers/usb/media/stv680.c +1 -1
diff -urN linux-2.5.21/drivers/usb/media/stv680.c linux/drivers/usb/media/stv680.c
@@ -86,7 +86,7 @@
 #define PDEBUG(level, fmt, args...) \
 	do { \
 	if (debug >= level)	\
-		info("[" __PRETTY_FUNCTION__ ":%d] " fmt, __LINE__ , ## args);	\
+		info("[%s:%d] " fmt, __FUNCTION__, __LINE__ , ## args);	\
 	} while (0)
 
 
drivers/usb/net/cdc-ether.c +10 -9
diff -urN linux-2.5.21/drivers/usb/net/cdc-ether.c linux/drivers/usb/net/cdc-ether.c
@@ -129,13 +129,13 @@
 			usb_rcvbulkpipe(ether_dev->usb, ether_dev->data_ep_in),
 			ether_dev->rx_buff, ether_dev->wMaxSegmentSize, 
 			read_bulk_callback, ether_dev );
-			
-	// Give this to the USB subsystem so it can tell us 
+
+	// Give this to the USB subsystem so it can tell us
 	// when more data arrives.
 	if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) ) {
-		warn( __FUNCTION__ " failed submint rx_urb %d", res);
+		warn("%s failed submint rx_urb %d", __FUNCTION__, res);
 	}
-	
+
 	// We are no longer busy, show us the frames!!!
 	ether_dev->flags &= ~CDC_ETHER_RX_BUSY;
 }
@@ -339,7 +339,7 @@
 
 	// Turn on the USB and let the packets flow!!!
 	if ( (res = enable_net_traffic( ether_dev )) ) {
-		err( __FUNCTION__ "can't enable_net_traffic() - %d", res );
+		err("%s can't enable_net_traffic() - %d", __FUNCTION__, res );
 		return -EIO;
 	}
 
@@ -353,7 +353,7 @@
 	if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) )
 	{
 		// Hmm...  Okay...
-		warn( __FUNCTION__ " failed rx_urb %d", res );
+		warn("%s failed rx_urb %d", __FUNCTION__, res );
 	}
 
 	// Tell the kernel we are ready to start receiving from it
@@ -411,6 +411,7 @@
 	}
 }
 
+#if 0
 static void CDC_SetEthernetPacketFilter (ether_dev_t *ether_dev)
 {
 	usb_control_msg(ether_dev->usb,
@@ -422,15 +423,15 @@
 			NULL,
 			0, /* size */
 			HZ); /* timeout */
-}	
-
+}
+#endif
 
 static void CDCEther_set_multicast( struct net_device *net )
 {
 	ether_dev_t *ether_dev = net->priv;
 	int i;
 	__u8 *buff;
-	
+
 
 	// Tell the kernel to stop sending us frames while we get this
 	// all set up.
drivers/usb/net/cdc-ether.h +4 -4
diff -urN linux-2.5.21/drivers/usb/net/cdc-ether.h linux/drivers/usb/net/cdc-ether.h
@@ -43,7 +43,7 @@
 #define	CDC_ETHER_REQ_GET_REGS	0xf0
 #define	CDC_ETHER_REQ_SET_REGS	0xf1
 #define	CDC_ETHER_REQ_SET_REG	PIPERIDER_REQ_SET_REGS
-#define	ALIGN(x)		x __attribute__((aligned(L1_CACHE_BYTES)))
+#define	L1_ALIGN(x)		x __attribute__((aligned(L1_CACHE_BYTES)))
 
 #define MODE_FLAG_PROMISCUOUS   (1<<0)
 #define MODE_FLAG_ALL_MULTICAST (1<<1)
@@ -84,9 +84,9 @@
 	__u8			bNumberPowerFilters;
 	int			intr_interval;
 	struct urb		*rx_urb, *tx_urb, *intr_urb;
-	unsigned char		ALIGN(rx_buff[CDC_ETHER_MAX_MTU]);
-	unsigned char		ALIGN(tx_buff[CDC_ETHER_MAX_MTU]);
-	unsigned char		ALIGN(intr_buff[8]);
+	unsigned char		L1_ALIGN(rx_buff[CDC_ETHER_MAX_MTU]);
+	unsigned char		L1_ALIGN(tx_buff[CDC_ETHER_MAX_MTU]);
+	unsigned char		L1_ALIGN(intr_buff[8]);
 } ether_dev_t;
 
 #define REQ_HDR_FUNC_DESCR	0x0001
#33 lore raw

PATCH 1/1 2.5.21 kill warnings 6/19

In reply to Linus Torvalds

- Fix compilation warnings in cfbimgblt.c.

- Fix improper __FUNCTION__ usage in smb_debug.h.

It's all about giving the compiler a chance to coalesce equal string constants - a good reason for the C language standard to depricate the old semantics.

drivers/video/cfbimgblt.c +8 -6
diff -urN linux-2.5.21/drivers/video/cfbimgblt.c linux/drivers/video/cfbimgblt.c
@@ -43,12 +43,14 @@
 
 void cfb_imageblit(struct fb_info *p, struct fb_image *image)
 {
-	int pad, ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l = 7;
+	int pad, ppw;
+	int x2, y2, n, i, j, k, l = 7;
 	unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
 	unsigned long fgx, bgx, fgcolor, bgcolor, eorx;	
-	unsigned long end_index, end_mask;
+	unsigned long end_mask;
 	unsigned long *dst = NULL;
-	u8 *dst1, *src;
+	u8 *dst1;
+	u8 *src;
 
 	/* 
 	 * We could use hardware clipping but on many cards you get around hardware
@@ -97,8 +99,8 @@
 			for (j = image->width/ppw; j > 0; j--) {
 				end_mask = 0;
 		
-				for (k = ppw; k > 0; k--) {	
-					if (test_bit(l, src))
+				for (k = ppw; k > 0; k--) {
+					if (test_bit(l, (unsigned long *) src))
 						end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
 					l--;
 					if (l < 0) { l = 7; src++; }
@@ -110,7 +112,7 @@
 			if (n) {
 				end_mask = 0;	
 				for (j = n; j > 0; j--) {
-					if (test_bit(l, src))
+					if (test_bit(l, (unsigned long *) src))
 						end_mask |= (tmp >> (p->var.bits_per_pixel*(j-1)));
 					l--;
 					if (l < 0) { l = 7; src++; }
fs/smbfs/smb_debug.h +5 -5
diff -urN linux-2.5.21/fs/smbfs/smb_debug.h linux/fs/smbfs/smb_debug.h
@@ -7,20 +7,20 @@
 	(dentry)->d_parent->d_name.name,(dentry)->d_name.name
 
 /*
- * safety checks that should never happen ??? 
+ * safety checks that should never happen ???
  * these are normally enabled.
  */
 #ifdef SMBFS_PARANOIA
-#define PARANOIA(x...) printk(KERN_NOTICE __FUNCTION__ ": " x)
+# define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __FUNCTION__, ## a)
 #else
-#define PARANOIA(x...) do { ; } while(0)
+# define PARANOIA(f, a...) do { ; } while(0)
 #endif
 
 /* lots of debug messages */
 #ifdef SMBFS_DEBUG_VERBOSE
-#define VERBOSE(x...) printk(KERN_DEBUG __FUNCTION__ ": " x)
+# define VERBOSE(f, a...) printk(KERN_DEBUG "%s: " f, __FUNCTION__, ## a)
 #else
-#define VERBOSE(x...) do { ; } while(0)
+# define VERBOSE(f, a...) do { ; } while(0)
 #endif
 
 /*
#34 lore raw

Re: [PATCH] 2.5.21 kill warnings 6/19

Quoted 3 lines · Martin Dalecki

...
- Fix improper __FUNCTION__ usage in smb_debug.h.
...

Was it intended that this change breaks the compilation of fs/smbfs/proc.c?

<-- snip -->

...
gcc -Wp,-MD,./.proc.o.d -D__KERNEL__
-I/home/bunk/linux/kernel-2.5/linux-2.5.21-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=k6 -nostdinc -iwithprefix include -DSMBFS_PARANOIA -DKBUILD_BASENAME=proc -c -o proc.o proc.c
proc.c: In function `smb_request_ok':
proc.c:875: parse error before `)'
make[2]: *** [proc.o] Error 1
make[2]: Leaving directory
`/home/bunk/linux/kernel-2.5/linux-2.5.21-full/fs/smbfs'

<-- snip -->

cu
Adrian

Signature · 3 lines
You only think this is a free country. Like the US the UK spends a lot of
time explaining its a free country because its a police state.
								Alan Cox
#35 lore raw

PATCH 1/1 2.5.21 kill warnings 7/19

In reply to Linus Torvalds

- Fix improper __FUNCTION__ usage in af_irda.c

- Fix redundant white space usage there - I couldn't resist.

net/irda/af_irda.c +180 -199
diff -urN linux-2.5.21/net/irda/af_irda.c linux/net/irda/af_irda.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      af_irda.c
  * Version:       0.9
  * Description:   IrDA sockets implementation
@@ -9,37 +9,37 @@
  * Modified at:   Sat Dec 25 21:10:23 1999
  * Modified by:   Dag Brattli <[email protected]>
  * Sources:       af_netroom.c, af_ax25.c, af_rose.c, af_x25.c etc.
- * 
+ *
  *     Copyright (c) 1999 Dag Brattli <[email protected]>
  *     Copyright (c) 1999-2001 Jean Tourrilhes <[email protected]>
  *     All Rights Reserved.
  *
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
- * 
+ *
  *     This program is distributed in the hope that it will be useful,
  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  *     GNU General Public License for more details.
- * 
- *     You should have received a copy of the GNU General Public License 
- *     along with this program; if not, write to the Free Software 
- *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  *     MA 02111-1307 USA
  *
  *     Linux-IrDA now supports four different types of IrDA sockets:
  *
  *     o SOCK_STREAM:    TinyTP connections with SAR disabled. The
  *                       max SDU size is 0 for conn. of this type
- *     o SOCK_SEQPACKET: TinyTP connections with SAR enabled. TTP may 
+ *     o SOCK_SEQPACKET: TinyTP connections with SAR enabled. TTP may
  *                       fragment the messages, but will preserve
  *                       the message boundaries
- *     o SOCK_DGRAM:     IRDAPROTO_UNITDATA: TinyTP connections with Unitdata 
+ *     o SOCK_DGRAM:     IRDAPROTO_UNITDATA: TinyTP connections with Unitdata
  *                       (unreliable) transfers
  *                       IRDAPROTO_ULTRA: Connectionless and unreliable data
- *     
+ *
  ********************************************************************/
 
 #include <linux/config.h>
@@ -67,7 +67,7 @@
 
 extern int  irda_init(void);
 extern void irda_cleanup(void);
-extern int  irlap_driver_rcv(struct sk_buff *, struct net_device *, 
+extern int  irlap_driver_rcv(struct sk_buff *, struct net_device *,
 			     struct packet_type *);
 
 static int irda_create(struct socket *sock, int protocol);
@@ -125,7 +125,7 @@
  *    Connection has been closed. Check reason to find out why
  *
  */
-static void irda_disconnect_indication(void *instance, void *sap, 
+static void irda_disconnect_indication(void *instance, void *sap,
 				       LM_REASON reason, struct sk_buff *skb)
 {
 	struct irda_sock *self;
@@ -185,9 +185,9 @@
  *    Connections has been confirmed by the remote device
  *
  */
-static void irda_connect_confirm(void *instance, void *sap, 
+static void irda_connect_confirm(void *instance, void *sap,
 				 struct qos_info *qos,
-				 __u32 max_sdu_size, __u8 max_header_size, 
+				 __u32 max_sdu_size, __u8 max_header_size,
 				 struct sk_buff *skb)
 {
 	struct irda_sock *self;
@@ -211,14 +211,14 @@
 	switch (sk->type) {
 	case SOCK_STREAM:
 		if (max_sdu_size != 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n");
+			ERROR("%s: max_sdu_size must be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 		break;
 	case SOCK_SEQPACKET:
 		if (max_sdu_size == 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n");
+			ERROR("%s: max_sdu_size cannot be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = max_sdu_size;
@@ -227,7 +227,7 @@
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 	};
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n", 
+	IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n",
 		   self->max_data_size);
 
 	memcpy(&self->qos_tx, qos, sizeof(struct qos_info));
@@ -245,14 +245,14 @@
  *    Incoming connection
  *
  */
-static void irda_connect_indication(void *instance, void *sap, 
+static void irda_connect_indication(void *instance, void *sap,
 				    struct qos_info *qos, __u32 max_sdu_size,
 				    __u8 max_header_size, struct sk_buff *skb)
 {
 	struct irda_sock *self;
 	struct sock *sk;
 
- 	self = (struct irda_sock *) instance;
+	self = (struct irda_sock *) instance;
 
 	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
 
@@ -264,20 +264,20 @@
 	self->max_header_size = max_header_size;
 
 	/* IrTTP max SDU size in transmit direction */
-	self->max_sdu_size_tx = max_sdu_size;	
+	self->max_sdu_size_tx = max_sdu_size;
 
 	/* Find out what the largest chunk of data that we can transmit is */
 	switch (sk->type) {
 	case SOCK_STREAM:
 		if (max_sdu_size != 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n");
+			ERROR("%s: max_sdu_size must be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 		break;
 	case SOCK_SEQPACKET:
 		if (max_sdu_size == 0) {
-			ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n");
+			ERROR("%s: max_sdu_size cannot be 0\n", __FUNCTION__);
 			return;
 		}
 		self->max_data_size = max_sdu_size;
@@ -286,11 +286,11 @@
 		self->max_data_size = irttp_get_max_seg_size(self->tsap);
 	};
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n", 
+	IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n",
 		   self->max_data_size);
 
 	memcpy(&self->qos_tx, qos, sizeof(struct qos_info));
-	
+
 	skb_queue_tail(&sk->receive_queue, skb);
 	sk->state_change(sk);
 }
@@ -327,19 +327,19 @@
  *    Used by TinyTP to tell us if it can accept more data or not
  *
  */
-static void irda_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) 
+static void irda_flow_indication(void *instance, void *sap, LOCAL_FLOW flow)
 {
 	struct irda_sock *self;
 	struct sock *sk;
 
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
-	
+
 	self = (struct irda_sock *) instance;
 	ASSERT(self != NULL, return;);
 
 	sk = self->sk;
 	ASSERT(sk != NULL, return;);
-	
+
 	switch (flow) {
 	case FLOW_STOP:
 		IRDA_DEBUG(1, __FUNCTION__ "(), IrTTP wants us to slow down\n");
@@ -347,7 +347,7 @@
 		break;
 	case FLOW_START:
 		self->tx_flow = flow;
-		IRDA_DEBUG(1, __FUNCTION__ 
+		IRDA_DEBUG(1, __FUNCTION__
 			   "(), IrTTP wants us to start again\n");
 		wake_up_interruptible(sk->sleep);
 		break;
@@ -367,14 +367,14 @@
  * Note : duplicate from above, but we need our own version that
  * doesn't touch the dtsap_sel and save the full value structure...
  */
-static void irda_getvalue_confirm(int result, __u16 obj_id, 
+static void irda_getvalue_confirm(int result, __u16 obj_id,
 					  struct ias_value *value, void *priv)
 {
 	struct irda_sock *self;
-	
+
 	self = (struct irda_sock *) priv;
 	if (!self) {
-		WARNING(__FUNCTION__ "(), lost myself!\n");
+		WARNING("%s: lost myself!\n", __FUNCTION__);
 		return;
 	}
 
@@ -419,12 +419,12 @@
 						void *priv)
 {
 	struct irda_sock *self;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	self = (struct irda_sock *) priv;
 	if (!self) {
-		WARNING(__FUNCTION__ "(), lost myself!\n");
+		WARNING("%s: lost myself!\n", __FUNCTION__);
 		return;
 	}
 
@@ -456,7 +456,7 @@
 static void irda_discovery_timeout(u_long priv)
 {
 	struct irda_sock *self;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	self = (struct irda_sock *) priv;
@@ -482,10 +482,10 @@
 	notify_t notify;
 
 	if (self->tsap) {
-		WARNING(__FUNCTION__ "(), busy!\n");
+		WARNING("%s: busy!\n", __FUNCTION__);
 		return -EBUSY;
 	}
-	
+
 	/* Initialize callbacks to be used by the IrDA stack */
 	irda_notify_init(&notify);
 	notify.connect_confirm       = irda_connect_confirm;
@@ -498,7 +498,7 @@
 	strncpy(notify.name, name, NOTIFY_MAX_NAME);
 
 	self->tsap = irttp_open_tsap(tsap_sel, DEFAULT_INITIAL_CREDIT,
-				     &notify);	
+				     &notify);
 	if (self->tsap == NULL) {
 		IRDA_DEBUG( 0, __FUNCTION__ "(), Unable to allocate TSAP!\n");
 		return -ENOMEM;
@@ -524,14 +524,14 @@
 		WARNING(__FUNCTION__ "(), busy!\n");
 		return -EBUSY;
 	}
-	
+
 	/* Initialize callbacks to be used by the IrDA stack */
 	irda_notify_init(&notify);
 	notify.udata_indication	= irda_data_indication;
 	notify.instance = self;
 	strncpy(notify.name, "Ultra", NOTIFY_MAX_NAME);
 
-	self->lsap = irlmp_open_lsap(LSAP_CONNLESS, &notify, pid);	
+	self->lsap = irlmp_open_lsap(LSAP_CONNLESS, &notify, pid);
 	if (self->lsap == NULL) {
 		IRDA_DEBUG( 0, __FUNCTION__ "(), Unable to allocate LSAP!\n");
 		return -ENOMEM;
@@ -559,7 +559,7 @@
 	ASSERT(self != NULL, return -1;);
 
 	if (self->iriap) {
-		WARNING(__FUNCTION__ "(), busy with a previous query\n");
+		WARNING("%s: busy with a previous query\n", __FUNCTION__);
 		return -EBUSY;
 	}
 
@@ -596,10 +596,10 @@
 	case IAS_INTEGER:
 		IRDA_DEBUG(4, __FUNCTION__ "() int=%d\n",
 			   self->ias_result->t.integer);
-		
+
 		if (self->ias_result->t.integer != -1)
 			self->dtsap_sel = self->ias_result->t.integer;
-		else 
+		else
 			self->dtsap_sel = 0;
 		break;
 	default:
@@ -655,7 +655,7 @@
 	if (discoveries == NULL)
 		return -ENETUNREACH;	/* No nodes discovered */
 
-	/* 
+	/*
 	 * Now, check all discovered devices (if any), and connect
 	 * client only about the services that the client is
 	 * interested in...
@@ -714,7 +714,7 @@
 	self->saddr = 0x0;
 	self->dtsap_sel = dtsap_sel;
 
-	IRDA_DEBUG(1, __FUNCTION__ 
+	IRDA_DEBUG(1, __FUNCTION__
 		   "(), discovered requested service ''%s'' at address %08x\n",
 		   name, self->daddr);
 
@@ -737,7 +737,7 @@
 	if (peer) {
 		if (sk->state != TCP_ESTABLISHED)
 			return -ENOTCONN;
-		
+
 		saddr.sir_family = AF_IRDA;
 		saddr.sir_lsap_sel = self->dtsap_sel;
 		saddr.sir_addr = self->daddr;
@@ -746,7 +746,7 @@
 		saddr.sir_lsap_sel = self->stsap_sel;
 		saddr.sir_addr = self->saddr;
 	}
-	
+
 	IRDA_DEBUG(1, __FUNCTION__ "(), tsap_sel = %#x\n", saddr.sir_lsap_sel);
 	IRDA_DEBUG(1, __FUNCTION__ "(), addr = %08x\n", saddr.sir_addr);
 
@@ -776,10 +776,10 @@
 	if (sk->state != TCP_LISTEN) {
 		sk->max_ack_backlog = backlog;
 		sk->state           = TCP_LISTEN;
-		
+
 		return 0;
 	}
-	
+
 	return -EOPNOTSUPP;
 }
 
@@ -808,14 +808,14 @@
 	if ((sk->type == SOCK_DGRAM) && (sk->protocol == IRDAPROTO_ULTRA)) {
 		self->pid = addr->sir_lsap_sel;
 		if (self->pid & 0x80) {
-			IRDA_DEBUG(0, __FUNCTION__ 
+			IRDA_DEBUG(0, __FUNCTION__
 				   "(), extension in PID not supp!\n");
 			return -EOPNOTSUPP;
 		}
 		err = irda_open_lsap(self, self->pid);
 		if (err < 0)
 			return err;
-		
+
 		self->max_data_size = ULTRA_MAX_DATA - LMP_PID_HEADER;
 		self->max_header_size = IRDA_MAX_HEADER + LMP_PID_HEADER;
 
@@ -830,13 +830,13 @@
 	err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name);
 	if (err < 0)
 		return err;
-	
+
 	/*  Register with LM-IAS */
 	self->ias_obj = irias_new_object(addr->sir_name, jiffies);
-	irias_add_integer_attrib(self->ias_obj, "IrDA:TinyTP:LsapSel", 
+	irias_add_integer_attrib(self->ias_obj, "IrDA:TinyTP:LsapSel",
 				 self->stsap_sel, IAS_KERNEL_ATTR);
 	irias_insert_object(self->ias_obj);
-	
+
 	return 0;
 }
 
@@ -872,7 +872,7 @@
 	    (sk->type != SOCK_DGRAM))
 		return -EOPNOTSUPP;
 
-	if (sk->state != TCP_LISTEN) 
+	if (sk->state != TCP_LISTEN)
 		return -EINVAL;
 
 	/*
@@ -921,7 +921,7 @@
 			return -ERESTARTSYS;
 	}
 
- 	newsk = newsock->sk;
+	newsk = newsock->sk;
 	newsk->state = TCP_ESTABLISHED;
 
 	new = irda_sk(newsk);
@@ -933,7 +933,7 @@
 		IRDA_DEBUG(0, __FUNCTION__ "(), dup failed!\n");
 		return -1;
 	}
-		
+
 	new->stsap_sel = new->tsap->stsap_sel;
 	new->dtsap_sel = new->tsap->dtsap_sel;
 	new->saddr = irttp_get_saddr(new->tsap);
@@ -988,7 +988,7 @@
 	struct sockaddr_irda *addr = (struct sockaddr_irda *) uaddr;
 	struct irda_sock *self = irda_sk(sk);
 	int err;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
 
 	/* Don't allow connect for Ultra sockets */
@@ -999,16 +999,16 @@
 		sock->state = SS_CONNECTED;
 		return 0;   /* Connect completed during a ERESTARTSYS event */
 	}
-	
+
 	if (sk->state == TCP_CLOSE && sock->state == SS_CONNECTING) {
 		sock->state = SS_UNCONNECTED;
 		return -ECONNREFUSED;
 	}
-	
+
 	if (sk->state == TCP_ESTABLISHED)
 		return -EISCONN;      /* No reconnect on a seqpacket socket */
-	
-	sk->state   = TCP_CLOSE;	
+
+	sk->state   = TCP_CLOSE;
 	sock->state = SS_UNCONNECTED;
 
 	if (addr_len != sizeof(struct sockaddr_irda))
@@ -1019,7 +1019,7 @@
 		/* Try to find one suitable */
 		err = irda_discover_daddr_and_lsap_sel(self, addr->sir_name);
 		if (err) {
-			IRDA_DEBUG(0, __FUNCTION__ 
+			IRDA_DEBUG(0, __FUNCTION__
 				   "(), auto-connect failed!\n");
 			return err;
 		}
@@ -1027,7 +1027,7 @@
 		/* Use the one provided by the user */
 		self->daddr = addr->sir_addr;
 		IRDA_DEBUG(1, __FUNCTION__ "(), daddr = %08x\n", self->daddr);
-		
+
 		/* Query remote LM-IAS */
 		err = irda_find_lsap_sel(self, addr->sir_name);
 		if (err) {
@@ -1039,14 +1039,14 @@
 	/* Check if we have opened a local TSAP */
 	if (!self->tsap)
 		irda_open_tsap(self, LSAP_ANY, addr->sir_name);
-	
+
 	/* Move to connecting socket, start sending Connect Requests */
 	sock->state = SS_CONNECTING;
 	sk->state   = TCP_SYN_SENT;
 
 	/* Connect to remote device */
-	err = irttp_connect_request(self->tsap, self->dtsap_sel, 
-				    self->saddr, self->daddr, NULL, 
+	err = irttp_connect_request(self->tsap, self->dtsap_sel,
+				    self->saddr, self->daddr, NULL,
 				    self->max_sdu_size_rx, NULL);
 	if (err) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), connect failed!\n");
@@ -1064,9 +1064,9 @@
 		sock->state = SS_UNCONNECTED;
 		return sock_error(sk);	/* Always set at this point */
 	}
-	
+
 	sock->state = SS_CONNECTED;
-	
+
 	/* At this point, IrLMP has assigned our source address */
 	self->saddr = irttp_get_saddr(self->tsap);
 
@@ -1085,7 +1085,7 @@
 	struct irda_sock *self;
 
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
-	
+
 	/* Check for valid socket type */
 	switch (sock->type) {
 	case SOCK_STREAM:     /* For TTP connections with SAR disabled */
@@ -1112,7 +1112,7 @@
 
 	init_waitqueue_head(&self->query_wait);
 
-	/* Initialise networking socket struct */ 
+	/* Initialise networking socket struct */
 	sock_init_data(sock, sk);	/* Note : set sk->refcnt to 1 */
 	sk->family = PF_IRDA;
 	sk->protocol = protocol;
@@ -1141,13 +1141,13 @@
 			self->max_sdu_size_rx = TTP_SAR_UNBOUND;
 			break;
 		default:
-			ERROR(__FUNCTION__ "(), protocol not supported!\n");
+			ERROR("%s: protocol not supported!\n", __FUNCTION__);
 			return -ESOCKTNOSUPPORT;
 		}
 		break;
 	default:
 		return -ESOCKTNOSUPPORT;
-	}		
+	}
 
 	/* Register as a client with IrLMP */
 	self->ckey = irlmp_register_client(0, NULL, NULL, NULL);
@@ -1202,25 +1202,22 @@
 #endif /* CONFIG_IRDA_ULTRA */
 	kfree(self);
 	MOD_DEC_USE_COUNT;
-	
+
 	return;
 }
 
 /*
  * Function irda_release (sock)
- *
- *    
- *
  */
 static int irda_release(struct socket *sock)
 {
 	struct sock *sk = sock->sk;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
-        if (sk == NULL) 
+        if (sk == NULL)
 		return 0;
-	
+
 	sk->state       = TCP_CLOSE;
 	sk->shutdown   |= SEND_SHUTDOWN;
 	sk->state_change(sk);
@@ -1231,7 +1228,7 @@
 	irda_sk(sk) = NULL;
 
 	sock_orphan(sk);
-	sock->sk   = NULL;      
+	sock->sk   = NULL;
 
 	/* Purge queues (see sock_init_data()) */
 	skb_queue_purge(&sk->receive_queue);
@@ -1248,7 +1245,7 @@
 	 * 1) This may include IAS request, both in connect and getsockopt.
 	 * Unfortunately, the situation is a bit more messy than it looks,
 	 * because we close iriap and kfree(self) above.
-	 * 
+	 *
 	 * 2) This may include selective discovery in getsockopt.
 	 * Same stuff as above, irlmp registration and self are gone.
 	 *
@@ -1273,10 +1270,10 @@
  * Function irda_sendmsg (sock, msg, len, scm)
  *
  *    Send message down to TinyTP. This function is used for both STREAM and
- *    SEQPACK services. This is possible since it forces the client to 
+ *    SEQPACK services. This is possible since it forces the client to
  *    fragment the message if necessary
  */
-static int irda_sendmsg(struct socket *sock, struct msghdr *msg, int len, 
+static int irda_sendmsg(struct socket *sock, struct msghdr *msg, int len,
 			struct scm_cookie *scm)
 {
 	struct sock *sk = sock->sk;
@@ -1314,24 +1311,24 @@
 
 	/* Check that we don't send out to big frames */
 	if (len > self->max_data_size) {
-		IRDA_DEBUG(2, __FUNCTION__ 
-			   "(), Chopping frame from %d to %d bytes!\n", len, 
+		IRDA_DEBUG(2, __FUNCTION__
+			   "(), Chopping frame from %d to %d bytes!\n", len,
 			   self->max_data_size);
 		len = self->max_data_size;
 	}
 
-	skb = sock_alloc_send_skb(sk, len + self->max_header_size, 
+	skb = sock_alloc_send_skb(sk, len + self->max_header_size,
 				  msg->msg_flags & MSG_DONTWAIT, &err);
 	if (!skb)
 		return -ENOBUFS;
 
 	skb_reserve(skb, self->max_header_size);
-	
+
 	asmptr = skb->h.raw = skb_put(skb, len);
 	memcpy_fromiovec(asmptr, msg->msg_iov, len);
 
-	/* 
-	 * Just send the message to TinyTP, and let it deal with possible 
+	/*
+	 * Just send the message to TinyTP, and let it deal with possible
 	 * errors. No need to duplicate all that here
 	 */
 	err = irttp_data_request(self->tsap, skb);
@@ -1349,7 +1346,7 @@
  *    Try to receive message and copy it to user. The frame is discarded
  *    after being read, regardless of how much the user actually read
  */
-static int irda_recvmsg_dgram(struct socket *sock, struct msghdr *msg, 
+static int irda_recvmsg_dgram(struct socket *sock, struct msghdr *msg,
 			      int size, int flags, struct scm_cookie *scm)
 {
 	struct sock *sk = sock->sk;
@@ -1361,16 +1358,16 @@
 
 	ASSERT(self != NULL, return -1;);
 
-	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, 
+	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
 				flags & MSG_DONTWAIT, &err);
 	if (!skb)
 		return err;
 
 	skb->h.raw = skb->data;
 	copied     = skb->len;
-	
+
 	if (copied > size) {
-		IRDA_DEBUG(2, __FUNCTION__ 
+		IRDA_DEBUG(2, __FUNCTION__
 			   "(), Received truncated frame (%d < %d)!\n",
 			   copied, size);
 		copied = size;
@@ -1423,11 +1420,8 @@
 
 /*
  * Function irda_recvmsg_stream (sock, msg, size, flags, scm)
- *
- *    
- *
  */
-static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, 
+static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg,
 			       int size, int flags, struct scm_cookie *scm)
 {
 	struct sock *sk = sock->sk;
@@ -1440,7 +1434,7 @@
 
 	ASSERT(self != NULL, return -1;);
 
-	if (sock->flags & __SO_ACCEPTCON) 
+	if (sock->flags & __SO_ACCEPTCON)
 		return(-EINVAL);
 
 	if (flags & MSG_OOB)
@@ -1448,7 +1442,7 @@
 
 	if (flags & MSG_WAITALL)
 		target = size;
-		
+
 	msg->msg_namelen = 0;
 
 	do {
@@ -1459,11 +1453,11 @@
 		if (skb==NULL) {
 			if (copied >= target)
 				break;
-			
+
 			/*
 			 *	POSIX 1003.1g mandates this order.
 			 */
-			
+
 			if (sk->err) {
 				return sock_error(sk);
 			}
@@ -1500,7 +1494,7 @@
 				break;
 			}
 
-			kfree_skb(skb);			
+			kfree_skb(skb);
 		} else {
 			IRDA_DEBUG(0, __FUNCTION__ "() questionable!?\n");
 
@@ -1542,9 +1536,9 @@
 	struct sk_buff *skb;
 	unsigned char *asmptr;
 	int err;
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len);
-	
+
 	if (msg->msg_flags & ~MSG_DONTWAIT)
 		return -EINVAL;
 
@@ -1559,30 +1553,30 @@
 	self = irda_sk(sk);
 	ASSERT(self != NULL, return -1;);
 
-	/*  
-	 * Check that we don't send out to big frames. This is an unreliable 
-	 * service, so we have no fragmentation and no coalescence 
+	/*
+	 * Check that we don't send out to big frames. This is an unreliable
+	 * service, so we have no fragmentation and no coalescence
 	 */
 	if (len > self->max_data_size) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n", len, 
+			   "Chopping frame from %d to %d bytes!\n", len,
 			   self->max_data_size);
 		len = self->max_data_size;
 	}
 
-	skb = sock_alloc_send_skb(sk, len + self->max_header_size, 
+	skb = sock_alloc_send_skb(sk, len + self->max_header_size,
 				  msg->msg_flags & MSG_DONTWAIT, &err);
 	if (!skb)
 		return -ENOBUFS;
 
 	skb_reserve(skb, self->max_header_size);
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(), appending user data\n");
 	asmptr = skb->h.raw = skb_put(skb, len);
 	memcpy_fromiovec(asmptr, msg->msg_iov, len);
 
-	/* 
-	 * Just send the message to TinyTP, and let it deal with possible 
+	/*
+	 * Just send the message to TinyTP, and let it deal with possible
 	 * errors. No need to duplicate all that here
 	 */
 	err = irttp_udata_request(self->tsap, skb);
@@ -1608,9 +1602,9 @@
 	struct sk_buff *skb;
 	unsigned char *asmptr;
 	int err;
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len);
-	
+
 	if (msg->msg_flags & ~MSG_DONTWAIT)
 		return -EINVAL;
 
@@ -1622,24 +1616,24 @@
 	self = irda_sk(sk);
 	ASSERT(self != NULL, return -1;);
 
-	/*  
-	 * Check that we don't send out to big frames. This is an unreliable 
-	 * service, so we have no fragmentation and no coalescence 
+	/*
+	 * Check that we don't send out to big frames. This is an unreliable
+	 * service, so we have no fragmentation and no coalescence
 	 */
 	if (len > self->max_data_size) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n", len, 
+			   "Chopping frame from %d to %d bytes!\n", len,
 			   self->max_data_size);
 		len = self->max_data_size;
 	}
 
-	skb = sock_alloc_send_skb(sk, len + self->max_header_size, 
+	skb = sock_alloc_send_skb(sk, len + self->max_header_size,
 				  msg->msg_flags & MSG_DONTWAIT, &err);
 	if (!skb)
 		return -ENOBUFS;
 
 	skb_reserve(skb, self->max_header_size);
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(), appending user data\n");
 	asmptr = skb->h.raw = skb_put(skb, len);
 	memcpy_fromiovec(asmptr, msg->msg_iov, len);
@@ -1655,9 +1649,6 @@
 
 /*
  * Function irda_shutdown (sk, how)
- *
- *    
- *
  */
 static int irda_shutdown(struct socket *sock, int how)
 {
@@ -1693,11 +1684,8 @@
 
 /*
  * Function irda_poll (file, sock, wait)
- *
- *    
- *
  */
-static unsigned int irda_poll(struct file * file, struct socket *sock, 
+static unsigned int irda_poll(struct file * file, struct socket *sock,
 			      poll_table *wait)
 {
 	struct sock *sk = sock->sk;
@@ -1732,7 +1720,7 @@
 		}
 
 		if (sk->state == TCP_ESTABLISHED) {
-			if ((self->tx_flow == FLOW_START) && 
+			if ((self->tx_flow == FLOW_START) &&
 			    sock_writeable(sk))
 			{
 				mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
@@ -1740,9 +1728,9 @@
 		}
 		break;
 	case SOCK_SEQPACKET:
-		if ((self->tx_flow == FLOW_START) && 
+		if ((self->tx_flow == FLOW_START) &&
 		    sock_writeable(sk))
-		{	
+		{
 			mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
 		}
 		break;
@@ -1752,22 +1740,19 @@
 		break;
 	default:
 		break;
-	}		
+	}
 	return mask;
 }
 
 /*
  * Function irda_ioctl (sock, cmd, arg)
- *
- *    
- *
  */
 static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	struct sock *sk = sock->sk;
 
 	IRDA_DEBUG(4, __FUNCTION__ "(), cmd=%#x\n", cmd);
-	
+
 	switch (cmd) {
 	case TIOCOUTQ: {
 		long amount;
@@ -1778,7 +1763,7 @@
 			return -EFAULT;
 		return 0;
 	}
-	
+
 	case TIOCINQ: {
 		struct sk_buff *skb;
 		long amount = 0L;
@@ -1789,18 +1774,18 @@
 			return -EFAULT;
 		return 0;
 	}
-	
+
 	case SIOCGSTAMP:
 		if (sk != NULL) {
 			if (sk->stamp.tv_sec == 0)
 				return -ENOENT;
-			if (copy_to_user((void *)arg, &sk->stamp, 
+			if (copy_to_user((void *)arg, &sk->stamp,
 					 sizeof(struct timeval)))
 				return -EFAULT;
 			return 0;
 		}
 		return -EINVAL;
-		
+
 	case SIOCGIFADDR:
 	case SIOCSIFADDR:
 	case SIOCGIFDSTADDR:
@@ -1811,7 +1796,7 @@
 	case SIOCSIFNETMASK:
 	case SIOCGIFMETRIC:
 	case SIOCSIFMETRIC:
-		return -EINVAL;		
+		return -EINVAL;
 	default:
 		IRDA_DEBUG(1, __FUNCTION__ "(), doing device ioctl!\n");
 		return dev_ioctl(cmd, (void *) arg);
@@ -1827,23 +1812,23 @@
  *    Set some options for the socket
  *
  */
-static int irda_setsockopt(struct socket *sock, int level, int optname, 
+static int irda_setsockopt(struct socket *sock, int level, int optname,
 			   char *optval, int optlen)
 {
- 	struct sock *sk = sock->sk;
+	struct sock *sk = sock->sk;
 	struct irda_sock *self = irda_sk(sk);
 	struct irda_ias_set    *ias_opt;
 	struct ias_object      *ias_obj;
 	struct ias_attrib *	ias_attr;	/* Attribute in IAS object */
 	int opt;
-	
+
 	ASSERT(self != NULL, return -1;);
 
 	IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self);
 
 	if (level != SOL_IRLMP)
 		return -ENOPROTOOPT;
-		
+
 	switch (optname) {
 	case IRLMP_IAS_SET:
 		/* The user want to add an attribute to an existing IAS object
@@ -1855,7 +1840,7 @@
 
 		if (optlen != sizeof(struct irda_ias_set))
 			return -EINVAL;
-	
+
 		ias_opt = kmalloc(sizeof(struct irda_ias_set), GFP_ATOMIC);
 		if (ias_opt == NULL)
 			return -ENOMEM;
@@ -1863,7 +1848,7 @@
 		/* Copy query to the driver. */
 		if (copy_from_user(ias_opt, (char *)optval, optlen)) {
 			kfree(ias_opt);
-		  	return -EFAULT;
+			return -EFAULT;
 		}
 
 		/* Find the object we target.
@@ -1907,7 +1892,7 @@
 			/* Add an integer attribute */
 			irias_add_integer_attrib(
 				ias_obj,
-				ias_opt->irda_attrib_name, 
+				ias_opt->irda_attrib_name,
 				ias_opt->attribute.irda_attrib_int,
 				IAS_USER_ATTR);
 			break;
@@ -1921,7 +1906,7 @@
 			/* Add an octet sequence attribute */
 			irias_add_octseq_attrib(
 			      ias_obj,
-			      ias_opt->irda_attrib_name, 
+			      ias_opt->irda_attrib_name,
 			      ias_opt->attribute.irda_attrib_octet_seq.octet_seq,
 			      ias_opt->attribute.irda_attrib_octet_seq.len,
 			      IAS_USER_ATTR);
@@ -1939,7 +1924,7 @@
 			/* Add a string attribute */
 			irias_add_string_attrib(
 				ias_obj,
-				ias_opt->irda_attrib_name, 
+				ias_opt->irda_attrib_name,
 				ias_opt->attribute.irda_attrib_string.string,
 				IAS_USER_ATTR);
 			break;
@@ -1958,15 +1943,15 @@
 
 		if (optlen != sizeof(struct irda_ias_set))
 			return -EINVAL;
-	
+
 		ias_opt = kmalloc(sizeof(struct irda_ias_set), GFP_ATOMIC);
 		if (ias_opt == NULL)
 			return -ENOMEM;
-	
+
 		/* Copy query to the driver. */
 		if (copy_from_user(ias_opt, (char *)optval, optlen)) {
 			kfree(ias_opt);
-		  	return -EFAULT;
+			return -EFAULT;
 		}
 
 		/* Find the object we target.
@@ -1993,7 +1978,7 @@
 
 		/* Find the attribute (in the object) we target */
 		ias_attr = irias_find_attrib(ias_obj,
-					     ias_opt->irda_attrib_name); 
+					     ias_opt->irda_attrib_name);
 		if(ias_attr == (struct ias_attrib *) NULL) {
 			kfree(ias_opt);
 			return -EINVAL;
@@ -2001,7 +1986,7 @@
 
 		/* Check is the user space own the object */
 		if(ias_attr->value->owner != IAS_USER_ATTR) {
-			IRDA_DEBUG(1, __FUNCTION__ 
+			IRDA_DEBUG(1, __FUNCTION__
 				   "(), attempting to delete a kernel attribute\n");
 			kfree(ias_opt);
 			return -EPERM;
@@ -2014,26 +1999,25 @@
 	case IRLMP_MAX_SDU_SIZE:
 		if (optlen < sizeof(int))
 			return -EINVAL;
-	
+
 		if (get_user(opt, (int *)optval))
 			return -EFAULT;
-		
+
 		/* Only possible for a seqpacket service (TTP with SAR) */
 		if (sk->type != SOCK_SEQPACKET) {
-			IRDA_DEBUG(2, __FUNCTION__ 
+			IRDA_DEBUG(2, __FUNCTION__
 				   "(), setting max_sdu_size = %d\n", opt);
 			self->max_sdu_size_rx = opt;
 		} else {
-			WARNING(__FUNCTION__ 
-				"(), not allowed to set MAXSDUSIZE for this "
-				"socket type!\n");
+			WARNING("%s: not allowed to set MAXSDUSIZE for this socket type!\n",
+					__FUNCTION__);
 			return -ENOPROTOOPT;
 		}
 		break;
 	case IRLMP_HINTS_SET:
 		if (optlen < sizeof(int))
 			return -EINVAL;
-	
+
 		if (get_user(opt, (int *)optval))
 			return -EFAULT;
 
@@ -2051,7 +2035,7 @@
 		 */
 		if (optlen < sizeof(int))
 			return -EINVAL;
-	
+
 		if (get_user(opt, (int *)optval))
 			return -EFAULT;
 
@@ -2112,20 +2096,17 @@
 	default :
 		return -EINVAL;
 	}
-	
+
 	/* Copy type over */
 	ias_opt->irda_attrib_type = ias_value->type;
-	
+
 	return 0;
 }
 
 /*
  * Function irda_getsockopt (sock, level, optname, optval, optlen)
- *
- *    
- *
  */
-static int irda_getsockopt(struct socket *sock, int level, int optname, 
+static int irda_getsockopt(struct socket *sock, int level, int optname,
 			   char *optval, int *optlen)
 {
 	struct sock *sk = sock->sk;
@@ -2151,7 +2132,7 @@
 
 	if(len < 0)
 		return -EINVAL;
-		
+
 	switch (optname) {
 	case IRLMP_ENUMDEVICES:
 		/* Ask lmp for the current discovery log */
@@ -2163,13 +2144,13 @@
 		err = 0;
 
 		/* Write total list length back to client */
-		if (copy_to_user(optval, &list, 
+		if (copy_to_user(optval, &list,
 				 sizeof(struct irda_device_list) -
 				 sizeof(struct irda_device_info)))
 			err = -EFAULT;
 
 		/* Offset to first device entry */
-		offset = sizeof(struct irda_device_list) - 
+		offset = sizeof(struct irda_device_list) -
 			sizeof(struct irda_device_info);
 
 		/* Copy the list itself - watch for overflow */
@@ -2198,7 +2179,7 @@
 		len = sizeof(int);
 		if (put_user(len, optlen))
 			return -EFAULT;
-		
+
 		if (copy_to_user(optval, &val, len))
 			return -EFAULT;
 		break;
@@ -2218,7 +2199,7 @@
 		/* Copy query to the driver. */
 		if (copy_from_user((char *) ias_opt, (char *)optval, len)) {
 			kfree(ias_opt);
-		  	return -EFAULT;
+			return -EFAULT;
 		}
 
 		/* Find the object we target.
@@ -2236,7 +2217,7 @@
 
 		/* Find the attribute (in the object) we target */
 		ias_attr = irias_find_attrib(ias_obj,
-					     ias_opt->irda_attrib_name); 
+					     ias_opt->irda_attrib_name);
 		if(ias_attr == (struct ias_attrib *) NULL) {
 			kfree(ias_opt);
 			return -EINVAL;
@@ -2253,7 +2234,7 @@
 		if (copy_to_user((char *)optval, (char *) ias_opt,
 				 sizeof(struct irda_ias_set))) {
 			kfree(ias_opt);
-		  	return -EFAULT;
+			return -EFAULT;
 		}
 		/* Note : don't need to put optlen, we checked it */
 		kfree(ias_opt);
@@ -2274,7 +2255,7 @@
 		/* Copy query to the driver. */
 		if (copy_from_user((char *) ias_opt, (char *)optval, len)) {
 			kfree(ias_opt);
-		  	return -EFAULT;
+			return -EFAULT;
 		}
 
 		/* At this point, there are two cases...
@@ -2301,8 +2282,8 @@
 
 		/* Check that we can proceed with IAP */
 		if (self->iriap) {
-			WARNING(__FUNCTION__
-				"(), busy with a previous query\n");
+			WARNING("%s: busy with a previous query\n",
+					__FUNCTION__);
 			kfree(ias_opt);
 			return -EBUSY;
 		}
@@ -2359,7 +2340,7 @@
 		if (copy_to_user((char *)optval, (char *) ias_opt,
 				 sizeof(struct irda_ias_set))) {
 			kfree(ias_opt);
-		  	return -EFAULT;
+			return -EFAULT;
 		}
 		/* Note : don't need to put optlen, we checked it */
 		kfree(ias_opt);
@@ -2398,7 +2379,7 @@
 		if (!self->cachediscovery) {
 			int ret = 0;
 
-			IRDA_DEBUG(1, __FUNCTION__ 
+			IRDA_DEBUG(1, __FUNCTION__
 				   "(), nothing discovered yet, going to sleep...\n");
 
 			/* Set watchdog timer to expire in <val> ms. */
@@ -2417,14 +2398,14 @@
 			if(timer_pending(&(self->watchdog)))
 				del_timer(&(self->watchdog));
 
-			IRDA_DEBUG(1, __FUNCTION__ 
+			IRDA_DEBUG(1, __FUNCTION__
 				   "(), ...waking up !\n");
 
 			if (ret != 0)
 				return ret;
 		}
 		else
-			IRDA_DEBUG(1, __FUNCTION__ 
+			IRDA_DEBUG(1, __FUNCTION__
 				   "(), found immediately !\n");
 
 		/* Tell IrLMP that we have been notified */
@@ -2445,7 +2426,7 @@
 	default:
 		return -ENOPROTOOPT;
 	}
-	
+
 	return 0;
 }
 
@@ -2456,7 +2437,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = {
 	family:		PF_IRDA,
-	
+
 	release:	irda_release,
 	bind:		irda_bind,
 	connect:	irda_connect,
@@ -2477,7 +2458,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = {
 	family:		PF_IRDA,
-	
+
 	release:	irda_release,
 	bind:		irda_bind,
 	connect:	irda_connect,
@@ -2498,7 +2479,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = {
 	family:		PF_IRDA,
-       
+
 	release:	irda_release,
 	bind:		irda_bind,
 	connect:	irda_connect,
@@ -2520,7 +2501,7 @@
 #ifdef CONFIG_IRDA_ULTRA
 static struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = {
 	family:		PF_IRDA,
-       
+
 	release:	irda_release,
 	bind:		irda_bind,
 	connect:	sock_no_connect,
@@ -2558,11 +2539,11 @@
 			     void *ptr)
 {
 	struct net_device *dev = (struct net_device *) ptr;
-	
+
         /* Reject non IrDA devices */
-	if (dev->type != ARPHRD_IRDA) 
+	if (dev->type != ARPHRD_IRDA)
 		return NOTIFY_DONE;
-	
+
         switch (event) {
 	case NETDEV_UP:
 		IRDA_DEBUG(3, __FUNCTION__ "(), NETDEV_UP\n");
@@ -2581,7 +2562,7 @@
         return NOTIFY_DONE;
 }
 
-static struct packet_type irda_packet_type = 
+static struct packet_type irda_packet_type =
 {
 	0,	/* MUTTER ntohs(ETH_P_IRDA),*/
 	NULL,
@@ -2630,7 +2611,7 @@
 	register_netdevice_notifier(&irda_dev_notifier);
 
 	irda_init();
- 	irda_device_init();
+	irda_device_init();
 	return 0;
 }
 
@@ -2649,16 +2630,16 @@
         dev_remove_pack(&irda_packet_type);
 
         unregister_netdevice_notifier(&irda_dev_notifier);
-	
+
 	sock_unregister(PF_IRDA);
 	irda_cleanup();
-	
+
         return;
 }
 module_exit(irda_proto_cleanup);
- 
+
 MODULE_AUTHOR("Dag Brattli <[email protected]>");
-MODULE_DESCRIPTION("The Linux IrDA Protocol Subsystem"); 
+MODULE_DESCRIPTION("The Linux IrDA Protocol Subsystem");
 MODULE_LICENSE("GPL");
 #ifdef CONFIG_IRDA_DEBUG
 MODULE_PARM(irda_debug, "1l");
#36 lore raw

PATCH 1/1 2.5.21 kill warnings 8/19

In reply to Linus Torvalds

- Fix improper __FUNCTION__ usage in irda_device.
- Whitepsace cleanup there too.

net/irda/irda_device.c +55 -63
diff -urN linux-2.5.21/net/irda/irda_device.c linux/net/irda/irda_device.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      irda_device.c
  * Version:       0.9
  * Description:   Utility functions used by the device drivers
@@ -8,25 +8,25 @@
  * Created at:    Sat Oct  9 09:22:27 1999
  * Modified at:   Sun Jan 23 17:41:24 2000
  * Modified by:   Dag Brattli <[email protected]>
- * 
+ *
  *     Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved.
  *     Copyright (c) 2000-2001 Jean Tourrilhes <[email protected]>
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
- * 
+ *
  *     This program is distributed in the hope that it will be useful,
  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  *     GNU General Public License for more details.
- * 
- *     You should have received a copy of the GNU General Public License 
- *     along with this program; if not, write to the Free Software 
- *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  *     MA 02111-1307 USA
- *     
+ *
  ********************************************************************/
 
 #include <linux/config.h>
@@ -83,7 +83,7 @@
 #ifdef CONFIG_IRDA_DEBUG
 static const char *task_state[] = {
 	"IRDA_TASK_INIT",
-	"IRDA_TASK_DONE", 
+	"IRDA_TASK_DONE",
 	"IRDA_TASK_WAIT",
 	"IRDA_TASK_WAIT1",
 	"IRDA_TASK_WAIT2",
@@ -97,7 +97,7 @@
 static void irda_task_timer_expired(void *data);
 
 #ifdef CONFIG_PROC_FS
-int irda_device_proc_read(char *buf, char **start, off_t offset, int len, 
+int irda_device_proc_read(char *buf, char **start, off_t offset, int len,
 			  int unused);
 
 #endif /* CONFIG_PROC_FS */
@@ -106,21 +106,19 @@
 {
 	dongles = hashbin_new(HB_GLOBAL);
 	if (dongles == NULL) {
-		printk(KERN_WARNING 
-		       "IrDA: Can't allocate dongles hashbin!\n");
+		printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n");
 		return -ENOMEM;
 	}
 
 	tasks = hashbin_new(HB_GLOBAL);
 	if (tasks == NULL) {
-		printk(KERN_WARNING 
-		       "IrDA: Can't allocate tasks hashbin!\n");
+		printk(KERN_WARNING "IrDA: Can't allocate tasks hashbin!\n");
 		return -ENOMEM;
 	}
 
-	/* 
+	/*
 	 * Call the init function of the device drivers that has not been
-	 * compiled as a module 
+	 * compiled as a module
 	 */
 #ifdef CONFIG_IRTTY_SIR
 	irtty_init();
@@ -156,10 +154,10 @@
 	litelink_init();
 #endif
 #ifdef CONFIG_OLD_BELKIN
- 	old_belkin_init();
+	old_belkin_init();
 #endif
 #ifdef CONFIG_EP7211_IR
- 	ep7211_ir_init();
+	ep7211_ir_init();
 #endif
 	return 0;
 }
@@ -178,7 +176,7 @@
  *    Called when we have detected that another station is transmiting
  *    in contention mode.
  */
-void irda_device_set_media_busy(struct net_device *dev, int status) 
+void irda_device_set_media_busy(struct net_device *dev, int status)
 {
 	struct irlap_cb *self;
 
@@ -203,15 +201,15 @@
 }
 
 int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts)
-{	
+{
 	struct if_irda_req req;
 	int ret;
 
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
-		      "device driver\n");
+		ERROR("%s: do_ioctl not impl. by device driver\n",
+				__FUNCTION__);
 		return -1;
 	}
 
@@ -224,15 +222,15 @@
 }
 
 int irda_device_change_speed(struct net_device *dev, __u32 speed)
-{	
+{
 	struct if_irda_req req;
 	int ret;
 
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
-		      "device driver\n");
+		ERROR("%s: do_ioctl not impl. by device driver\n",
+				__FUNCTION__);
 		return -1;
 	}
 
@@ -257,8 +255,8 @@
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
-		      "device driver\n");
+		ERROR("%s: do_ioctl not impl. by device driver\n",
+				__FUNCTION__);
 		return -1;
 	}
 
@@ -279,7 +277,7 @@
 static void __irda_task_delete(struct irda_task *task)
 {
 	del_timer(&task->timer);
-	
+
 	kfree(task);
 }
 
@@ -314,14 +312,14 @@
 	do {
 		timeout = task->function(task);
 		if (count++ > 100) {
-			ERROR(__FUNCTION__ "(), error in task handler!\n");
+			ERROR("%s: error in task handler!\n", __FUNCTION__);
 			irda_task_delete(task);
 			return TRUE;
-		}			
+		}
 	} while ((timeout == 0) && (task->state != IRDA_TASK_DONE));
 
 	if (timeout < 0) {
-		ERROR(__FUNCTION__ "(), Error executing task!\n");
+		ERROR("%s: Error executing task!\n", __FUNCTION__);
 		irda_task_delete(task);
 		return TRUE;
 	}
@@ -346,14 +344,14 @@
 				/* Kick parent task */
 				irda_task_kick(task->parent);
 			}
-		}		
+		}
 		irda_task_delete(task);
 	} else if (timeout > 0) {
-		irda_start_timer(&task->timer, timeout, (void *) task, 
+		irda_start_timer(&task->timer, timeout, (void *) task,
 				 irda_task_timer_expired);
 		finished = FALSE;
 	} else {
-		IRDA_DEBUG(0, __FUNCTION__ 
+		IRDA_DEBUG(0, __FUNCTION__
 			   "(), not finished, and no timeout!\n");
 		finished = FALSE;
 	}
@@ -367,7 +365,7 @@
  *    This function registers and tries to execute tasks that may take some
  *    time to complete. We do it this hairy way since we may have been
  *    called from interrupt context, so it's not possible to use
- *    schedule_timeout() 
+ *    schedule_timeout()
  * Two important notes :
  *	o Make sure you irda_task_delete(task); in case you delete the
  *	  calling instance.
@@ -375,9 +373,9 @@
  *	  want to lock within the task handler.
  * Jean II
  */
-struct irda_task *irda_task_execute(void *instance, 
-				    IRDA_TASK_CALLBACK function, 
-				    IRDA_TASK_CALLBACK finished, 
+struct irda_task *irda_task_execute(void *instance,
+				    IRDA_TASK_CALLBACK function,
+				    IRDA_TASK_CALLBACK finished,
 				    struct irda_task *parent, void *param)
 {
 	struct irda_task *task;
@@ -394,7 +392,7 @@
 	task->function = function;
 	task->finished = finished;
 	task->parent   = parent;
-	task->param    = param;	
+	task->param    = param;
 	task->magic    = IRDA_TASK_MAGIC;
 
 	init_timer(&task->timer);
@@ -433,7 +431,7 @@
  *    This function should be used by low level device drivers in a similar way
  *    as ether_setup() is used by normal network device drivers
  */
-int irda_device_setup(struct net_device *dev) 
+int irda_device_setup(struct net_device *dev)
 {
 	ASSERT(dev != NULL, return -1;);
 
@@ -445,7 +443,7 @@
 
         dev->type            = ARPHRD_IRDA;
         dev->tx_queue_len    = 8; /* Window size + 1 s-frame */
- 
+
 	memset(dev->broadcast, 0xff, 4);
 
 	dev->mtu = 2048;
@@ -491,7 +489,7 @@
 	sprintf(modname, "irda-dongle-%d", type);
 	request_module(modname);
 	}
-#endif /* CONFIG_KMOD */
+#endif
 
 	if (!(reg = hashbin_find(dongles, type, NULL))) {
 		ERROR("IrDA: Unable to find requested dongle\n");
@@ -514,9 +512,6 @@
 
 /*
  * Function irda_device_dongle_cleanup (dongle)
- *
- *    
- *
  */
 int irda_device_dongle_cleanup(dongle_t *dongle)
 {
@@ -531,21 +526,18 @@
 
 /*
  * Function irda_device_register_dongle (dongle)
- *
- *    
- *
  */
 int irda_device_register_dongle(struct dongle_reg *new)
 {
 	/* Check if this dongle has been registred before */
 	if (hashbin_find(dongles, new->type, NULL)) {
-		MESSAGE(__FUNCTION__ "(), Dongle already registered\n");
+		MESSAGE("%s: Dongle already registered\n", __FUNCTION__);
                 return 0;
         }
-	
+
 	/* Insert IrDA dongle into hashbin */
 	hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL);
-	
+
         return 0;
 }
 
@@ -561,7 +553,7 @@
 
 	node = hashbin_remove(dongles, dongle->type, NULL);
 	if (!node) {
-		ERROR(__FUNCTION__ "(), dongle not found!\n");
+		ERROR("%s: dongle not found!\n", __FUNCTION__);
 		return;
 	}
 }
@@ -574,22 +566,22 @@
  *    driver to find out which modes it support.
  */
 int irda_device_set_mode(struct net_device* dev, int mode)
-{	
+{
 	struct if_irda_req req;
 	int ret;
 
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
 
 	if (!dev->do_ioctl) {
-		ERROR(__FUNCTION__ "(), set_raw_mode not impl. by "
-		      "device driver\n");
+		ERROR("%s: set_raw_mode not impl. by device driver\n",
+				__FUNCTION__);
 		return -1;
 	}
-	
+
 	req.ifr_mode = mode;
 
 	ret = dev->do_ioctl(dev, (struct ifreq *) &req, SIOCSMODE);
-	
+
 	return ret;
 }
 
@@ -602,9 +594,9 @@
 void setup_dma(int channel, char *buffer, int count, int mode)
 {
 	unsigned long flags;
-	
+
 	flags = claim_dma_lock();
-	
+
 	disable_dma(channel);
 	clear_dma_ff(channel);
 	set_dma_mode(channel, mode);
#37 lore raw

PATCH 1/1 2.5.21 kill warnings 9/19

In reply to Linus Torvalds

- Fix improper __FUNCTION__ usage in iriap.c
- Trailing white garbage removal as well.

net/irda/iriap.c +136 -139
diff -urN linux-2.5.21/net/irda/iriap.c linux/net/irda/iriap.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      iriap.c
  * Version:       0.8
  * Description:   Information Access Protocol (IAP)
@@ -8,18 +8,18 @@
  * Created at:    Thu Aug 21 00:02:07 1997
  * Modified at:   Sat Dec 25 16:42:42 1999
  * Modified by:   Dag Brattli <[email protected]>
- * 
- *     Copyright (c) 1998-1999 Dag Brattli <[email protected]>, 
+ *
+ *     Copyright (c) 1998-1999 Dag Brattli <[email protected]>,
  *     All Rights Reserved.
  *     Copyright (c) 2000-2001 Jean Tourrilhes <[email protected]>
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
  ********************************************************************/
@@ -59,30 +59,30 @@
 #endif	/* CONFIG_IRDA_DEBUG */
 
 static hashbin_t *iriap = NULL;
-static __u32 service_handle; 
+static __u32 service_handle;
 
 extern char *lmp_reasons[];
 
 static void __iriap_close(struct iriap_cb *self);
 static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode);
-static void iriap_disconnect_indication(void *instance, void *sap, 
+static void iriap_disconnect_indication(void *instance, void *sap,
 					LM_REASON reason, struct sk_buff *skb);
-static void iriap_connect_indication(void *instance, void *sap, 
+static void iriap_connect_indication(void *instance, void *sap,
 				     struct qos_info *qos, __u32 max_sdu_size,
-				     __u8 max_header_size, 
+				     __u8 max_header_size,
 				     struct sk_buff *skb);
-static void iriap_connect_confirm(void *instance, void *sap, 
-				  struct qos_info *qos, 
+static void iriap_connect_confirm(void *instance, void *sap,
+				  struct qos_info *qos,
 				  __u32 max_sdu_size, __u8 max_header_size,
 				  struct sk_buff *skb);
-static int iriap_data_indication(void *instance, void *sap, 
+static int iriap_data_indication(void *instance, void *sap,
 				 struct sk_buff *skb);
 
 /*
  * Function iriap_init (void)
  *
  *    Initializes the IrIAP layer, called by the module initialization code
- *    in irmod.c 
+ *    in irmod.c
  */
 int __init iriap_init(void)
 {
@@ -98,12 +98,12 @@
 
 	objects = hashbin_new(HB_LOCAL);
 	if (!objects) {
-		WARNING(__FUNCTION__ "(), Can't allocate objects hashbin!\n");
+		WARNING("%s: Can't allocate objects hashbin!\n", __FUNCTION__);
 		return -ENOMEM;
 	}
 
-	/* 
-	 *  Register some default services for IrLMP 
+	/*
+	 *  Register some default services for IrLMP
 	 */
 	hints  = irlmp_service_to_hint(S_COMPUTER);
 	service_handle = irlmp_register_service(hints);
@@ -122,9 +122,9 @@
 				IAS_KERNEL_ATTR);
 	irias_insert_object(obj);
 
-	/*  
-	 *  Register server support with IrLMP so we can accept incoming 
-	 *  connections 
+	/*
+	 *  Register server support with IrLMP so we can accept incoming
+	 *  connections
 	 */
 	server = iriap_open(LSAP_IAS, IAS_SERVER, NULL, NULL);
 	if (!server) {
@@ -139,15 +139,15 @@
 /*
  * Function iriap_cleanup (void)
  *
- *    Initializes the IrIAP layer, called by the module cleanup code in 
+ *    Initializes the IrIAP layer, called by the module cleanup code in
  *    irmod.c
  */
 void iriap_cleanup(void)
 {
 	irlmp_unregister_service(service_handle);
-	
+
 	hashbin_delete(iriap, (FREE_FUNC) __iriap_close);
-	hashbin_delete(objects, (FREE_FUNC) __irias_delete_object);	
+	hashbin_delete(objects, (FREE_FUNC) __irias_delete_object);
 }
 
 /*
@@ -155,7 +155,7 @@
  *
  *    Opens an instance of the IrIAP layer, and registers with IrLMP
  */
-struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, 
+struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
 			    CONFIRM_CALLBACK callback)
 {
 	struct iriap_cb *self;
@@ -164,7 +164,7 @@
 
 	self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC);
 	if (!self) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 
@@ -172,7 +172,7 @@
 	 *  Initialize instance
 	 */
 	memset(self, 0, sizeof(struct iriap_cb));
-	
+
 	self->magic = IAS_MAGIC;
 	self->mode = mode;
 	if (mode == IAS_CLIENT)
@@ -184,13 +184,13 @@
 	init_timer(&self->watchdog_timer);
 
 	hashbin_insert(iriap, (irda_queue_t *) self, (int) self, NULL);
-	
+
 	/* Initialize state machines */
 	iriap_next_client_state(self, S_DISCONNECT);
 	iriap_next_call_state(self, S_MAKE_CALL);
 	iriap_next_server_state(self, R_DISCONNECT);
 	iriap_next_r_connect_state(self, R_WAITING);
-	
+
 	return self;
 }
 
@@ -261,7 +261,7 @@
 
 	self->lsap = irlmp_open_lsap(slsap_sel, &notify, 0);
 	if (self->lsap == NULL) {
-		ERROR(__FUNCTION__ "(), Unable to allocated LSAP!\n");
+		ERROR("%s: Unable to allocated LSAP!\n", __FUNCTION__);
 		return -1;
 	}
 	self->slsap_sel = self->lsap->slsap_sel;
@@ -275,8 +275,8 @@
  *    Got disconnect, so clean up everything assosiated with this connection
  *
  */
-static void iriap_disconnect_indication(void *instance, void *sap, 
-					LM_REASON reason, 
+static void iriap_disconnect_indication(void *instance, void *sap,
+					LM_REASON reason,
 					struct sk_buff *userdata)
 {
 	struct iriap_cb *self;
@@ -296,18 +296,18 @@
 		IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as client\n");
 
 
-		iriap_do_client_event(self, IAP_LM_DISCONNECT_INDICATION, 
+		iriap_do_client_event(self, IAP_LM_DISCONNECT_INDICATION,
 				      NULL);
-		/* 
-		 * Inform service user that the request failed by sending 
+		/*
+		 * Inform service user that the request failed by sending
 		 * it a NULL value. Warning, the client might close us, so
 		 * remember no to use self anymore after calling confirm
 		 */
 		if (self->confirm)
- 			self->confirm(IAS_DISCONNECT, 0, NULL, self->priv);
+			self->confirm(IAS_DISCONNECT, 0, NULL, self->priv);
 	} else {
 		IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as server\n");
-		iriap_do_server_event(self, IAP_LM_DISCONNECT_INDICATION, 
+		iriap_do_server_event(self, IAP_LM_DISCONNECT_INDICATION,
 				      NULL);
 		iriap_close(self);
 	}
@@ -318,9 +318,6 @@
 
 /*
  * Function iriap_disconnect_request (handle)
- *
- *    
- *
  */
 void iriap_disconnect_request(struct iriap_cb *self)
 {
@@ -338,35 +335,35 @@
 		return;
 	}
 
-	/* 
-	 *  Reserve space for MUX control and LAP header 
+	/*
+	 *  Reserve space for MUX control and LAP header
 	 */
- 	skb_reserve(skb, LMP_MAX_HEADER);
+	skb_reserve(skb, LMP_MAX_HEADER);
 
 	irlmp_disconnect_request(self->lsap, skb);
 }
 
-void iriap_getinfobasedetails_request(void) 
+void iriap_getinfobasedetails_request(void)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
 }
 
-void iriap_getinfobasedetails_confirm(void) 
+void iriap_getinfobasedetails_confirm(void)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
 }
 
-void iriap_getobjects_request(void) 
+void iriap_getobjects_request(void)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
 }
 
-void iriap_getobjects_confirm(void) 
+void iriap_getobjects_confirm(void)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
 }
 
-void iriap_getvalue(void) 
+void iriap_getvalue(void)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
 }
@@ -378,7 +375,7 @@
  *    name
  */
 int iriap_getvaluebyclass_request(struct iriap_cb *self,
-				  __u32 saddr, __u32 daddr, 
+				  __u32 saddr, __u32 daddr,
 				  char *name, char *attr)
 {
 	struct sk_buff *skb;
@@ -391,18 +388,18 @@
 	/* Client must supply the destination device address */
 	if (!daddr)
 		return -1;
-	
+
 	self->daddr = daddr;
 	self->saddr = saddr;
 
-	/* 
+	/*
 	 *  Save operation, so we know what the later indication is about
 	 */
-	self->operation = GET_VALUE_BY_CLASS; 
+	self->operation = GET_VALUE_BY_CLASS;
 
 	/* Give ourselves 10 secs to finish this operation */
 	iriap_start_watchdog_timer(self, 10*HZ);
-	
+
 	name_len = strlen(name);	/* Up to IAS_MAX_CLASSNAME = 60 */
 	attr_len = strlen(attr);	/* Up to IAS_MAX_ATTRIBNAME = 60 */
 
@@ -412,7 +409,7 @@
 		return -ENOMEM;
 
 	/* Reserve space for MUX and LAP header */
- 	skb_reserve(skb, self->max_header_size);
+	skb_reserve(skb, self->max_header_size);
 	skb_put(skb, 3+name_len+attr_len);
 	frame = skb->data;
 
@@ -435,7 +432,7 @@
  *    to service user.
  *
  */
-void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb) 
+void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb)
 {
 	struct ias_value *value;
 	int charset;
@@ -473,7 +470,7 @@
 		value = irias_new_integer_value(tmp_cpu32);
 
 		/*  Legal values restricted to 0x01-0x6f, page 15 irttp */
-		IRDA_DEBUG(4, __FUNCTION__ "(), lsap=%d\n", value->t.integer); 
+		IRDA_DEBUG(4, __FUNCTION__ "(), lsap=%d\n", value->t.integer);
 		break;
 	case IAS_STRING:
 		charset = fp[n++];
@@ -481,16 +478,16 @@
 		switch (charset) {
 		case CS_ASCII:
 			break;
-/* 		case CS_ISO_8859_1: */
-/* 		case CS_ISO_8859_2: */
-/* 		case CS_ISO_8859_3: */
-/* 		case CS_ISO_8859_4: */
-/* 		case CS_ISO_8859_5: */
-/* 		case CS_ISO_8859_6: */
-/* 		case CS_ISO_8859_7: */
-/* 		case CS_ISO_8859_8: */
-/* 		case CS_ISO_8859_9: */
-/* 		case CS_UNICODE: */
+/*		case CS_ISO_8859_1: */
+/*		case CS_ISO_8859_2: */
+/*		case CS_ISO_8859_3: */
+/*		case CS_ISO_8859_4: */
+/*		case CS_ISO_8859_5: */
+/*		case CS_ISO_8859_6: */
+/*		case CS_ISO_8859_7: */
+/*		case CS_ISO_8859_8: */
+/*		case CS_ISO_8859_9: */
+/*		case CS_UNICODE: */
 		default:
 			IRDA_DEBUG(0, __FUNCTION__
 				   "(), charset %s, not supported\n",
@@ -504,7 +501,7 @@
 		}
 		value_len = fp[n++];
 		IRDA_DEBUG(4, __FUNCTION__ "(), strlen=%d\n", value_len);
-		
+
 		/* Make sure the string is null-terminated */
 		fp[n+value_len] = 0x00;
 		IRDA_DEBUG(4, "Got string %s\n", fp+n);
@@ -515,7 +512,7 @@
 	case IAS_OCT_SEQ:
 		value_len = be16_to_cpu(get_unaligned((__u16 *)(fp+n)));
 		n += 2;
-		
+
 		/* Will truncate to IAS_MAX_OCTET_STRING bytes */
 		value = irias_new_octseq_value(fp+n, value_len);
 		break;
@@ -523,12 +520,12 @@
 		value = irias_new_missing_value();
 		break;
 	}
-	
+
 	/* Finished, close connection! */
 	iriap_disconnect_request(self);
 
 	/* Warning, the client might close us, so remember no to use self
-	 * anymore after calling confirm 
+	 * anymore after calling confirm
 	 */
 	if (self->confirm)
 		self->confirm(IAS_SUCCESS, obj_id, value, self->priv);
@@ -543,9 +540,9 @@
  * Function iriap_getvaluebyclass_response ()
  *
  *    Send answer back to remote LM-IAS
- * 
+ *
  */
-void iriap_getvaluebyclass_response(struct iriap_cb *self, __u16 obj_id, 
+void iriap_getvaluebyclass_response(struct iriap_cb *self, __u16 obj_id,
 				    __u8 ret_code, struct ias_value *value)
 {
 	struct sk_buff *skb;
@@ -563,8 +560,8 @@
 	/* Initialize variables */
 	n = 0;
 
-	/* 
-	 *  We must adjust the size of the response after the length of the 
+	/*
+	 *  We must adjust the size of the response after the length of the
 	 *  value. We add 32 bytes because of the 6 bytes for the frame and
 	 *  max 5 bytes for the value coding.
 	 */
@@ -573,9 +570,9 @@
 		return;
 
 	/* Reserve space for MUX and LAP header */
- 	skb_reserve(skb, self->max_header_size);
+	skb_reserve(skb, self->max_header_size);
 	skb_put(skb, 6);
-	
+
 	fp = skb->data;
 
 	/* Build frame */
@@ -584,7 +581,7 @@
 
 	/* Insert list length (MSB first) */
 	tmp_be16 = __constant_htons(0x0001);
-	memcpy(fp+n, &tmp_be16, 2);  n += 2; 
+	memcpy(fp+n, &tmp_be16, 2);  n += 2;
 
 	/* Insert object identifier ( MSB first) */
 	tmp_be16 = cpu_to_be16(obj_id);
@@ -601,7 +598,7 @@
 	case IAS_INTEGER:
 		skb_put(skb, 5);
 		fp[n++] = value->type;
-		
+
 		tmp_be32 = cpu_to_be32(value->t.integer);
 		memcpy(fp+n, &tmp_be32, 4); n += 4;
 		break;
@@ -631,10 +628,10 @@
  *    getvaluebyclass is requested from peer LM-IAS
  *
  */
-void iriap_getvaluebyclass_indication(struct iriap_cb *self, 
+void iriap_getvaluebyclass_indication(struct iriap_cb *self,
 				      struct sk_buff *skb)
 {
- 	struct ias_object *obj;
+	struct ias_object *obj;
 	struct ias_attrib *attrib;
 	int name_len;
 	int attr_len;
@@ -656,7 +653,7 @@
 	memcpy(name, fp+n, name_len); n+=name_len;
 	name[name_len] = '\0';
 
-	attr_len = fp[n++]; 
+	attr_len = fp[n++];
 	memcpy(attr, fp+n, attr_len); n+=attr_len;
 	attr[attr_len] = '\0';
 
@@ -665,7 +662,7 @@
 
 	IRDA_DEBUG(4, "LM-IAS: Looking up %s: %s\n", name, attr);
 	obj = irias_find_object(name);
-	
+
 	if (obj == NULL) {
 		IRDA_DEBUG(2, "LM-IAS: Object %s not found\n", name);
 		iriap_getvaluebyclass_response(self, 0x1235, IAS_CLASS_UNKNOWN,
@@ -673,7 +670,7 @@
 		return;
 	}
 	IRDA_DEBUG(4, "LM-IAS: found %s, id=%d\n", obj->name, obj->id);
-	
+
 	attrib = irias_find_attrib(obj, attr);
 	if (attrib == NULL) {
 		IRDA_DEBUG(2, "LM-IAS: Attribute %s not found\n", attr);
@@ -681,11 +678,11 @@
 					       IAS_ATTRIB_UNKNOWN, &missing);
 		return;
 	}
-	
+
 	/* We have a match; send the value.  */
-	iriap_getvaluebyclass_response(self, obj->id, IAS_SUCCESS, 
+	iriap_getvaluebyclass_response(self, obj->id, IAS_SUCCESS,
 				       attrib->value);
-	
+
 	return;
 }
 
@@ -695,7 +692,7 @@
  *    Currently not used
  *
  */
-void iriap_send_ack(struct iriap_cb *self) 
+void iriap_send_ack(struct iriap_cb *self)
 {
 	struct sk_buff *skb;
 	__u8 *frame;
@@ -710,7 +707,7 @@
 		return;
 
 	/* Reserve space for MUX and LAP header */
- 	skb_reserve(skb, self->max_header_size);
+	skb_reserve(skb, self->max_header_size);
 	skb_put(skb, 1);
 	frame = skb->data;
 
@@ -727,8 +724,8 @@
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
 
-	ret = irlmp_connect_request(self->lsap, LSAP_IAS, 
-				    self->saddr, self->daddr, 
+	ret = irlmp_connect_request(self->lsap, LSAP_IAS,
+				    self->saddr, self->daddr,
 				    NULL, NULL);
 	if (ret < 0) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), connect failed!\n");
@@ -742,22 +739,22 @@
  *    LSAP connection confirmed!
  *
  */
-static void iriap_connect_confirm(void *instance, void *sap, 
-				  struct qos_info *qos, __u32 max_seg_size, 
-				  __u8 max_header_size, 
+static void iriap_connect_confirm(void *instance, void *sap,
+				  struct qos_info *qos, __u32 max_seg_size,
+				  __u8 max_header_size,
 				  struct sk_buff *userdata)
 {
 	struct iriap_cb *self;
-	
+
 	self = (struct iriap_cb *) instance;
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
 	ASSERT(userdata != NULL, return;);
-	
+
 	self->max_data_size = max_seg_size;
 	self->max_header_size = max_header_size;
-	
+
 	del_timer(&self->watchdog_timer);
 
 	iriap_do_client_event(self, IAP_LM_CONNECT_CONFIRM, userdata);
@@ -769,9 +766,9 @@
  *    Remote LM-IAS is requesting connection
  *
  */
-static void iriap_connect_indication(void *instance, void *sap, 
+static void iriap_connect_indication(void *instance, void *sap,
 				     struct qos_info *qos, __u32 max_seg_size,
-				     __u8 max_header_size, 
+				     __u8 max_header_size,
 				     struct sk_buff *userdata)
 {
 	struct iriap_cb *self, *new;
@@ -782,46 +779,46 @@
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
-	
+
 	/* Start new server */
-	new = iriap_open(LSAP_IAS, IAS_SERVER, NULL, NULL); 
+	new = iriap_open(LSAP_IAS, IAS_SERVER, NULL, NULL);
 	if (!new) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), open failed\n");
 		dev_kfree_skb(userdata);
 		return;
 	}
-	
+
 	/* Now attach up the new "socket" */
 	new->lsap = irlmp_dup(self->lsap, new);
 	if (!new->lsap) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), dup failed!\n");
 		return;
 	}
-		
+
 	new->max_data_size = max_seg_size;
 	new->max_header_size = max_header_size;
 
 	/* Clean up the original one to keep it in listen state */
 	irlmp_listen(self->lsap);
-	
+
 	iriap_do_server_event(new, IAP_LM_CONNECT_INDICATION, userdata);
 }
- 
+
 /*
  * Function iriap_data_indication (handle, skb)
  *
  *    Receives data from connection identified by handle from IrLMP
  *
  */
-static int iriap_data_indication(void *instance, void *sap, 
-				 struct sk_buff *skb) 
+static int iriap_data_indication(void *instance, void *sap,
+				 struct sk_buff *skb)
 {
 	struct iriap_cb *self;
 	__u8  *frame;
 	__u8  opcode;
-	
-	IRDA_DEBUG(3, __FUNCTION__ "()\n"); 
-	
+
+	IRDA_DEBUG(3, __FUNCTION__ "()\n");
+
 	self = (struct iriap_cb *) instance;
 
 	ASSERT(self != NULL, return 0;);
@@ -830,7 +827,7 @@
 	ASSERT(skb != NULL, return 0;);
 
 	frame = skb->data;
-	
+
 	if (self->mode == IAS_SERVER) {
 		/* Call server */
 		IRDA_DEBUG(4, __FUNCTION__ "(), Calling server!\n");
@@ -840,17 +837,17 @@
 	}
 	opcode = frame[0];
 	if (~opcode & IAP_LST) {
-		WARNING(__FUNCTION__ "(), IrIAS multiframe commands or "
-			"results is not implemented yet!\n");
+		WARNING("%s:, IrIAS multiframe commands or "
+			"results is not implemented yet!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 		return 0;
 	}
-	
+
 	/* Check for ack frames since they don't contain any data */
 	if (opcode & IAP_ACK) {
 		IRDA_DEBUG(0, __FUNCTION__ "() Got ack frame!\n");
 		dev_kfree_skb(skb);
-	 	return 0;
+		return 0;
 	}
 
 	opcode &= ~IAP_LST; /* Mask away LST bit */
@@ -862,7 +859,7 @@
 		break;
 	case GET_VALUE_BY_CLASS:
 		iriap_do_call_event(self, IAP_RECV_F_LST, NULL);
-			
+
 		switch (frame[1]) {
 		case IAS_SUCCESS:
 			iriap_getvaluebyclass_confirm(self, skb);
@@ -872,9 +869,9 @@
 			/* Finished, close connection! */
 			iriap_disconnect_request(self);
 
-			/* 
+			/*
 			 * Warning, the client might close us, so remember
-			 * no to use self anymore after calling confirm 
+			 * no to use self anymore after calling confirm
 			 */
 			if (self->confirm)
 				self->confirm(IAS_CLASS_UNKNOWN, 0, NULL,
@@ -883,22 +880,22 @@
 			break;
 		case IAS_ATTRIB_UNKNOWN:
 			IRDA_DEBUG(1, __FUNCTION__ "(), No such attribute!\n");
-		       	/* Finished, close connection! */
+			/* Finished, close connection! */
 			iriap_disconnect_request(self);
 
-			/* 
+			/*
 			 * Warning, the client might close us, so remember
-			 * no to use self anymore after calling confirm 
+			 * no to use self anymore after calling confirm
 			 */
 			if (self->confirm)
-				self->confirm(IAS_ATTRIB_UNKNOWN, 0, NULL, 
+				self->confirm(IAS_ATTRIB_UNKNOWN, 0, NULL,
 					      self->priv);
 			dev_kfree_skb(skb);
 			break;
-		}		
+		}
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown op-code: %02x\n", 
+		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown op-code: %02x\n",
 			   opcode);
 		dev_kfree_skb(skb);
 		break;
@@ -927,16 +924,16 @@
 
 	opcode = fp[0];
 	if (~opcode & 0x80) {
-		WARNING(__FUNCTION__ "(), IrIAS multiframe commands or results"
-			"is not implemented yet!\n");
+		WARNING("%s: IrIAS multiframe commands or results"
+			"is not implemented yet!\n", __FUNCTION__);
 		return;
 	}
 	opcode &= 0x7f; /* Mask away LST bit */
-	
+
 	switch (opcode) {
 	case GET_INFO_BASE:
-		WARNING(__FUNCTION__ 
-			"(), GetInfoBaseDetails not implemented yet!\n");
+		WARNING("%s: GetInfoBaseDetails not implemented yet!\n",
+				__FUNCTION__);
 		break;
 	case GET_VALUE_BY_CLASS:
 		iriap_getvaluebyclass_indication(self, skb);
@@ -953,7 +950,7 @@
 void iriap_watchdog_timer_expired(void *data)
 {
 	struct iriap_cb *self = (struct iriap_cb *) data;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
 
@@ -994,23 +991,23 @@
 		len += sprintf(buf+len, "\n");
 
 		/* List all attributes for this object */
-		attrib = (struct ias_attrib *) 
+		attrib = (struct ias_attrib *)
 			hashbin_get_first(obj->attribs);
 		while (attrib != NULL) {
 			ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return 0;);
 
 			len += sprintf(buf+len, " - Attribute name: \"%s\", ",
 				       attrib->name);
-			len += sprintf(buf+len, "value[%s]: ", 
+			len += sprintf(buf+len, "value[%s]: ",
 				       ias_value_types[attrib->value->type]);
-			
+
 			switch (attrib->value->type) {
 			case IAS_INTEGER:
-				len += sprintf(buf+len, "%d\n", 
+				len += sprintf(buf+len, "%d\n",
 					       attrib->value->t.integer);
 				break;
 			case IAS_STRING:
-				len += sprintf(buf+len, "\"%s\"\n", 
+				len += sprintf(buf+len, "\"%s\"\n",
 					       attrib->value->t.string);
 				break;
 			case IAS_OCT_SEQ:
@@ -1020,17 +1017,17 @@
 				len += sprintf(buf+len, "missing\n");
 				break;
 			default:
-				IRDA_DEBUG(0, __FUNCTION__ 
+				IRDA_DEBUG(0, __FUNCTION__
 				      "(), Unknown value type!\n");
 				return -1;
 			}
 			len += sprintf(buf+len, "\n");
-			
-			attrib = (struct ias_attrib *) 
+
+			attrib = (struct ias_attrib *)
 				hashbin_get_next(obj->attribs);
 		}
 	        obj = (struct ias_object *) hashbin_get_next(objects);
- 	} 
+	}
 	restore_flags(flags);
 
 	return len;
#38 lore raw

PATCH 1/1 2.5.21 kill warnings 10/19

In reply to Linus Torvalds

This time for iriap_event.

net/irda/iriap_event.c +94 -104
diff -urN linux-2.5.21/net/irda/iriap_event.c linux/net/irda/iriap_event.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      iriap_event.c
  * Version:       0.1
  * Description:   IAP Finite State Machine
@@ -8,17 +8,17 @@
  * Created at:    Thu Aug 21 00:02:07 1997
  * Modified at:   Wed Mar  1 11:28:34 2000
  * Modified by:   Dag Brattli <[email protected]>
- * 
- *     Copyright (c) 1997, 1999-2000 Dag Brattli <[email protected]>, 
+ *
+ *     Copyright (c) 1997, 1999-2000 Dag Brattli <[email protected]>,
  *     All Rights Reserved.
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
  ********************************************************************/
@@ -28,48 +28,48 @@
 #include <net/irda/iriap.h>
 #include <net/irda/iriap_event.h>
 
-static void state_s_disconnect   (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_disconnect   (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_s_connecting   (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_connecting   (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_s_call         (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_call         (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
 
-static void state_s_make_call    (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_make_call    (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_s_calling      (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_calling      (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_s_outstanding  (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_outstanding  (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_s_replying     (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_replying     (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_s_wait_for_call(struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_wait_for_call(struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_s_wait_active  (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_s_wait_active  (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
 
-static void state_r_disconnect   (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_r_disconnect   (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_r_call         (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_r_call         (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_r_waiting      (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_r_waiting      (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_r_wait_active  (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_r_wait_active  (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_r_receiving    (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_r_receiving    (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_r_execute      (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_r_execute      (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
-static void state_r_returning    (struct iriap_cb *self, IRIAP_EVENT event, 
+static void state_r_returning    (struct iriap_cb *self, IRIAP_EVENT event,
 				  struct sk_buff *skb);
 
-static void (*iriap_state[])(struct iriap_cb *self, IRIAP_EVENT event, 
-			     struct sk_buff *skb) = { 
+static void (*iriap_state[])(struct iriap_cb *self, IRIAP_EVENT event,
+			     struct sk_buff *skb) = {
 	/* Client FSM */
 	state_s_disconnect,
 	state_s_connecting,
 	state_s_call,
-	
+
 	/* S-Call FSM */
 	state_s_make_call,
 	state_s_calling,
@@ -90,7 +90,7 @@
 	state_r_returning,
 };
 
-void iriap_next_client_state(struct iriap_cb *self, IRIAP_STATE state) 
+void iriap_next_client_state(struct iriap_cb *self, IRIAP_STATE state)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
@@ -98,7 +98,7 @@
 	self->client_state = state;
 }
 
-void iriap_next_call_state(struct iriap_cb *self, IRIAP_STATE state) 
+void iriap_next_call_state(struct iriap_cb *self, IRIAP_STATE state)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
@@ -118,12 +118,12 @@
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
-	
+
 	self->r_connect_state = state;
 }
 
-void iriap_do_client_event(struct iriap_cb *self, IRIAP_EVENT event, 
-			   struct sk_buff *skb) 
+void iriap_do_client_event(struct iriap_cb *self, IRIAP_EVENT event,
+			   struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
@@ -131,30 +131,30 @@
 	(*iriap_state[ self->client_state]) (self, event, skb);
 }
 
-void iriap_do_call_event(struct iriap_cb *self, IRIAP_EVENT event, 
-			 struct sk_buff *skb) 
+void iriap_do_call_event(struct iriap_cb *self, IRIAP_EVENT event,
+			 struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
-	
+
 	(*iriap_state[ self->call_state]) (self, event, skb);
 }
 
-void iriap_do_server_event(struct iriap_cb *self, IRIAP_EVENT event, 
-			   struct sk_buff *skb) 
+void iriap_do_server_event(struct iriap_cb *self, IRIAP_EVENT event,
+			   struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
-	
+
 	(*iriap_state[ self->server_state]) (self, event, skb);
 }
 
-void iriap_do_r_connect_event(struct iriap_cb *self, IRIAP_EVENT event, 
-			      struct sk_buff *skb) 
+void iriap_do_r_connect_event(struct iriap_cb *self, IRIAP_EVENT event,
+			      struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
-	
+
 	(*iriap_state[ self->r_connect_state]) (self, event, skb);
 }
 
@@ -165,8 +165,8 @@
  *    S-Disconnect, The device has no LSAP connection to a particular
  *    remote device.
  */
-static void state_s_disconnect(struct iriap_cb *self, IRIAP_EVENT event, 
-			       struct sk_buff *skb) 
+static void state_s_disconnect(struct iriap_cb *self, IRIAP_EVENT event,
+			       struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
@@ -192,8 +192,8 @@
  *    S-Connecting
  *
  */
-static void state_s_connecting(struct iriap_cb *self, IRIAP_EVENT event, 
-			       struct sk_buff *skb) 
+static void state_s_connecting(struct iriap_cb *self, IRIAP_EVENT event,
+			       struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IAS_MAGIC, return;);
@@ -223,10 +223,10 @@
  *
  *    S-Call, The device can process calls to a specific remote
  *    device. Whenever the LSAP connection is disconnected, this state
- *    catches that event and clears up 
+ *    catches that event and clears up
  */
-static void state_s_call(struct iriap_cb *self, IRIAP_EVENT event, 
-			 struct sk_buff *skb) 
+static void state_s_call(struct iriap_cb *self, IRIAP_EVENT event,
+			 struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 
@@ -248,8 +248,8 @@
  *    S-Make-Call
  *
  */
-static void state_s_make_call(struct iriap_cb *self, IRIAP_EVENT event, 
-			      struct sk_buff *skb) 
+static void state_s_make_call(struct iriap_cb *self, IRIAP_EVENT event,
+			      struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 
@@ -257,7 +257,7 @@
 	case IAP_CALL_REQUEST:
 		skb = self->skb;
 		self->skb = NULL;
-		
+
 		irlmp_data_request(self->lsap, skb);
 		iriap_next_call_state(self, S_OUTSTANDING);
 		break;
@@ -275,8 +275,8 @@
  *    S-Calling
  *
  */
-static void state_s_calling(struct iriap_cb *self, IRIAP_EVENT event, 
-			    struct sk_buff *skb) 
+static void state_s_calling(struct iriap_cb *self, IRIAP_EVENT event,
+			    struct sk_buff *skb)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented\n");
 }
@@ -287,8 +287,8 @@
  *    S-Outstanding, The device is waiting for a response to a command
  *
  */
-static void state_s_outstanding(struct iriap_cb *self, IRIAP_EVENT event, 
-				struct sk_buff *skb) 
+static void state_s_outstanding(struct iriap_cb *self, IRIAP_EVENT event,
+				struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 
@@ -302,7 +302,7 @@
 	default:
 		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %d\n", event);
 		break;
-	}		
+	}
 }
 
 /*
@@ -310,8 +310,8 @@
  *
  *    S-Replying, The device is collecting a multiple part response
  */
-static void state_s_replying(struct iriap_cb *self, IRIAP_EVENT event, 
-			     struct sk_buff *skb) 
+static void state_s_replying(struct iriap_cb *self, IRIAP_EVENT event,
+			     struct sk_buff *skb)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented\n");
 }
@@ -322,8 +322,8 @@
  *    S-Wait-for-Call
  *
  */
-static void state_s_wait_for_call(struct iriap_cb *self, IRIAP_EVENT event, 
-				  struct sk_buff *skb) 
+static void state_s_wait_for_call(struct iriap_cb *self, IRIAP_EVENT event,
+				  struct sk_buff *skb)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented\n");
 }
@@ -335,15 +335,15 @@
  *    S-Wait-Active
  *
  */
-static void state_s_wait_active(struct iriap_cb *self, IRIAP_EVENT event, 
-				struct sk_buff *skb) 
+static void state_s_wait_active(struct iriap_cb *self, IRIAP_EVENT event,
+				struct sk_buff *skb)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented\n");
 }
 
 /**************************************************************************
- * 
- *  Server FSM 
+ *
+ *  Server FSM
  *
  **************************************************************************/
 
@@ -353,27 +353,27 @@
  *    LM-IAS server is disconnected (not processing any requests!)
  *
  */
-static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event, 
-			       struct sk_buff *skb) 
+static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event,
+			       struct sk_buff *skb)
 {
 	struct sk_buff *tx_skb;
-	
+
 	switch (event) {
 	case IAP_LM_CONNECT_INDICATION:
 		tx_skb = dev_alloc_skb(64);
 		if (tx_skb == NULL) {
-			WARNING(__FUNCTION__ "(), unable to malloc!\n");
+			WARNING("%s: unable to malloc!\n", __FUNCTION__);
 			return;
 		}
 
 		/* Reserve space for MUX_CONTROL and LAP header */
 		skb_reserve(tx_skb, LMP_MAX_HEADER);
-		
+
 		irlmp_connect_response(self->lsap, tx_skb);
 		/*LM_Idle_request(idle); */
-		
+
 		iriap_next_server_state(self, R_CALL);
-		
+
 		/*
 		 *  Jump to R-Connect FSM, we skip R-Waiting since we do not
 		 *  care about LM_Idle_request()!
@@ -382,22 +382,19 @@
 
 		if (skb)
 			dev_kfree_skb(skb);
-		
+
 		break;
 	default:
 		IRDA_DEBUG(0, __FUNCTION__ "(), unknown event %d\n", event);
 		break;
-	}		
+	}
 }
 
 /*
  * Function state_r_call (self, event, skb)
- *
- *    
- *
  */
-static void state_r_call(struct iriap_cb *self, IRIAP_EVENT event, 
-			 struct sk_buff *skb) 
+static void state_r_call(struct iriap_cb *self, IRIAP_EVENT event,
+			 struct sk_buff *skb)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
@@ -405,7 +402,7 @@
 	case IAP_LM_DISCONNECT_INDICATION:
 		/* Abort call */
 		iriap_next_server_state(self, R_DISCONNECT);
-		iriap_next_r_connect_state(self, R_WAITING);		
+		iriap_next_r_connect_state(self, R_WAITING);
 		break;
 	default:
 		IRDA_DEBUG(0, __FUNCTION__ "(), unknown event!\n");
@@ -413,24 +410,21 @@
 	}
 }
 
-/* 
- *  R-Connect FSM 
-*/
+/*
+ *  R-Connect FSM
+ */
 
 /*
  * Function state_r_waiting (self, event, skb)
- *
- *    
- *
  */
-static void state_r_waiting(struct iriap_cb *self, IRIAP_EVENT event, 
-			    struct sk_buff *skb) 
+static void state_r_waiting(struct iriap_cb *self, IRIAP_EVENT event,
+			    struct sk_buff *skb)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented\n");
 }
 
-static void state_r_wait_active(struct iriap_cb *self, IRIAP_EVENT event, 
-				struct sk_buff *skb) 
+static void state_r_wait_active(struct iriap_cb *self, IRIAP_EVENT event,
+				struct sk_buff *skb)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented\n");
 }
@@ -441,15 +435,15 @@
  *    We are receiving a command
  *
  */
-static void state_r_receiving(struct iriap_cb *self, IRIAP_EVENT event, 
-			      struct sk_buff *skb) 
+static void state_r_receiving(struct iriap_cb *self, IRIAP_EVENT event,
+			      struct sk_buff *skb)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	switch (event) {
 	case IAP_RECV_F_LST:
 		iriap_next_r_connect_state(self, R_EXECUTE);
-	 		
+
 		iriap_call_indication(self, skb);
 		break;
 	default:
@@ -465,26 +459,26 @@
  *    The server is processing the request
  *
  */
-static void state_r_execute(struct iriap_cb *self, IRIAP_EVENT event, 
-			    struct sk_buff *skb) 
+static void state_r_execute(struct iriap_cb *self, IRIAP_EVENT event,
+			    struct sk_buff *skb)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(skb != NULL, return;);
-	
+
 	if (!self || self->magic != IAS_MAGIC) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), bad pointer self\n");
 		return;
-	}	
+	}
 
 	switch (event) {
 	case IAP_CALL_RESPONSE:
-		/*  
+		/*
 		 *  Since we don't implement the Waiting state, we return
 		 *  to state Receiving instead, DB.
 		 */
 		iriap_next_r_connect_state(self, R_RECEIVING);
-	 		
+
 		irlmp_data_request(self->lsap, skb);
 		break;
 	default:
@@ -493,19 +487,15 @@
 	}
 }
 
-static void state_r_returning(struct iriap_cb *self, IRIAP_EVENT event, 
-			      struct sk_buff *skb) 
+static void state_r_returning(struct iriap_cb *self, IRIAP_EVENT event,
+			      struct sk_buff *skb)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), event=%d\n", event);
 
 	switch (event) {
 	case IAP_RECV_F_LST:
-		
 		break;
 	default:
 		break;
 	}
 }
-
-
-
#39 lore raw

PATCH 1/1 2.5.21 kill warnings 11/19

In reply to Linus Torvalds

irias_object missused __FUNCTION__ too.

net/irda/irias_object.c +50 -54
diff -urN linux-2.5.21/net/irda/irias_object.c linux/net/irda/irias_object.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      irias_object.c
  * Version:       0.3
  * Description:   IAS object database and functions
@@ -8,18 +8,18 @@
  * Created at:    Thu Oct  1 22:50:04 1998
  * Modified at:   Wed Dec 15 11:23:16 1999
  * Modified by:   Dag Brattli <[email protected]>
- * 
+ *
  *     Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
- *      
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
- *  
+ *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
- *     
+ *
  ********************************************************************/
 
 #include <linux/string.h>
@@ -47,7 +47,7 @@
 {
 	char *new_str;
 	int len;
-	
+
 	/* Check string */
 	if (str == NULL)
 		return NULL;
@@ -59,14 +59,14 @@
 	/* Allocate new string */
         new_str = kmalloc(len + 1, GFP_ATOMIC);
         if (new_str == NULL) {
-		WARNING(__FUNCTION__"(), Unable to kmalloc!\n");
+		WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 
 	/* Copy and truncate */
 	memcpy(new_str, str, len);
 	new_str[len] = '\0';
-	
+
 	return new_str;
 }
 
@@ -79,10 +79,10 @@
 struct ias_object *irias_new_object( char *name, int id)
 {
         struct ias_object *obj;
-	
+
 	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
 
-	obj = (struct ias_object *) kmalloc(sizeof(struct ias_object), 
+	obj = (struct ias_object *) kmalloc(sizeof(struct ias_object),
 					    GFP_ATOMIC);
 	if (obj == NULL) {
 		IRDA_DEBUG(0, __FUNCTION__ "(), Unable to allocate object!\n");
@@ -95,7 +95,7 @@
 	obj->id = id;
 
 	obj->attribs = hashbin_new(HB_LOCAL);
-	
+
 	return obj;
 }
 
@@ -115,7 +115,7 @@
 
 	irias_delete_value(attrib->value);
 	attrib->magic = ~IAS_ATTRIB_MAGIC;
-	
+
 	kfree(attrib);
 }
 
@@ -126,11 +126,11 @@
 
 	if (obj->name)
 		kfree(obj->name);
-	
+
 	hashbin_delete(obj->attribs, (FREE_FUNC) __irias_delete_attrib);
-	
+
 	obj->magic = ~IAS_OBJECT_MAGIC;
-	
+
 	kfree(obj);
 }
 
@@ -141,7 +141,7 @@
  *    with this object and the object itself
  *
  */
-int irias_delete_object(struct ias_object *obj) 
+int irias_delete_object(struct ias_object *obj)
 {
 	struct ias_object *node;
 
@@ -164,7 +164,7 @@
  *    the object, remove the object as well.
  *
  */
-int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib) 
+int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib)
 {
 	struct ias_attrib *node;
 
@@ -198,7 +198,7 @@
 {
 	ASSERT(obj != NULL, return;);
 	ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
-	
+
 	hashbin_insert(objects, (irda_queue_t *) obj, 0, obj->name);
 }
 
@@ -247,7 +247,7 @@
 {
 	ASSERT(obj != NULL, return;);
 	ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
-	
+
 	ASSERT(attrib != NULL, return;);
 	ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return;);
 
@@ -263,8 +263,8 @@
  *    Change the value of an objects attribute.
  *
  */
-int irias_object_change_attribute(char *obj_name, char *attrib_name, 
-				  struct ias_value *new_value) 
+int irias_object_change_attribute(char *obj_name, char *attrib_name,
+				  struct ias_value *new_value)
 {
 	struct ias_object *obj;
 	struct ias_attrib *attrib;
@@ -272,7 +272,7 @@
 	/* Find object */
 	obj = hashbin_find(objects, 0, obj_name);
 	if (obj == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to find object: %s\n",
+		WARNING("%s: Unable to find object: %s\n", __FUNCTION__,
 			obj_name);
 		return -1;
 	}
@@ -280,20 +280,20 @@
 	/* Find attribute */
 	attrib = hashbin_find(obj->attribs, 0, attrib_name);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to find attribute: %s\n",
+		WARNING("%s: Unable to find attribute: %s\n", __FUNCTION__,
 			attrib_name);
 		return -1;
 	}
-	
+
 	if ( attrib->value->type != new_value->type) {
-		IRDA_DEBUG( 0, __FUNCTION__ 
+		IRDA_DEBUG( 0, __FUNCTION__
 		       "(), changing value type not allowed!\n");
 		return -1;
 	}
 
 	/* Delete old value */
 	irias_delete_value(attrib->value);
-	
+
 	/* Insert new value */
 	attrib->value = new_value;
 
@@ -315,11 +315,11 @@
 	ASSERT(obj != NULL, return;);
 	ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
 	ASSERT(name != NULL, return;);
-	
-	attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), 
+
+	attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
 					       GFP_ATOMIC);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n");
+		WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
 		return;
 	}
 	memset(attrib, 0, sizeof( struct ias_attrib));
@@ -329,7 +329,7 @@
 
 	/* Insert value */
 	attrib->value = irias_new_integer_value(value);
-	
+
 	irias_add_attrib(obj, attrib, owner);
 }
 
@@ -344,27 +344,26 @@
 			     int len, int owner)
 {
 	struct ias_attrib *attrib;
-	
+
 	ASSERT(obj != NULL, return;);
 	ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
-	
+
 	ASSERT(name != NULL, return;);
 	ASSERT(octets != NULL, return;);
-	
-	attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), 
+
+	attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
 					       GFP_ATOMIC);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ 
-			"(), Unable to allocate attribute!\n");
+		WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
 		return;
 	}
 	memset(attrib, 0, sizeof( struct ias_attrib));
-	
+
 	attrib->magic = IAS_ATTRIB_MAGIC;
 	attrib->name = strndup(name, IAS_MAX_ATTRIBNAME);
-	
+
 	attrib->value = irias_new_octseq_value( octets, len);
-	
+
 	irias_add_attrib(obj, attrib, owner);
 }
 
@@ -384,11 +383,11 @@
 
 	ASSERT(name != NULL, return;);
 	ASSERT(value != NULL, return;);
-	
-	attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib), 
+
+	attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib),
 					       GFP_ATOMIC);
 	if (attrib == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n");
+		WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
 		return;
 	}
 	memset(attrib, 0, sizeof( struct ias_attrib));
@@ -413,7 +412,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(value, 0, sizeof(struct ias_value));
@@ -438,7 +437,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset( value, 0, sizeof( struct ias_value));
@@ -465,7 +464,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(value, 0, sizeof(struct ias_value));
@@ -478,7 +477,7 @@
 
 	value->t.oct_seq = kmalloc(len, GFP_ATOMIC);
 	if (value->t.oct_seq == NULL){
-		WARNING(__FUNCTION__"(), Unable to kmalloc!\n");
+		WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
 		kfree(value);
 		return NULL;
 	}
@@ -492,7 +491,7 @@
 
 	value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
 	if (value == NULL) {
-		WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
+		WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
 		return NULL;
 	}
 	memset(value, 0, sizeof(struct ias_value));
@@ -536,6 +535,3 @@
 	}
 	kfree(value);
 }
-
-
-
#40 lore raw

PATCH 1/1 2.5.21 kill warnings 12/19

In reply to Linus Torvalds

The irda people use shreddy editors saga continues.

net/irda/irlap.c +141 -152
diff -urN linux-2.5.21/net/irda/irlap.c linux/net/irda/irlap.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      irlap.c
  * Version:       1.0
  * Description:   IrLAP implementation for Linux
@@ -8,25 +8,25 @@
  * Created at:    Mon Aug  4 20:40:53 1997
  * Modified at:   Tue Dec 14 09:26:44 1999
  * Modified by:   Dag Brattli <[email protected]>
- * 
+ *
  *     Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
  *     Copyright (c) 2000-2001 Jean Tourrilhes <[email protected]>
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
- * 
+ *
  *     This program is distributed in the hope that it will be useful,
  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  *     GNU General Public License for more details.
- * 
- *     You should have received a copy of the GNU General Public License 
- *     along with this program; if not, write to the Free Software 
- *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  *     MA 02111-1307 USA
- *     
+ *
  ********************************************************************/
 
 #include <linux/config.h>
@@ -82,7 +82,7 @@
 	/* Allocate master array */
 	irlap = hashbin_new(HB_LOCAL);
 	if (irlap == NULL) {
-	        ERROR(__FUNCTION__ "(), can't allocate irlap hashbin!\n");
+	        ERROR("%s: can't allocate irlap hashbin!\n", __FUNCTION__);
 		return -ENOMEM;
 	}
 
@@ -108,12 +108,12 @@
 	struct irlap_cb *self;
 
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	/* Initialize the irlap structure. */
 	self = kmalloc(sizeof(struct irlap_cb), GFP_KERNEL);
 	if (self == NULL)
 		return NULL;
-	
+
 	memset(self, 0, sizeof(struct irlap_cb));
 	self->magic = LAP_MAGIC;
 
@@ -145,22 +145,22 @@
 	init_timer(&self->slot_timer);
 	init_timer(&self->query_timer);
 	init_timer(&self->discovery_timer);
-	init_timer(&self->final_timer);		
+	init_timer(&self->final_timer);
 	init_timer(&self->poll_timer);
 	init_timer(&self->wd_timer);
 	init_timer(&self->backoff_timer);
-	init_timer(&self->media_busy_timer);	
+	init_timer(&self->media_busy_timer);
 
 	irlap_apply_default_connection_parameters(self);
 
 	self->N3 = 3; /* # connections attemts to try before giving up */
-	
+
 	self->state = LAP_NDM;
 
 	hashbin_insert(irlap, (irda_queue_t *) self, self->saddr, NULL);
 
 	irlmp_register_link(self, self->saddr, &self->notify);
-	
+
 	return self;
 }
 
@@ -179,16 +179,16 @@
 	del_timer(&self->slot_timer);
 	del_timer(&self->query_timer);
 	del_timer(&self->discovery_timer);
-	del_timer(&self->final_timer);		
+	del_timer(&self->final_timer);
 	del_timer(&self->poll_timer);
 	del_timer(&self->wd_timer);
 	del_timer(&self->backoff_timer);
 	del_timer(&self->media_busy_timer);
 
 	irlap_flush_all_queues(self);
-       
+
 	self->magic = 0;
-	
+
 	kfree(self);
 }
 
@@ -198,12 +198,12 @@
  *    Remove IrLAP instance
  *
  */
-void irlap_close(struct irlap_cb *self) 
+void irlap_close(struct irlap_cb *self)
 {
 	struct irlap_cb *lap;
 
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
@@ -227,7 +227,7 @@
  *    Another device is attempting to make a connection
  *
  */
-void irlap_connect_indication(struct irlap_cb *self, struct sk_buff *skb) 
+void irlap_connect_indication(struct irlap_cb *self, struct sk_buff *skb)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
@@ -237,7 +237,7 @@
 	irlap_init_qos_capabilities(self, NULL); /* No user QoS! */
 
 	skb_get(skb); /*LEVEL4*/
-	irlmp_link_connect_indication(self->notify.instance, self->saddr, 
+	irlmp_link_connect_indication(self->notify.instance, self->saddr,
 				      self->daddr, &self->qos_tx, skb);
 }
 
@@ -247,10 +247,10 @@
  *    Service user has accepted incoming connection
  *
  */
-void irlap_connect_response(struct irlap_cb *self, struct sk_buff *skb) 
+void irlap_connect_response(struct irlap_cb *self, struct sk_buff *skb)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	irlap_do_event(self, CONNECT_RESPONSE, skb, NULL);
 	kfree_skb(skb);
 }
@@ -258,26 +258,26 @@
 /*
  * Function irlap_connect_request (self, daddr, qos_user, sniff)
  *
- *    Request connection with another device, sniffing is not implemented 
+ *    Request connection with another device, sniffing is not implemented
  *    yet.
  *
  */
-void irlap_connect_request(struct irlap_cb *self, __u32 daddr, 
-			   struct qos_info *qos_user, int sniff) 
+void irlap_connect_request(struct irlap_cb *self, __u32 daddr,
+			   struct qos_info *qos_user, int sniff)
 {
 	IRDA_DEBUG(3, __FUNCTION__ "(), daddr=0x%08x\n", daddr);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
- 	self->daddr = daddr;
-	
+	self->daddr = daddr;
+
 	/*
-	 *  If the service user specifies QoS values for this connection, 
+	 *  If the service user specifies QoS values for this connection,
 	 *  then use them
 	 */
 	irlap_init_qos_capabilities(self, qos_user);
-	
+
 	if ((self->state == LAP_NDM) && !self->media_busy)
 		irlap_do_event(self, CONNECT_REQUEST, NULL, NULL);
 	else
@@ -304,12 +304,12 @@
 /*
  * Function irlap_data_indication (self, skb)
  *
- *    Received data frames from IR-port, so we just pass them up to 
+ *    Received data frames from IR-port, so we just pass them up to
  *    IrLMP for further processing
  *
  */
 void irlap_data_indication(struct irlap_cb *self, struct sk_buff *skb,
-			   int unreliable) 
+			   int unreliable)
 {
 	/* Hide LAP header from IrLMP layer */
 	skb_pull(skb, LAP_ADDR_HEADER+LAP_CTRL_HEADER);
@@ -325,7 +325,7 @@
  *    Queue data for transmission, must wait until XMIT state
  *
  */
-void irlap_data_request(struct irlap_cb *self, struct sk_buff *skb, 
+void irlap_data_request(struct irlap_cb *self, struct sk_buff *skb,
 			int unreliable)
 {
 	ASSERT(self != NULL, return;);
@@ -333,12 +333,12 @@
 
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
 
-	ASSERT(skb_headroom(skb) >= (LAP_ADDR_HEADER+LAP_CTRL_HEADER), 
+	ASSERT(skb_headroom(skb) >= (LAP_ADDR_HEADER+LAP_CTRL_HEADER),
 	       return;);
 	skb_push(skb, LAP_ADDR_HEADER+LAP_CTRL_HEADER);
 
-	/*  
-	 *  Must set frame format now so that the rest of the code knows 
+	/*
+	 *  Must set frame format now so that the rest of the code knows
 	 *  if its dealing with an I or an UI frame
 	 */
 	if (unreliable)
@@ -349,11 +349,11 @@
 	/* Add at the end of the queue (keep ordering) - Jean II */
 	skb_queue_tail(&self->txq, skb);
 
-	/* 
-	 *  Send event if this frame only if we are in the right state 
+	/*
+	 *  Send event if this frame only if we are in the right state
 	 *  FIXME: udata should be sent first! (skb_queue_head?)
 	 */
-  	if ((self->state == LAP_XMIT_P) || (self->state == LAP_XMIT_S)) {
+	if ((self->state == LAP_XMIT_P) || (self->state == LAP_XMIT_S)) {
 		/* If we are not already processing the Tx queue, trigger
 		 * transmission immediately - Jean II */
 		if((skb_queue_len(&self->txq) <= 1) && (!self->local_busy))
@@ -377,7 +377,7 @@
 
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
 
-	ASSERT(skb_headroom(skb) >= (LAP_ADDR_HEADER+LAP_CTRL_HEADER), 
+	ASSERT(skb_headroom(skb) >= (LAP_ADDR_HEADER+LAP_CTRL_HEADER),
 	       return;);
 	skb_push(skb, LAP_ADDR_HEADER+LAP_CTRL_HEADER);
 
@@ -399,7 +399,7 @@
 #ifdef CONFIG_IRDA_ULTRA
 void irlap_unitdata_indication(struct irlap_cb *self, struct sk_buff *skb)
 {
-	IRDA_DEBUG(1, __FUNCTION__ "()\n"); 
+	IRDA_DEBUG(1, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
@@ -418,17 +418,17 @@
  *
  *    Request to disconnect connection by service user
  */
-void irlap_disconnect_request(struct irlap_cb *self) 
+void irlap_disconnect_request(struct irlap_cb *self)
 {
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
-	
+
 	/* Don't disconnect until all data frames are successfully sent */
 	if (skb_queue_len(&self->txq) > 0) {
 		self->disconnect_pending = TRUE;
-		
+
 		return;
 	}
 
@@ -436,9 +436,9 @@
 	switch (self->state) {
 	case LAP_XMIT_P:        /* FALLTROUGH */
 	case LAP_XMIT_S:        /* FALLTROUGH */
- 	case LAP_CONN:          /* FALLTROUGH */
- 	case LAP_RESET_WAIT:    /* FALLTROUGH */
- 	case LAP_RESET_CHECK:   
+	case LAP_CONN:          /* FALLTROUGH */
+	case LAP_RESET_WAIT:    /* FALLTROUGH */
+	case LAP_RESET_CHECK:
 		irlap_do_event(self, DISCONNECT_REQUEST, NULL, NULL);
 		break;
 	default:
@@ -454,30 +454,30 @@
  *    Disconnect request from other device
  *
  */
-void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason) 
+void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason)
 {
-	IRDA_DEBUG(1, __FUNCTION__ "(), reason=%s\n", lap_reasons[reason]); 
+	IRDA_DEBUG(1, __FUNCTION__ "(), reason=%s\n", lap_reasons[reason]);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
 	/* Flush queues */
 	irlap_flush_all_queues(self);
-	
+
 	switch (reason) {
 	case LAP_RESET_INDICATION:
 		IRDA_DEBUG(1, __FUNCTION__ "(), Sending reset request!\n");
 		irlap_do_event(self, RESET_REQUEST, NULL, NULL);
 		break;
-	case LAP_NO_RESPONSE:	   /* FALLTROUGH */	
+	case LAP_NO_RESPONSE:	   /* FALLTROUGH */
 	case LAP_DISC_INDICATION:  /* FALLTROUGH */
 	case LAP_FOUND_NONE:       /* FALLTROUGH */
 	case LAP_MEDIA_BUSY:
-		irlmp_link_disconnect_indication(self->notify.instance, self, 
+		irlmp_link_disconnect_indication(self->notify.instance, self,
 						 reason, NULL);
 		break;
 	default:
-		ERROR(__FUNCTION__ "(), Unknown reason %d\n", reason);
+		ERROR("%s: Unknown reason %d\n", __FUNCTION__, reason);
 	}
 }
 
@@ -487,23 +487,23 @@
  *    Start one single discovery operation.
  *
  */
-void irlap_discovery_request(struct irlap_cb *self, discovery_t *discovery) 
+void irlap_discovery_request(struct irlap_cb *self, discovery_t *discovery)
 {
 	struct irlap_info info;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 	ASSERT(discovery != NULL, return;);
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(), nslots = %d\n", discovery->nslots);
 
 	ASSERT((discovery->nslots == 1) || (discovery->nslots == 6) ||
-	       (discovery->nslots == 8) || (discovery->nslots == 16), 
+	       (discovery->nslots == 8) || (discovery->nslots == 16),
 	       return;);
-	
-  	/* Discovery is only possible in NDM mode */
+
+	/* Discovery is only possible in NDM mode */
 	if (self->state != LAP_NDM) {
-		IRDA_DEBUG(4, __FUNCTION__ 
+		IRDA_DEBUG(4, __FUNCTION__
 			   "(), discovery only possible in NDM mode\n");
 		irlap_discovery_confirm(self, NULL);
 		/* Note : in theory, if we are not in NDM, we could postpone
@@ -521,18 +521,18 @@
 		hashbin_delete(self->discovery_log, (FREE_FUNC) kfree);
 		self->discovery_log = NULL;
 	}
-	
+
 	self->discovery_log= hashbin_new(HB_LOCAL);
-	
+
 	info.S = discovery->nslots; /* Number of slots */
 	info.s = 0; /* Current slot */
-	
+
 	self->discovery_cmd = discovery;
 	info.discovery = discovery;
-	
+
 	/* sysctl_slot_timeout bounds are checked in irsysctl.c - Jean II */
 	self->slot_timeout = sysctl_slot_timeout * HZ / 1000;
-	
+
 	irlap_do_event(self, DISCOVERY_REQUEST, NULL, &info);
 }
 
@@ -542,15 +542,15 @@
  *    A device has been discovered in front of this station, we
  *    report directly to LMP.
  */
-void irlap_discovery_confirm(struct irlap_cb *self, hashbin_t *discovery_log) 
+void irlap_discovery_confirm(struct irlap_cb *self, hashbin_t *discovery_log)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
-	
+
 	ASSERT(self->notify.instance != NULL, return;);
-	
-	/* 
-	 * Check for successful discovery, since we are then allowed to clear 
+
+	/*
+	 * Check for successful discovery, since we are then allowed to clear
 	 * the media busy condition (IrLAP 6.13.4 - p.94). This should allow
 	 * us to make connection attempts much faster and easier (i.e. no
 	 * collisions).
@@ -562,7 +562,7 @@
 	 */
 	if (discovery_log)
 		irda_device_set_media_busy(self->netdev, FALSE);
-	
+
 	/* Inform IrLMP */
 	irlmp_link_discovery_confirm(self->notify.instance, discovery_log);
 }
@@ -573,7 +573,7 @@
  *    Somebody is trying to discover us!
  *
  */
-void irlap_discovery_indication(struct irlap_cb *self, discovery_t *discovery) 
+void irlap_discovery_indication(struct irlap_cb *self, discovery_t *discovery)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
@@ -599,11 +599,8 @@
 
 /*
  * Function irlap_status_indication (quality_of_link)
- *
- *    
- *
  */
-void irlap_status_indication(struct irlap_cb *self, int quality_of_link) 
+void irlap_status_indication(struct irlap_cb *self, int quality_of_link)
 {
 	switch (quality_of_link) {
 	case STATUS_NO_ACTIVITY:
@@ -621,9 +618,6 @@
 
 /*
  * Function irlap_reset_indication (void)
- *
- *    
- *
  */
 void irlap_reset_indication(struct irlap_cb *self)
 {
@@ -631,7 +625,7 @@
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
-	
+
 	if (self->state == LAP_RESET_WAIT)
 		irlap_do_event(self, RESET_REQUEST, NULL, NULL);
 	else
@@ -640,13 +634,10 @@
 
 /*
  * Function irlap_reset_confirm (void)
- *
- *    
- *
  */
 void irlap_reset_confirm(void)
 {
- 	IRDA_DEBUG(1, __FUNCTION__ "()\n");
+	IRDA_DEBUG(1, __FUNCTION__ "()\n");
 }
 
 /*
@@ -656,11 +647,11 @@
  *    S = Number of slots (0 -> S-1)
  *    s = Current slot
  */
-int irlap_generate_rand_time_slot(int S, int s) 
+int irlap_generate_rand_time_slot(int S, int s)
 {
 	static int rand;
 	int slot;
-	
+
 	ASSERT((S - s) > 0, return 0;);
 
 	rand += jiffies;
@@ -668,20 +659,20 @@
 	rand ^= (rand >> 20);
 
 	slot = s + rand % (S-s);
-	
+
 	ASSERT((slot >= s) || (slot < S), return 0;);
-	
+
 	return slot;
 }
 
 /*
  * Function irlap_update_nr_received (nr)
  *
- *    Remove all acknowledged frames in current window queue. This code is 
+ *    Remove all acknowledged frames in current window queue. This code is
  *    not intuitive and you should not try to change it. If you think it
  *    contains bugs, please mail a patch to the author instead.
  */
-void irlap_update_nr_received(struct irlap_cb *self, int nr) 
+void irlap_update_nr_received(struct irlap_cb *self, int nr)
 {
 	struct sk_buff *skb = NULL;
 	int count = 0;
@@ -690,7 +681,7 @@
          * Remove all the ack-ed frames from the window queue.
          */
 
-	/* 
+	/*
 	 *  Optimize for the common case. It is most likely that the receiver
 	 *  will acknowledge all the frames we have sent! So in that case we
 	 *  delete all frames stored in window.
@@ -703,17 +694,17 @@
 		self->va = nr - 1;
 	} else {
 		/* Remove all acknowledged frames in current window */
-		while ((skb_peek(&self->wx_list) != NULL) && 
-		       (((self->va+1) % 8) != nr)) 
+		while ((skb_peek(&self->wx_list) != NULL) &&
+		       (((self->va+1) % 8) != nr))
 		{
 			skb = skb_dequeue(&self->wx_list);
 			dev_kfree_skb(skb);
-			
+
 			self->va = (self->va + 1) % 8;
 			count++;
 		}
 	}
-	
+
 	/* Advance window */
 	self->window = self->window_size - skb_queue_len(&self->wx_list);
 }
@@ -723,7 +714,7 @@
  *
  *    Validate the next to send (ns) field from received frame.
  */
-int irlap_validate_ns_received(struct irlap_cb *self, int ns) 
+int irlap_validate_ns_received(struct irlap_cb *self, int ns)
 {
 	/*  ns as expected?  */
 	if (ns == self->vr)
@@ -733,7 +724,7 @@
 	 *  IrLAP, Recv ... with-invalid-Ns. p. 84
 	 */
 	return NS_UNEXPECTED;
-	
+
 	/* return NR_INVALID; */
 }
 /*
@@ -742,7 +733,7 @@
  *    Validate the next to receive (nr) field from received frame.
  *
  */
-int irlap_validate_nr_received(struct irlap_cb *self, int nr) 
+int irlap_validate_nr_received(struct irlap_cb *self, int nr)
 {
 	/*  nr as expected?  */
 	if (nr == self->vs) {
@@ -751,17 +742,17 @@
 	}
 
 	/*
-	 *  unexpected nr? (but within current window), first we check if the 
+	 *  unexpected nr? (but within current window), first we check if the
 	 *  ns numbers of the frames in the current window wrap.
 	 */
 	if (self->va < self->vs) {
 		if ((nr >= self->va) && (nr <= self->vs))
 			return NR_UNEXPECTED;
 	} else {
-		if ((nr >= self->va) || (nr <= self->vs)) 
+		if ((nr >= self->va) || (nr <= self->vs))
 			return NR_UNEXPECTED;
 	}
-	
+
 	/* Invalid nr!  */
 	return NR_INVALID;
 }
@@ -772,10 +763,10 @@
  *    Initialize the connection state parameters
  *
  */
-void irlap_initiate_connection_state(struct irlap_cb *self) 
+void irlap_initiate_connection_state(struct irlap_cb *self)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
@@ -799,11 +790,11 @@
  *    frame in order to delay for the specified amount of time. This is
  *    done to avoid using timers, and the forbidden udelay!
  */
-void irlap_wait_min_turn_around(struct irlap_cb *self, struct qos_info *qos) 
+void irlap_wait_min_turn_around(struct irlap_cb *self, struct qos_info *qos)
 {
 	__u32 min_turn_time;
 	__u32 speed;
-	
+
 	/* Get QoS values.  */
 	speed = qos->baud_rate.value;
 	min_turn_time = qos->min_turn_time.value;
@@ -813,10 +804,10 @@
 		self->mtt_required = min_turn_time;
 		return;
 	}
-	
-	/*  
+
+	/*
 	 *  Send additional BOF's for the next frame for the requested
-	 *  min turn time, so now we must calculate how many chars (XBOF's) we 
+	 *  min turn time, so now we must calculate how many chars (XBOF's) we
 	 *  must send for the requested time period (min turn time)
 	 */
 	self->xbofs_delay = irlap_min_turn_time_in_bytes(speed, min_turn_time);
@@ -828,7 +819,7 @@
  *    Flush all queues
  *
  */
-void irlap_flush_all_queues(struct irlap_cb *self) 
+void irlap_flush_all_queues(struct irlap_cb *self)
 {
 	struct sk_buff* skb;
 
@@ -838,7 +829,7 @@
 	/* Free transmission queue */
 	while ((skb = skb_dequeue(&self->txq)) != NULL)
 		dev_kfree_skb(skb);
-	
+
 	while ((skb = skb_dequeue(&self->txq_ultra)) != NULL)
 		dev_kfree_skb(skb);
 
@@ -894,7 +885,7 @@
 	irda_qos_compute_intersection(&self->qos_rx, self->qos_dev);
 
 	/*
-	 *  Check for user supplied QoS parameters. The service user is only 
+	 *  Check for user supplied QoS parameters. The service user is only
 	 *  allowed to supply these values. We check each parameter since the
 	 *  user may not have set all of them.
 	 */
@@ -926,7 +917,6 @@
  * Function irlap_apply_default_connection_parameters (void, now)
  *
  *    Use the default connection and transmission parameters
- * 
  */
 void irlap_apply_default_connection_parameters(struct irlap_cb *self)
 {
@@ -945,9 +935,9 @@
 	/* Set mbusy when going to NDM state */
 	irda_device_set_media_busy(self->netdev, TRUE);
 
-	/* 
+	/*
 	 * Generate random connection address for this session, which must
-	 * be 7 bits wide and different from 0x00 and 0xfe 
+	 * be 7 bits wide and different from 0x00 and 0xfe
 	 */
 	while ((self->caddr == 0x00) || (self->caddr == 0xfe)) {
 		get_random_bytes(&self->caddr, sizeof(self->caddr));
@@ -991,10 +981,10 @@
  * frame is sent.
  * If 'now' is true, the speed and xbofs is changed immediately
  */
-void irlap_apply_connection_parameters(struct irlap_cb *self, int now) 
+void irlap_apply_connection_parameters(struct irlap_cb *self, int now)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
@@ -1014,15 +1004,15 @@
 	 *  Calculate how many bytes it is possible to transmit before the
 	 *  link must be turned around
 	 */
-	self->line_capacity = 
+	self->line_capacity =
 		irlap_max_line_capacity(self->qos_tx.baud_rate.value,
 					self->qos_tx.max_turn_time.value);
 	self->bytes_left = self->line_capacity;
 #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
 
-	
-	/* 
-	 *  Initialize timeout values, some of the rules are listed on 
+
+	/*
+	 *  Initialize timeout values, some of the rules are listed on
 	 *  page 92 in IrLAP.
 	 */
 	ASSERT(self->qos_tx.max_turn_time.value != 0, return;);
@@ -1056,27 +1046,27 @@
 	 */
 
 	/*
-	 *  Set N1 to 0 if Link Disconnect/Threshold Time = 3 and set it to 
+	 *  Set N1 to 0 if Link Disconnect/Threshold Time = 3 and set it to
 	 *  3 seconds otherwise. See page 71 in IrLAP for more details.
 	 *  Actually, it's not always 3 seconds, as we allow to set
 	 *  it via sysctl... Max maxtt is 500ms, and N1 need to be multiple
 	 *  of 2, so 1 second is minimum we can allow. - Jean II
 	 */
 	if (self->qos_tx.link_disc_time.value == sysctl_warn_noreply_time)
-		/* 
+		/*
 		 * If we set N1 to 0, it will trigger immediately, which is
 		 * not what we want. What we really want is to disable it,
-		 * Jean II 
+		 * Jean II
 		 */
 		self->N1 = -2; /* Disable - Need to be multiple of 2*/
 	else
 		self->N1 = sysctl_warn_noreply_time * 1000 /
 		  self->qos_rx.max_turn_time.value;
-	
+
 	IRDA_DEBUG(4, "Setting N1 = %d\n", self->N1);
-	
+
 	/* Set N2 to match our own disconnect time */
-	self->N2 = self->qos_tx.link_disc_time.value * 1000 / 
+	self->N2 = self->qos_tx.link_disc_time.value * 1000 /
 		self->qos_rx.max_turn_time.value;
 	IRDA_DEBUG(4, "Setting N2 = %d\n", self->N2);
 }
@@ -1093,7 +1083,7 @@
 	struct irlap_cb *self;
 	unsigned long flags;
 	int i = 0;
-     
+
 	save_flags(flags);
 	cli();
 
@@ -1105,9 +1095,9 @@
 		ASSERT(self->magic == LAP_MAGIC, return -EBADR;);
 
 		len += sprintf(buf+len, "irlap%d ", i++);
-		len += sprintf(buf+len, "state: %s\n", 
+		len += sprintf(buf+len, "state: %s\n",
 			       irlap_state[self->state]);
-		
+
 		len += sprintf(buf+len, "  device name: %s, ",
 			       (self->netdev) ? self->netdev->name : "bug");
 		len += sprintf(buf+len, "hardware name: %s\n", self->hw_name);
@@ -1115,34 +1105,34 @@
 		len += sprintf(buf+len, "  caddr: %#02x, ", self->caddr);
 		len += sprintf(buf+len, "saddr: %#08x, ", self->saddr);
 		len += sprintf(buf+len, "daddr: %#08x\n", self->daddr);
-		
-		len += sprintf(buf+len, "  win size: %d, ", 
+
+		len += sprintf(buf+len, "  win size: %d, ",
 			       self->window_size);
 		len += sprintf(buf+len, "win: %d, ", self->window);
 #if CONFIG_IRDA_DYNAMIC_WINDOW
-		len += sprintf(buf+len, "line capacity: %d, ", 
+		len += sprintf(buf+len, "line capacity: %d, ",
 			       self->line_capacity);
 		len += sprintf(buf+len, "bytes left: %d\n", self->bytes_left);
 #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
-		len += sprintf(buf+len, "  tx queue len: %d ", 
+		len += sprintf(buf+len, "  tx queue len: %d ",
 			       skb_queue_len(&self->txq));
-		len += sprintf(buf+len, "win queue len: %d ", 
+		len += sprintf(buf+len, "win queue len: %d ",
 			       skb_queue_len(&self->wx_list));
 		len += sprintf(buf+len, "rbusy: %s", self->remote_busy ?
 			       "TRUE" : "FALSE");
 		len += sprintf(buf+len, " mbusy: %s\n", self->media_busy ?
 			       "TRUE" : "FALSE");
-		
+
 		len += sprintf(buf+len, "  retrans: %d ", self->retry_count);
 		len += sprintf(buf+len, "vs: %d ", self->vs);
 		len += sprintf(buf+len, "vr: %d ", self->vr);
 		len += sprintf(buf+len, "va: %d\n", self->va);
-		
+
 		len += sprintf(buf+len, "  qos\tbps\tmaxtt\tdsize\twinsize\taddbofs\tmintt\tldisc\tcomp\n");
-		
-		len += sprintf(buf+len, "  tx\t%d\t", 
+
+		len += sprintf(buf+len, "  tx\t%d\t",
 			       self->qos_tx.baud_rate.value);
-		len += sprintf(buf+len, "%d\t", 
+		len += sprintf(buf+len, "%d\t",
 			       self->qos_tx.max_turn_time.value);
 		len += sprintf(buf+len, "%d\t",
 			       self->qos_tx.data_size.value);
@@ -1150,15 +1140,15 @@
 			       self->qos_tx.window_size.value);
 		len += sprintf(buf+len, "%d\t",
 			       self->qos_tx.additional_bofs.value);
-		len += sprintf(buf+len, "%d\t", 
+		len += sprintf(buf+len, "%d\t",
 			       self->qos_tx.min_turn_time.value);
-		len += sprintf(buf+len, "%d\t", 
+		len += sprintf(buf+len, "%d\t",
 			       self->qos_tx.link_disc_time.value);
 		len += sprintf(buf+len, "\n");
 
-		len += sprintf(buf+len, "  rx\t%d\t", 
+		len += sprintf(buf+len, "  rx\t%d\t",
 			       self->qos_rx.baud_rate.value);
-		len += sprintf(buf+len, "%d\t", 
+		len += sprintf(buf+len, "%d\t",
 			       self->qos_rx.max_turn_time.value);
 		len += sprintf(buf+len, "%d\t",
 			       self->qos_rx.data_size.value);
@@ -1166,12 +1156,12 @@
 			       self->qos_rx.window_size.value);
 		len += sprintf(buf+len, "%d\t",
 			       self->qos_rx.additional_bofs.value);
-		len += sprintf(buf+len, "%d\t", 
+		len += sprintf(buf+len, "%d\t",
 			       self->qos_rx.min_turn_time.value);
-		len += sprintf(buf+len, "%d\t", 
+		len += sprintf(buf+len, "%d\t",
 			       self->qos_rx.link_disc_time.value);
 		len += sprintf(buf+len, "\n");
-		
+
 		self = (struct irlap_cb *) hashbin_get_next(irlap);
 	}
 	restore_flags(flags);
@@ -1180,4 +1170,3 @@
 }
 
 #endif /* CONFIG_PROC_FS */
-
#41 lore raw

PATCH 1/1 2.5.21 kill warnings 13/19

In reply to Linus Torvalds

irlap_event was abusing __FUNCTION__ too.

net/irda/irlap_event.c +319 -322
diff -urN linux-2.5.21/net/irda/irlap_event.c linux/net/irda/irlap_event.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      irlap_event.c
  * Version:       0.9
  * Description:   IrLAP state machine implementation
@@ -8,19 +8,19 @@
  * Created at:    Sat Aug 16 00:59:29 1997
  * Modified at:   Sat Dec 25 21:07:57 1999
  * Modified by:   Dag Brattli <[email protected]>
- * 
+ *
  *     Copyright (c) 1998-2000 Dag Brattli <[email protected]>,
  *     Copyright (c) 1998      Thomas Davis <[email protected]>
  *     All Rights Reserved.
  *     Copyright (c) 2000-2001 Jean Tourrilhes <[email protected]>
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
  ********************************************************************/
@@ -46,35 +46,35 @@
 int sysctl_fast_poll_increase = 50;
 #endif
 
-static int irlap_state_ndm    (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_ndm    (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_query  (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_query  (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_reply  (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_reply  (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_conn   (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_conn   (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_setup  (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_setup  (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_offline(struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_offline(struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_xmit_p (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_xmit_p (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_pclose (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_pclose (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_nrm_p  (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_nrm_p  (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_reset_wait(struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_reset_wait(struct irlap_cb *self, IRLAP_EVENT event,
 				  struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_reset  (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_reset  (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_nrm_s  (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_nrm_s  (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_xmit_s (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_xmit_s (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_sclose (struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_sclose (struct irlap_cb *self, IRLAP_EVENT event,
 			       struct sk_buff *skb, struct irlap_info *info);
-static int irlap_state_reset_check(struct irlap_cb *, IRLAP_EVENT event, 
+static int irlap_state_reset_check(struct irlap_cb *, IRLAP_EVENT event,
 				   struct sk_buff *, struct irlap_info *);
 
 #ifdef CONFIG_IRDA_DEBUG
@@ -138,8 +138,8 @@
 	"LAP_RESET_CHECK",
 };
 
-static int (*state[])(struct irlap_cb *self, IRLAP_EVENT event, 
-		      struct sk_buff *skb, struct irlap_info *info) = 
+static int (*state[])(struct irlap_cb *self, IRLAP_EVENT event,
+		      struct sk_buff *skb, struct irlap_info *info) =
 {
 	irlap_state_ndm,
 	irlap_state_query,
@@ -167,10 +167,10 @@
 static void irlap_poll_timer_expired(void *data)
 {
 	struct irlap_cb *self = (struct irlap_cb *) data;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
-	
+
 	irlap_do_event(self, POLL_TIMER_EXPIRED, NULL, NULL);
 }
 
@@ -186,7 +186,7 @@
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
 #ifdef CONFIG_IRDA_FAST_RR
-	/* 
+	/*
 	 * Send out the RR frames faster if our own transmit queue is empty, or
 	 * if the peer is busy. The effect is a much faster conversation
 	 */
@@ -201,7 +201,7 @@
 				 *  FIXME: this should be a more configurable
 				 *         function
 				 */
-				self->fast_RR_timeout += 
+				self->fast_RR_timeout +=
 					(sysctl_fast_poll_increase * HZ/1000);
 
 				/* Use this fast(er) timeout instead */
@@ -223,7 +223,7 @@
 	if (timeout == 0)
 		irlap_do_event(self, POLL_TIMER_EXPIRED, NULL, NULL);
 	else
-		irda_start_timer(&self->poll_timer, timeout, self, 
+		irda_start_timer(&self->poll_timer, timeout, self,
 				 irlap_poll_timer_expired);
 }
 
@@ -231,28 +231,28 @@
  * Function irlap_do_event (event, skb, info)
  *
  *    Rushes through the state machine without any delay. If state == XMIT
- *    then send queued data frames. 
+ *    then send queued data frames.
  */
-void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, 
-		    struct sk_buff *skb, struct irlap_info *info) 
+void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event,
+		    struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret;
-	
+
 	if (!self || self->magic != LAP_MAGIC)
 		return;
 
-  	IRDA_DEBUG(3, __FUNCTION__ "(), event = %s, state = %s\n", 
-		   irlap_event[event], irlap_state[self->state]); 
-	
+	IRDA_DEBUG(3, __FUNCTION__ "(), event = %s, state = %s\n",
+		   irlap_event[event], irlap_state[self->state]);
+
 	ret = (*state[self->state])(self, event, skb, info);
 
-	/* 
+	/*
 	 *  Check if there are any pending events that needs to be executed
 	 */
 	switch (self->state) {
 	case LAP_XMIT_P: /* FALLTHROUGH */
 	case LAP_XMIT_S:
-		/* 
+		/*
 		 * We just received the pf bit and are at the beginning
 		 * of a new LAP transmit window.
 		 * Check if there are any queued data frames, and do not
@@ -299,15 +299,15 @@
 			self->local_busy = FALSE;
 		} else if (self->disconnect_pending) {
 			self->disconnect_pending = FALSE;
-			
+
 			ret = (*state[self->state])(self, DISCONNECT_REQUEST,
 						    NULL, NULL);
 		}
 		break;
 /*	case LAP_NDM: */
-/* 	case LAP_CONN: */
-/* 	case LAP_RESET_WAIT: */
-/* 	case LAP_RESET_CHECK: */
+/*	case LAP_CONN: */
+/*	case LAP_RESET_WAIT: */
+/*	case LAP_RESET_CHECK: */
 	default:
 		break;
 	}
@@ -319,12 +319,12 @@
  *    Switches state and provides debug information
  *
  */
-static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state) 
-{	
+static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state)
+{
 	/*
 	if (!self || self->magic != LAP_MAGIC)
 		return;
-	
+
 	IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]);
 	*/
 	self->state = state;
@@ -336,8 +336,8 @@
  *    NDM (Normal Disconnected Mode) state
  *
  */
-static int irlap_state_ndm(struct irlap_cb *self, IRLAP_EVENT event, 
-			   struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_ndm(struct irlap_cb *self, IRLAP_EVENT event,
+			   struct sk_buff *skb, struct irlap_info *info)
 {
 	discovery_t *discovery_rsp;
 	int ret = 0;
@@ -355,14 +355,14 @@
 			 * postpone the event... - Jean II */
 			IRDA_DEBUG(0, __FUNCTION__
 				   "(), CONNECT_REQUEST: media busy!\n");
-			
+
 			/* Always switch state before calling upper layers */
 			irlap_next_state(self, LAP_NDM);
-			
+
 			irlap_disconnect_indication(self, LAP_MEDIA_BUSY);
 		} else {
 			irlap_send_snrm_frame(self, &self->qos_rx);
-			
+
 			/* Start Final-bit timer */
 			irlap_start_final_timer(self, self->final_timeout);
 
@@ -372,10 +372,10 @@
 		break;
 	case RECV_SNRM_CMD:
 		/* Check if the frame contains and I field */
-		if (info) {		       
+		if (info) {
 			self->daddr = info->daddr;
 			self->caddr = info->caddr;
-			
+
 			irlap_next_state(self, LAP_CONN);
 
 			irlap_connect_indication(self, skb);
@@ -384,21 +384,21 @@
 				   "contain an I field!\n");
 		}
 		break;
-	case DISCOVERY_REQUEST:		
+	case DISCOVERY_REQUEST:
 		ASSERT(info != NULL, return -1;);
 
-	 	if (self->media_busy) {
- 			IRDA_DEBUG(0, __FUNCTION__ "(), media busy!\n"); 
+		if (self->media_busy) {
+			IRDA_DEBUG(0, __FUNCTION__ "(), media busy!\n");
 			/* irlap->log.condition = MEDIA_BUSY; */
-						
+
 			/* This will make IrLMP try again */
- 			irlap_discovery_confirm(self, NULL);
+			irlap_discovery_confirm(self, NULL);
 			/* Note : the discovery log is not cleaned up here,
 			 * it will be done in irlap_discovery_request()
 			 * Jean II */
 			return 0;
-	 	} 
-		
+		}
+
 		self->S = info->S;
 		self->s = info->s;
 		irlap_send_discovery_xid_frame(self, info->S, info->s, TRUE,
@@ -419,17 +419,17 @@
 			if (self->slot == info->s) {
 				discovery_rsp = irlmp_get_discovery_response();
 				discovery_rsp->daddr = info->daddr;
-				
-				irlap_send_discovery_xid_frame(self, info->S, 
-							       self->slot, 
+
+				irlap_send_discovery_xid_frame(self, info->S,
+							       self->slot,
 							       FALSE,
 							       discovery_rsp);
 				self->frame_sent = TRUE;
 			} else
 				self->frame_sent = FALSE;
-			
-			/* 
-			 * Remember to multiply the query timeout value with 
+
+			/*
+			 * Remember to multiply the query timeout value with
 			 * the number of slots used
 			 */
 			irlap_start_query_timer(self, QUERY_TIMEOUT*info->S);
@@ -453,7 +453,7 @@
 			IRDA_DEBUG(1, __FUNCTION__ "(), Receiving final discovery request, missed the discovery slots :-(\n");
 
 			/* Last discovery request -> in the log */
-			irlap_discovery_indication(self, info->discovery); 
+			irlap_discovery_indication(self, info->discovery);
 		}
 		break;
 	case MEDIA_BUSY_TIMER_EXPIRED:
@@ -472,7 +472,7 @@
 			/* We don't send the frame, just post an event.
 			 * Also, previously this code was in timer.c...
 			 * Jean II */
-			ret = (*state[self->state])(self, SEND_UI_FRAME, 
+			ret = (*state[self->state])(self, SEND_UI_FRAME,
 						    NULL, NULL);
 		}
 #endif /* CONFIG_IRDA_ULTRA */
@@ -488,7 +488,7 @@
 				irlap_disconnect_indication(self, LAP_DISC_INDICATION);
 			else
 				ret = (*state[self->state])(self,
-							    CONNECT_REQUEST, 
+							    CONNECT_REQUEST,
 							    NULL, NULL);
 			self->disconnect_pending = FALSE;
 		}
@@ -506,13 +506,13 @@
 		break;
 #ifdef CONFIG_IRDA_ULTRA
 	case SEND_UI_FRAME:
-	{   
+	{
 		int i;
 		/* Only allowed to repeat an operation twice */
 		for (i=0; ((i<2) && (self->media_busy == FALSE)); i++) {
 			skb = skb_dequeue(&self->txq_ultra);
 			if (skb)
-				irlap_send_ui_frame(self, skb, CBROADCAST, 
+				irlap_send_ui_frame(self, skb, CBROADCAST,
 						    CMD_FRAME);
 			else
 				break;
@@ -526,7 +526,7 @@
 	case RECV_UI_FRAME:
 		/* Only accept broadcast frames in NDM mode */
 		if (info->caddr != CBROADCAST) {
-			IRDA_DEBUG(0, __FUNCTION__ 
+			IRDA_DEBUG(0, __FUNCTION__
 				   "(), not a broadcast frame!\n");
 		} else
 			irlap_unitdata_indication(self, skb);
@@ -536,7 +536,7 @@
 		/* Remove test frame header */
 		skb_pull(skb, sizeof(struct test_frame));
 
-		/* 
+		/*
 		 * Send response. This skb will not be sent out again, and
 		 * will only be used to send out the same info as the cmd
 		 */
@@ -546,12 +546,12 @@
 		IRDA_DEBUG(0, __FUNCTION__ "() not implemented!\n");
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n",
 			   irlap_event[event]);
-		
+
 		ret = -1;
 		break;
-	}	
+	}
 	return ret;
 }
 
@@ -561,8 +561,8 @@
  *    QUERY state
  *
  */
-static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event, 
-			     struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event,
+			     struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
 
@@ -574,16 +574,16 @@
 		ASSERT(info != NULL, return -1;);
 		ASSERT(info->discovery != NULL, return -1;);
 
-		IRDA_DEBUG(4, __FUNCTION__ "(), daddr=%08x\n", 
+		IRDA_DEBUG(4, __FUNCTION__ "(), daddr=%08x\n",
 			   info->discovery->daddr);
 
 		if (!self->discovery_log) {
-			WARNING(__FUNCTION__ "(), discovery log is gone! "
+			WARNING("%s: discovery log is gone! "
 				"maybe the discovery timeout has been set to "
-				"short?\n");
+				"short?\n", __FUNCTION__);
 			break;
 		}
-		hashbin_insert(self->discovery_log, 
+		hashbin_insert(self->discovery_log,
 			       (irda_queue_t *) info->discovery,
 			       info->discovery->daddr, NULL);
 
@@ -609,17 +609,17 @@
 
 		/* Last discovery request ? */
 		if (info->s == 0xff)
-			irlap_discovery_indication(self, info->discovery); 
+			irlap_discovery_indication(self, info->discovery);
 		break;
 	case SLOT_TIMER_EXPIRED:
 		/*
 		 * Wait a little longer if we detect an incoming frame. This
-		 * is not mentioned in the spec, but is a good thing to do, 
+		 * is not mentioned in the spec, but is a good thing to do,
 		 * since we want to work even with devices that violate the
 		 * timing requirements.
 		 */
 		if (irda_device_is_receiving(self->netdev) && !self->add_wait) {
-			IRDA_DEBUG(2, __FUNCTION__ 
+			IRDA_DEBUG(2, __FUNCTION__
 				   "(), device is slow to answer, "
 				   "waiting some more!\n");
 			irlap_start_slot_timer(self, MSECS_TO_JIFFIES(10));
@@ -629,25 +629,25 @@
 		self->add_wait = FALSE;
 
 		if (self->s < self->S) {
-			irlap_send_discovery_xid_frame(self, self->S, 
+			irlap_send_discovery_xid_frame(self, self->S,
 						       self->s, TRUE,
 						       self->discovery_cmd);
 			self->s++;
 			irlap_start_slot_timer(self, self->slot_timeout);
-			
+
 			/* Keep state */
 			irlap_next_state(self, LAP_QUERY);
 		} else {
 			/* This is the final slot! */
-			irlap_send_discovery_xid_frame(self, self->S, 0xff, 
+			irlap_send_discovery_xid_frame(self, self->S, 0xff,
 						       TRUE,
 						       self->discovery_cmd);
 
 			/* Always switch state before calling upper layers */
 			irlap_next_state(self, LAP_NDM);
-	
+
 			/*
-			 *  We are now finished with the discovery procedure, 
+			 *  We are now finished with the discovery procedure,
 			 *  so now we must return the results
 			 */
 			irlap_discovery_confirm(self, self->discovery_log);
@@ -657,7 +657,7 @@
 		}
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n",
 			   irlap_event[event]);
 
 		ret = -1;
@@ -671,10 +671,10 @@
  *
  *    REPLY, we have received a XID discovery frame from a device and we
  *    are waiting for the right time slot to send a response XID frame
- * 
+ *
  */
-static int irlap_state_reply(struct irlap_cb *self, IRLAP_EVENT event, 
-			     struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_reply(struct irlap_cb *self, IRLAP_EVENT event,
+			     struct sk_buff *skb, struct irlap_info *info)
 {
 	discovery_t *discovery_rsp;
 	int ret=0;
@@ -695,13 +695,13 @@
 		/* Last frame? */
 		if (info->s == 0xff) {
 			del_timer(&self->query_timer);
-			
+
 			/* info->log.condition = REMOTE; */
 
 			/* Always switch state before calling upper layers */
 			irlap_next_state(self, LAP_NDM);
 
-			irlap_discovery_indication(self, info->discovery); 
+			irlap_discovery_indication(self, info->discovery);
 		} else if ((info->s >= self->slot) && (!self->frame_sent)) {
 			discovery_rsp = irlmp_get_discovery_response();
 			discovery_rsp->daddr = info->daddr;
@@ -709,7 +709,7 @@
 			irlap_send_discovery_xid_frame(self, info->S,
 						       self->slot, FALSE,
 						       discovery_rsp);
-			
+
 			self->frame_sent = TRUE;
 			irlap_next_state(self, LAP_REPLY);
 		}
@@ -728,11 +728,11 @@
  * Function irlap_state_conn (event, skb, info)
  *
  *    CONN, we have received a SNRM command and is waiting for the upper
- *    layer to accept or refuse connection 
+ *    layer to accept or refuse connection
  *
  */
-static int irlap_state_conn(struct irlap_cb *self, IRLAP_EVENT event, 
-			    struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_conn(struct irlap_cb *self, IRLAP_EVENT event,
+			    struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
 
@@ -751,20 +751,20 @@
 
 		irlap_initiate_connection_state(self);
 
-		/* 
+		/*
 		 * Applying the parameters now will make sure we change speed
 		 * *after* we have sent the next frame
 		 */
 		irlap_apply_connection_parameters(self, FALSE);
 
-		/* 
+		/*
 		 * Sending this frame will force a speed change after it has
 		 * been sent (i.e. the frame will be sent at 9600).
 		 */
 		irlap_send_ua_response_frame(self, &self->qos_rx);
 
 #if 0
-		/* 
+		/*
 		 * We are allowed to send two frames, but this may increase
 		 * the connect latency, so lets not do it for now.
 		 */
@@ -787,20 +787,20 @@
 #endif
 
 		/*
-		 *  The WD-timer could be set to the duration of the P-timer 
-		 *  for this case, but it is recommended to use twice the 
-		 *  value (note 3 IrLAP p. 60). 
+		 *  The WD-timer could be set to the duration of the P-timer
+		 *  for this case, but it is recommended to use twice the
+		 *  value (note 3 IrLAP p. 60).
 		 */
 		irlap_start_wd_timer(self, self->wd_timeout);
 		irlap_next_state(self, LAP_NRM_S);
 
 		break;
 	case RECV_DISCOVERY_XID_CMD:
-		IRDA_DEBUG(3, __FUNCTION__ 
+		IRDA_DEBUG(3, __FUNCTION__
 			   "(), event RECV_DISCOVER_XID_CMD!\n");
 		irlap_next_state(self, LAP_NDM);
 
-		break;		
+		break;
 	case DISCONNECT_REQUEST:
 		IRDA_DEBUG(0, __FUNCTION__ "(), Disconnect request!\n");
 		irlap_send_dm_frame(self);
@@ -810,11 +810,11 @@
 	default:
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event,
 			   irlap_event[event]);
-		
+
 		ret = -1;
 		break;
 	}
-	
+
 	return ret;
 }
 
@@ -825,26 +825,26 @@
  *    a remote peer layer and is awaiting a reply .
  *
  */
-static int irlap_state_setup(struct irlap_cb *self, IRLAP_EVENT event, 
-			     struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_setup(struct irlap_cb *self, IRLAP_EVENT event,
+			     struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
 
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
 
 	switch (event) {
 	case FINAL_TIMER_EXPIRED:
 		if (self->retry_count < self->N3) {
-/* 
- *  Perform random backoff, Wait a random number of time units, minimum 
- *  duration half the time taken to transmitt a SNRM frame, maximum duration 
- *  1.5 times the time taken to transmit a SNRM frame. So this time should 
+/*
+ *  Perform random backoff, Wait a random number of time units, minimum
+ *  duration half the time taken to transmitt a SNRM frame, maximum duration
+ *  1.5 times the time taken to transmit a SNRM frame. So this time should
  *  between 15 msecs and 45 msecs.
  */
-			irlap_start_backoff_timer(self, MSECS_TO_JIFFIES(20 + 
+			irlap_start_backoff_timer(self, MSECS_TO_JIFFIES(20 +
 						        (jiffies % 30)));
 		} else {
 			/* Always switch state before calling upper layers */
@@ -877,18 +877,18 @@
 			skb_pull(skb, sizeof(struct snrm_frame));
 
 			irlap_qos_negotiate(self, skb);
-			
+
 			/* Send UA frame and then change link settings */
 			irlap_apply_connection_parameters(self, FALSE);
 			irlap_send_ua_response_frame(self, &self->qos_rx);
 
 			irlap_next_state(self, LAP_NRM_S);
 			irlap_connect_confirm(self, skb);
-			
-			/* 
+
+			/*
 			 *  The WD-timer could be set to the duration of the
 			 *  P-timer for this case, but it is recommended
-			 *  to use twice the value (note 3 IrLAP p. 60).  
+			 *  to use twice the value (note 3 IrLAP p. 60).
 			 */
 			irlap_start_wd_timer(self, self->wd_timeout);
 		} else {
@@ -915,7 +915,7 @@
 		/* Set the new link setting *now* (before the rr frame) */
 		irlap_apply_connection_parameters(self, TRUE);
 		self->retry_count = 0;
-		
+
 		/* Wait for turnaround time to give a chance to the other
 		 * device to be ready to receive us.
 		 * Note : the time to switch speed is typically larger
@@ -933,7 +933,7 @@
 		irlap_connect_confirm(self, skb);
 		break;
 	case RECV_DM_RSP:     /* FALLTHROUGH */
-	case RECV_DISC_CMD: 
+	case RECV_DISC_CMD:
 		del_timer(&self->final_timer);
 		irlap_next_state(self, LAP_NDM);
 
@@ -941,11 +941,11 @@
 		break;
 	default:
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event,
-			   irlap_event[event]);		
+			   irlap_event[event]);
 
 		ret = -1;
 		break;
-	}	
+	}
 	return ret;
 }
 
@@ -955,8 +955,8 @@
  *    OFFLINE state, not used for now!
  *
  */
-static int irlap_state_offline(struct irlap_cb *self, IRLAP_EVENT event, 
-			       struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_offline(struct irlap_cb *self, IRLAP_EVENT event,
+			       struct sk_buff *skb, struct irlap_info *info)
 {
 	IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown event\n");
 
@@ -965,31 +965,31 @@
 
 /*
  * Function irlap_state_xmit_p (self, event, skb, info)
- * 
+ *
  *    XMIT, Only the primary station has right to transmit, and we
  *    therefore do not expect to receive any transmissions from other
  *    stations.
- * 
+ *
  */
-static int irlap_state_xmit_p(struct irlap_cb *self, IRLAP_EVENT event, 
-			      struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_xmit_p(struct irlap_cb *self, IRLAP_EVENT event,
+			      struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
-	
+
 	switch (event) {
 	case SEND_I_CMD:
 		/*
 		 *  Only send frame if send-window > 0.
-		 */ 
+		 */
 		if ((self->window > 0) && (!self->remote_busy)) {
 #ifdef CONFIG_IRDA_DYNAMIC_WINDOW
 			/*
-			 *  Test if we have transmitted more bytes over the 
-			 *  link than its possible to do with the current 
+			 *  Test if we have transmitted more bytes over the
+			 *  link than its possible to do with the current
 			 *  speed and turn-around-time.
 			 */
 			if (skb->len > self->bytes_left) {
-				IRDA_DEBUG(4, __FUNCTION__ 
+				IRDA_DEBUG(4, __FUNCTION__
 					   "(), Not allowed to transmit more "
 					   "bytes!\n");
 				skb_queue_head(&self->txq, skb_get(skb));
@@ -1009,18 +1009,18 @@
 			 *  Send data with poll bit cleared only if window > 1
 			 *  and there is more frames after this one to be sent
 			 */
-			if ((self->window > 1) && 
-			    skb_queue_len( &self->txq) > 0) 
-			{   
+			if ((self->window > 1) &&
+			    skb_queue_len( &self->txq) > 0)
+			{
 				irlap_send_data_primary(self, skb);
 				irlap_next_state(self, LAP_XMIT_P);
 			} else {
 				irlap_send_data_primary_poll(self, skb);
 				irlap_next_state(self, LAP_NRM_P);
-				
-				/* 
+
+				/*
 				 * Make sure state machine does not try to send
-				 * any more frames 
+				 * any more frames
 				 */
 				ret = -EPROTO;
 			}
@@ -1029,12 +1029,12 @@
 			self->fast_RR = FALSE;
 #endif /* CONFIG_IRDA_FAST_RR */
 		} else {
-			IRDA_DEBUG(4, __FUNCTION__ 
+			IRDA_DEBUG(4, __FUNCTION__
 				   "(), Unable to send! remote busy?\n");
 			skb_queue_head(&self->txq, skb_get(skb));
 
 			/*
-			 *  The next ret is important, because it tells 
+			 *  The next ret is important, because it tells
 			 *  irlap_next_state _not_ to deliver more frames
 			 */
 			ret = -EPROTO;
@@ -1067,7 +1067,7 @@
 		 * when we return... - Jean II */
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlap_event[event]);
 
 		ret = -EINVAL;
@@ -1081,15 +1081,15 @@
  *
  *    PCLOSE state
  */
-static int irlap_state_pclose(struct irlap_cb *self, IRLAP_EVENT event, 
-			      struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_pclose(struct irlap_cb *self, IRLAP_EVENT event,
+			      struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
 
 	IRDA_DEBUG(1, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return -1;);
-	ASSERT(self->magic == LAP_MAGIC, return -1;);	
+	ASSERT(self->magic == LAP_MAGIC, return -1;);
 
 	switch (event) {
 	case RECV_UA_RSP: /* FALLTHROUGH */
@@ -1101,7 +1101,7 @@
 
 		/* Always switch state before calling upper layers */
 		irlap_next_state(self, LAP_NDM);
-		
+
 		irlap_disconnect_indication(self, LAP_DISC_INDICATION);
 		break;
 	case FINAL_TIMER_EXPIRED:
@@ -1124,7 +1124,7 @@
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d\n", event);
 
 		ret = -1;
-		break;	
+		break;
 	}
 	return ret;
 }
@@ -1138,8 +1138,8 @@
  *   transmit any frames and is expecting to receive frames only from the
  *   secondary to which transmission permissions has been given.
  */
-static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event, 
-			     struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event,
+			     struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
 	int ns_status;
@@ -1149,7 +1149,7 @@
 	case RECV_I_RSP: /* Optimize for the common case */
 		/* FIXME: must check for remote_busy below */
 #ifdef CONFIG_IRDA_FAST_RR
-		/* 
+		/*
 		 *  Reset the fast_RR so we can use the fast RR code with
 		 *  full speed the next time since peer may have more frames
 		 *  to transmitt
@@ -1161,19 +1161,19 @@
 		ns_status = irlap_validate_ns_received(self, info->ns);
 		nr_status = irlap_validate_nr_received(self, info->nr);
 
-		/* 
+		/*
 		 *  Check for expected I(nformation) frame
 		 */
 		if ((ns_status == NS_EXPECTED) && (nr_status == NR_EXPECTED)) {
 			/*  poll bit cleared?  */
 			if (!info->pf) {
 				self->vr = (self->vr + 1) % 8;
-			
+
 				/* Update Nr received */
 				irlap_update_nr_received( self, info->nr);
-				
+
 				self->ack_required = TRUE;
-				
+
 				/* Keep state, do not move this line */
 				irlap_next_state(self, LAP_NRM_P);
 
@@ -1182,18 +1182,18 @@
 				del_timer(&self->final_timer);
 
 				self->vr = (self->vr + 1) % 8;
-			
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-		
-				/*  
+
+				/*
 				 *  Got expected NR, so reset the
 				 *  retry_count. This is not done by IrLAP,
-				 *  which is strange!  
+				 *  which is strange!
 				 */
 				self->retry_count = 0;
 				self->ack_required = TRUE;
-			
+
 				irlap_wait_min_turn_around(self, &self->qos_tx);
 
 				/* Call higher layer *before* changing state
@@ -1218,16 +1218,16 @@
 				irlap_start_poll_timer(self, self->poll_timeout);
 			}
 			break;
-			
+
 		}
 		/* Unexpected next to send (Ns) */
 		if ((ns_status == NS_UNEXPECTED) && (nr_status == NR_EXPECTED))
 		{
 			if (!info->pf) {
 				irlap_update_nr_received(self, info->nr);
-				
+
 				/*
-				 *  Wait until the last frame before doing 
+				 *  Wait until the last frame before doing
 				 *  anything
 				 */
 
@@ -1236,57 +1236,57 @@
 			} else {
 				IRDA_DEBUG(4, __FUNCTION__
 				       "(), missing or duplicate frame!\n");
-				
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-				
+
 				irlap_wait_min_turn_around(self, &self->qos_tx);
 				irlap_send_rr_frame(self, CMD_FRAME);
-				
+
 				self->ack_required = FALSE;
-			
+
 				irlap_start_final_timer(self, self->final_timeout);
 				irlap_next_state(self, LAP_NRM_P);
 			}
 			break;
 		}
-		/* 
-		 *  Unexpected next to receive (Nr) 
+		/*
+		 *  Unexpected next to receive (Nr)
 		 */
 		if ((ns_status == NS_EXPECTED) && (nr_status == NR_UNEXPECTED))
 		{
 			if (info->pf) {
 				self->vr = (self->vr + 1) % 8;
-			
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-			
+
 				/* Resend rejected frames */
 				irlap_resend_rejected_frames(self, CMD_FRAME);
-				
+
 				self->ack_required = FALSE;
 				irlap_start_final_timer(self, self->final_timeout);
-				
+
 				/* Keep state, do not move this line */
 				irlap_next_state(self, LAP_NRM_P);
 
 				irlap_data_indication(self, skb, FALSE);
 			} else {
-				/* 
+				/*
 				 *  Do not resend frames until the last
 				 *  frame has arrived from the other
 				 *  device. This is not documented in
-				 *  IrLAP!!  
+				 *  IrLAP!!
 				 */
 				self->vr = (self->vr + 1) % 8;
 
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-				
+
 				self->ack_required = FALSE;
 
 				/* Keep state, do not move this line!*/
-				irlap_next_state(self, LAP_NRM_P); 
+				irlap_next_state(self, LAP_NRM_P);
 
 				irlap_data_indication(self, skb, FALSE);
 			}
@@ -1296,15 +1296,15 @@
 		 *  Unexpected next to send (Ns) and next to receive (Nr)
 		 *  Not documented by IrLAP!
 		 */
-		if ((ns_status == NS_UNEXPECTED) && 
-		    (nr_status == NR_UNEXPECTED)) 
+		if ((ns_status == NS_UNEXPECTED) &&
+		    (nr_status == NR_UNEXPECTED))
 		{
-			IRDA_DEBUG(4, __FUNCTION__ 
+			IRDA_DEBUG(4, __FUNCTION__
 				   "(), unexpected nr and ns!\n");
 			if (info->pf) {
 				/* Resend rejected frames */
 				irlap_resend_rejected_frames(self, CMD_FRAME);
-				
+
 				/* Give peer some time to retransmit! */
 				irlap_start_final_timer(self, self->final_timeout);
 
@@ -1313,7 +1313,7 @@
 			} else {
 				/* Update Nr received */
 				/* irlap_update_nr_received( info->nr); */
-				
+
 				self->ack_required = FALSE;
 			}
 			break;
@@ -1325,23 +1325,23 @@
 		if ((nr_status == NR_INVALID) || (ns_status == NS_INVALID)) {
 			if (info->pf) {
 				del_timer(&self->final_timer);
-				
+
 				irlap_next_state(self, LAP_RESET_WAIT);
-				
+
 				irlap_disconnect_indication(self, LAP_RESET_INDICATION);
 				self->xmitflag = TRUE;
 			} else {
 				del_timer(&self->final_timer);
-				
+
 				irlap_disconnect_indication(self, LAP_RESET_INDICATION);
-				
+
 				self->xmitflag = FALSE;
 			}
 			break;
 		}
 		IRDA_DEBUG(1, __FUNCTION__ "(), Not implemented!\n");
-		IRDA_DEBUG(1, __FUNCTION__ 
-		      "(), event=%s, ns_status=%d, nr_status=%d\n", 
+		IRDA_DEBUG(1, __FUNCTION__
+		      "(), event=%s, ns_status=%d, nr_status=%d\n",
 		      irlap_event[ event], ns_status, nr_status);
 		break;
 	case RECV_UI_FRAME:
@@ -1353,34 +1353,34 @@
 			del_timer(&self->final_timer);
 			irlap_data_indication(self, skb, TRUE);
 			irlap_next_state(self, LAP_XMIT_P);
-			printk(__FUNCTION__ "(): RECV_UI_FRAME: next state %s\n", irlap_state[self->state]);
+			printk("%s: RECV_UI_FRAME: next state %s\n", __FUNCTION__, irlap_state[self->state]);
 			irlap_start_poll_timer(self, self->poll_timeout);
 		}
 		break;
 	case RECV_RR_RSP:
-		/*  
-		 *  If you get a RR, the remote isn't busy anymore, 
-		 *  no matter what the NR 
+		/*
+		 *  If you get a RR, the remote isn't busy anymore,
+		 *  no matter what the NR
 		 */
 		self->remote_busy = FALSE;
 
-		/* 
-		 *  Nr as expected? 
+		/*
+		 *  Nr as expected?
 		 */
 		ret = irlap_validate_nr_received(self, info->nr);
-		if (ret == NR_EXPECTED) {	
+		if (ret == NR_EXPECTED) {
 			/* Stop final timer */
 			del_timer(&self->final_timer);
-			
+
 			/* Update Nr received */
 			irlap_update_nr_received(self, info->nr);
-			
+
 			/*
-			 *  Got expected NR, so reset the retry_count. This 
-			 *  is not done by the IrLAP standard , which is 
+			 *  Got expected NR, so reset the retry_count. This
+			 *  is not done by the IrLAP standard , which is
 			 *  strange! DB.
 			 */
-			self->retry_count = 0;			
+			self->retry_count = 0;
 			irlap_wait_min_turn_around(self, &self->qos_tx);
 
 			irlap_next_state(self, LAP_XMIT_P);
@@ -1388,22 +1388,22 @@
 			/* Start poll timer */
 			irlap_start_poll_timer(self, self->poll_timeout);
 		} else if (ret == NR_UNEXPECTED) {
-			ASSERT(info != NULL, return -1;);	
-			/* 
-			 *  Unexpected nr! 
+			ASSERT(info != NULL, return -1;);
+			/*
+			 *  Unexpected nr!
 			 */
-			
+
 			/* Update Nr received */
 			irlap_update_nr_received(self, info->nr);
 
 			IRDA_DEBUG(4, "RECV_RR_FRAME: Retrans:%d, nr=%d, va=%d, "
 			      "vs=%d, vr=%d\n",
-			      self->retry_count, info->nr, self->va, 
+			      self->retry_count, info->nr, self->va,
 			      self->vs, self->vr);
-			
+
 			/* Resend rejected frames */
 			irlap_resend_rejected_frames(self, CMD_FRAME);
-			
+
 			irlap_next_state(self, LAP_NRM_P);
 		} else if (ret == NR_INVALID) {
 			IRDA_DEBUG(1, __FUNCTION__ "(), Received RR with "
@@ -1426,7 +1426,7 @@
 		/* Update Nr received */
 		irlap_update_nr_received(self, info->nr);
 		irlap_next_state(self, LAP_XMIT_P);
-			
+
 		/* Start poll timer */
 		irlap_start_poll_timer(self, self->poll_timeout);
 		break;
@@ -1437,7 +1437,7 @@
 		irlap_reset_indication(self);
 		break;
 	case FINAL_TIMER_EXPIRED:
-		/* 
+		/*
 		 *  We are allowed to wait for additional 300 ms if
 		 *  final timer expires when we are in the middle
 		 *  of receiving a frame (page 45, IrLAP). Check that
@@ -1449,8 +1449,8 @@
 			irlap_start_final_timer(self, MSECS_TO_JIFFIES(300));
 
 			/*
-			 *  Don't allow this to happen one more time in a row, 
-			 *  or else we can get a pretty tight loop here if 
+			 *  Don't allow this to happen one more time in a row,
+			 *  or else we can get a pretty tight loop here if
 			 *  if we only receive half a frame. DB.
 			 */
 			self->add_wait = TRUE;
@@ -1463,9 +1463,9 @@
 			/* Retry sending the pf bit to the secondary */
 			irlap_wait_min_turn_around(self, &self->qos_tx);
 			irlap_send_rr_frame(self, CMD_FRAME);
-			
+
 			irlap_start_final_timer(self, self->final_timeout);
-		 	self->retry_count++;
+			self->retry_count++;
 			IRDA_DEBUG(4, "irlap_state_nrm_p: FINAL_TIMER_EXPIRED:"
 				   " retry_count=%d\n", self->retry_count);
 
@@ -1515,7 +1515,7 @@
 		irlap_disconnect_request(self);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n",
 			   irlap_event[event]);
 
 		ret = -1;
@@ -1531,16 +1531,16 @@
  *    awaiting reset of disconnect request.
  *
  */
-static int irlap_state_reset_wait(struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_reset_wait(struct irlap_cb *self, IRLAP_EVENT event,
 				  struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
-	
+
 	IRDA_DEBUG(3, __FUNCTION__ "(), event = %s\n", irlap_event[event]);
-	
+
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
-	
+
 	switch (event) {
 	case RESET_REQUEST:
 		if (self->xmitflag) {
@@ -1562,11 +1562,11 @@
 		irlap_next_state( self, LAP_PCLOSE);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n",
 			   irlap_event[event]);
 
 		ret = -1;
-		break;	
+		break;
 	}
 	return ret;
 }
@@ -1578,16 +1578,16 @@
  *    reply.
  *
  */
-static int irlap_state_reset(struct irlap_cb *self, IRLAP_EVENT event, 
+static int irlap_state_reset(struct irlap_cb *self, IRLAP_EVENT event,
 			     struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
-	
+
 	IRDA_DEBUG(3, __FUNCTION__ "(), event = %s\n", irlap_event[event]);
-	
+
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
-	
+
 	switch (event) {
 	case RECV_DISC_CMD:
 		del_timer(&self->final_timer);
@@ -1602,12 +1602,12 @@
 		break;
 	case RECV_UA_RSP:
 		del_timer(&self->final_timer);
-		
+
 		/* Initiate connection state */
 		irlap_initiate_connection_state(self);
-		
+
 		irlap_reset_confirm();
-		
+
 		self->remote_busy = FALSE;
 
 		irlap_next_state(self, LAP_XMIT_P);
@@ -1628,16 +1628,16 @@
 			irlap_next_state(self, LAP_RESET);
 		} else if (self->retry_count >= self->N3) {
 			irlap_apply_default_connection_parameters(self);
-			
+
 			/* Always switch state before calling upper layers */
 			irlap_next_state(self, LAP_NDM);
-			
+
 			irlap_disconnect_indication(self, LAP_NO_RESPONSE);
 		}
 		break;
 	case RECV_SNRM_CMD:
-		/* 
-		 * SNRM frame is not allowed to contain an I-field in this 
+		/*
+		 * SNRM frame is not allowed to contain an I-field in this
 		 * state
 		 */
 		if (!info) {
@@ -1649,47 +1649,47 @@
 			irlap_start_wd_timer(self, self->wd_timeout);
 			irlap_next_state(self, LAP_NDM);
 		} else {
-			IRDA_DEBUG(0, __FUNCTION__ 
+			IRDA_DEBUG(0, __FUNCTION__
 				   "(), SNRM frame contained an I field!\n");
 		}
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n", 
-			   irlap_event[event]);	
+		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n",
+			   irlap_event[event]);
 
 		ret = -1;
-		break;	
+		break;
 	}
 	return ret;
 }
 
 /*
  * Function irlap_state_xmit_s (event, skb, info)
- * 
+ *
  *   XMIT_S, The secondary station has been given the right to transmit,
  *   and we therefor do not expect to receive any transmissions from other
- *   stations.  
+ *   stations.
  */
-static int irlap_state_xmit_s(struct irlap_cb *self, IRLAP_EVENT event, 
-			      struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_xmit_s(struct irlap_cb *self, IRLAP_EVENT event,
+			      struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
-	
-	IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[event]); 
+
+	IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[event]);
 
 	ASSERT(self != NULL, return -ENODEV;);
 	ASSERT(self->magic == LAP_MAGIC, return -EBADR;);
-	
+
 	switch (event) {
 	case SEND_I_CMD:
 		/*
 		 *  Send frame only if send window > 1
-		 */ 
+		 */
 		if ((self->window > 0) && (!self->remote_busy)) {
 #ifdef CONFIG_IRDA_DYNAMIC_WINDOW
 			/*
-			 *  Test if we have transmitted more bytes over the 
-			 *  link than its possible to do with the current 
+			 *  Test if we have transmitted more bytes over the
+			 *  link than its possible to do with the current
 			 *  speed and turn-around-time.
 			 */
 			if (skb->len > self->bytes_left) {
@@ -1697,7 +1697,7 @@
 
 				/*
 				 *  Switch to NRM_S, this is only possible
-				 *  when we are in secondary mode, since we 
+				 *  when we are in secondary mode, since we
 				 *  must be sure that we don't miss any RR
 				 *  frames
 				 */
@@ -1715,18 +1715,18 @@
 			 *  Send data with final bit cleared only if window > 1
 			 *  and there is more frames to be sent
 			 */
-			if ((self->window > 1) && 
-			    skb_queue_len(&self->txq) > 0) 
-			{   
+			if ((self->window > 1) &&
+			    skb_queue_len(&self->txq) > 0)
+			{
 				irlap_send_data_secondary(self, skb);
 				irlap_next_state(self, LAP_XMIT_S);
 			} else {
 				irlap_send_data_secondary_final(self, skb);
 				irlap_next_state(self, LAP_NRM_S);
 
-				/* 
+				/*
 				 * Make sure state machine does not try to send
-				 * any more frames 
+				 * any more frames
 				 */
 				ret = -EPROTO;
 			}
@@ -1747,7 +1747,7 @@
 		 * when we return... - Jean II */
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n",
 			   irlap_event[event]);
 
 		ret = -EINVAL;
@@ -1759,12 +1759,12 @@
 /*
  * Function irlap_state_nrm_s (event, skb, info)
  *
- *    NRM_S (Normal Response Mode as Secondary) state, in this state we are 
+ *    NRM_S (Normal Response Mode as Secondary) state, in this state we are
  *    expecting to receive frames from the primary station
  *
  */
-static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event, 
-			     struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event,
+			     struct sk_buff *skb, struct irlap_info *info)
 {
 	int ns_status;
 	int nr_status;
@@ -1779,28 +1779,28 @@
 	case RECV_I_CMD: /* Optimize for the common case */
 		/* FIXME: must check for remote_busy below */
 		IRDA_DEBUG(4, __FUNCTION__ "(), event=%s nr=%d, vs=%d, ns=%d, "
-			   "vr=%d, pf=%d\n", irlap_event[event], info->nr, 
+			   "vr=%d, pf=%d\n", irlap_event[event], info->nr,
 			   self->vs, info->ns, self->vr, info->pf);
 
 		self->retry_count = 0;
 
 		ns_status = irlap_validate_ns_received(self, info->ns);
 		nr_status = irlap_validate_nr_received(self, info->nr);
-		/* 
+		/*
 		 *  Check for expected I(nformation) frame
 		 */
 		if ((ns_status == NS_EXPECTED) && (nr_status == NR_EXPECTED)) {
-			/* 
+			/*
 			 *  poll bit cleared?
 			 */
 			if (!info->pf) {
 				self->vr = (self->vr + 1) % 8;
-				
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-				
+
 				self->ack_required = TRUE;
-				
+
 				/*
 				 *  Starting WD-timer here is optional, but
 				 *  not recommended. Note 6 IrLAP p. 83
@@ -1815,18 +1815,18 @@
 				break;
 			} else {
 				self->vr = (self->vr + 1) % 8;
-				
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-				
-				/* 
+
+				/*
 				 *  We should wait before sending RR, and
 				 *  also before changing to XMIT_S
-				 *  state. (note 1, IrLAP p. 82) 
+				 *  state. (note 1, IrLAP p. 82)
 				 */
 				irlap_wait_min_turn_around(self, &self->qos_tx);
 
-				/*  
+				/*
 				 * Give higher layers a chance to
 				 * immediately reply with some data before
 				 * we decide if we should send a RR frame
@@ -1835,17 +1835,17 @@
 				irlap_data_indication(self, skb, FALSE);
 
 				/* Any pending data requests?  */
-				if ((skb_queue_len(&self->txq) > 0) && 
-				    (self->window > 0)) 
+				if ((skb_queue_len(&self->txq) > 0) &&
+				    (self->window > 0))
 				{
 					self->ack_required = TRUE;
-					
+
 					del_timer(&self->wd_timer);
-					
+
 					irlap_next_state(self, LAP_XMIT_S);
 				} else {
 					irlap_send_rr_frame(self, RSP_FRAME);
-					irlap_start_wd_timer(self, 
+					irlap_start_wd_timer(self,
 							     self->wd_timeout);
 
 					/* Keep the state */
@@ -1862,33 +1862,33 @@
 			/* Unexpected next to send, with final bit cleared */
 			if (!info->pf) {
 				irlap_update_nr_received(self, info->nr);
-				
+
 				irlap_start_wd_timer(self, self->wd_timeout);
 			} else {
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-			
+
 				irlap_wait_min_turn_around(self, &self->qos_tx);
 				irlap_send_rr_frame(self, CMD_FRAME);
-			
+
 				irlap_start_wd_timer(self, self->wd_timeout);
 			}
 			break;
 		}
 
-		/* 
+		/*
 		 *  Unexpected Next to Receive(NR) ?
 		 */
 		if ((ns_status == NS_EXPECTED) && (nr_status == NR_UNEXPECTED))
 		{
 			if (info->pf) {
 				IRDA_DEBUG(4, "RECV_I_RSP: frame(s) lost\n");
-				
+
 				self->vr = (self->vr + 1) % 8;
-				
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-				
+
 				/* Resend rejected frames */
 				irlap_resend_rejected_frames(self, RSP_FRAME);
 
@@ -1905,10 +1905,10 @@
 			 */
 			if (!info->pf) {
 				self->vr = (self->vr + 1) % 8;
-				
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
-				
+
 				/* Keep state, do not move this line */
 				irlap_next_state(self, LAP_NRM_S);
 
@@ -1917,7 +1917,7 @@
 			}
 			break;
 		}
-		
+
 		if (ret == NR_INVALID) {
 			IRDA_DEBUG(0, "NRM_S, NR_INVALID not implemented!\n");
 		}
@@ -1926,7 +1926,7 @@
 		}
 		break;
 	case RECV_UI_FRAME:
-		/* 
+		/*
 		 *  poll bit cleared?
 		 */
 		if (!info->pf) {
@@ -1936,11 +1936,11 @@
 			/*
 			 *  Any pending data requests?
 			 */
-			if ((skb_queue_len(&self->txq) > 0) && 
-			    (self->window > 0) && !self->remote_busy) 
+			if ((skb_queue_len(&self->txq) > 0) &&
+			    (self->window > 0) && !self->remote_busy)
 			{
 				irlap_data_indication(self, skb, TRUE);
-				
+
 				del_timer(&self->wd_timer);
 
 				irlap_next_state(self, LAP_XMIT_S);
@@ -1951,7 +1951,7 @@
 
 				irlap_send_rr_frame(self, RSP_FRAME);
 				self->ack_required = FALSE;
-				
+
 				irlap_start_wd_timer(self, self->wd_timeout);
 
 				/* Keep the state */
@@ -1962,28 +1962,28 @@
 	case RECV_RR_CMD:
 		self->retry_count = 0;
 
-		/* 
-		 *  Nr as expected? 
+		/*
+		 *  Nr as expected?
 		 */
 		nr_status = irlap_validate_nr_received(self, info->nr);
 		if (nr_status == NR_EXPECTED) {
-			if ((skb_queue_len( &self->txq) > 0) && 
+			if ((skb_queue_len( &self->txq) > 0) &&
 			    (self->window > 0)) {
 				self->remote_busy = FALSE;
-				
+
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
 				del_timer(&self->wd_timer);
-				
+
 				irlap_wait_min_turn_around(self, &self->qos_tx);
 				irlap_next_state(self, LAP_XMIT_S);
-			} else {			
+			} else {
 				self->remote_busy = FALSE;
 				/* Update Nr received */
 				irlap_update_nr_received(self, info->nr);
 				irlap_wait_min_turn_around(self, &self->qos_tx);
 				irlap_start_wd_timer(self, self->wd_timeout);
-				
+
 				/* Note : if the link is idle (this case),
 				 * we never go in XMIT_S, so we never get a
 				 * chance to process any DISCONNECT_REQUEST.
@@ -1997,7 +1997,7 @@
 				} else {
 					/* Just send back pf bit */
 					irlap_send_rr_frame(self, RSP_FRAME);
-				
+
 					irlap_next_state(self, LAP_NRM_S);
 				}
 			}
@@ -2009,11 +2009,11 @@
 			irlap_start_wd_timer(self, self->wd_timeout);
 
 			/* Keep state */
-			irlap_next_state(self, LAP_NRM_S); 
+			irlap_next_state(self, LAP_NRM_S);
 		} else {
-			IRDA_DEBUG(1, __FUNCTION__ 
+			IRDA_DEBUG(1, __FUNCTION__
 				   "(), invalid nr not implemented!\n");
-		} 
+		}
 		break;
 	case RECV_SNRM_CMD:
 		/* SNRM frame is not allowed to contain an I-field */
@@ -2021,12 +2021,12 @@
 			del_timer(&self->wd_timer);
 			IRDA_DEBUG(1, __FUNCTION__ "(), received SNRM cmd\n");
 			irlap_next_state(self, LAP_RESET_CHECK);
-			
+
 			irlap_reset_indication(self);
 		} else {
-			IRDA_DEBUG(0, __FUNCTION__ 
+			IRDA_DEBUG(0, __FUNCTION__
 				   "(), SNRM frame contained an I-field!\n");
-			
+
 		}
 		break;
 	case RECV_REJ_CMD:
@@ -2057,7 +2057,7 @@
 		 *   which explain why we use (self->N2 / 2) here !!!
 		 * Jean II
 		 */
-		IRDA_DEBUG(1, __FUNCTION__ "(), retry_count = %d\n", 
+		IRDA_DEBUG(1, __FUNCTION__ "(), retry_count = %d\n",
 			   self->retry_count);
 
 		if (self->retry_count < (self->N2 / 2)) {
@@ -2070,7 +2070,7 @@
 							STATUS_NO_ACTIVITY);
 		} else {
 			irlap_apply_default_connection_parameters(self);
-			
+
 			/* Always switch state before calling upper layers */
 			irlap_next_state(self, LAP_NDM);
 			irlap_disconnect_indication(self, LAP_NO_RESPONSE);
@@ -2110,7 +2110,7 @@
 		irlap_send_test_frame(self, self->caddr, info->daddr, skb);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", 
+		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n",
 			   event, irlap_event[event]);
 
 		ret = -EINVAL;
@@ -2121,12 +2121,9 @@
 
 /*
  * Function irlap_state_sclose (self, event, skb, info)
- *
- *    
- *
  */
-static int irlap_state_sclose(struct irlap_cb *self, IRLAP_EVENT event, 
-			      struct sk_buff *skb, struct irlap_info *info) 
+static int irlap_state_sclose(struct irlap_cb *self, IRLAP_EVENT event,
+			      struct sk_buff *skb, struct irlap_info *info)
 {
 	int ret = 0;
 
@@ -2134,7 +2131,7 @@
 
 	ASSERT(self != NULL, return -ENODEV;);
 	ASSERT(self->magic == LAP_MAGIC, return -EBADR;);
-	
+
 	switch (event) {
 	case RECV_DISC_CMD:
 		/* Always switch state before calling upper layers */
@@ -2156,7 +2153,7 @@
 
 		del_timer(&self->wd_timer);
 		irlap_apply_default_connection_parameters(self);
-		
+
 		irlap_disconnect_indication(self, LAP_DISC_INDICATION);
 		break;
 	case WD_TIMER_EXPIRED:
@@ -2164,11 +2161,11 @@
 		irlap_next_state(self, LAP_NDM);
 
 		irlap_apply_default_connection_parameters(self);
-		
+
 		irlap_disconnect_indication(self, LAP_DISC_INDICATION);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", 
+		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n",
 			   event, irlap_event[event]);
 
 		ret = -EINVAL;
@@ -2178,24 +2175,24 @@
 	return -1;
 }
 
-static int irlap_state_reset_check( struct irlap_cb *self, IRLAP_EVENT event, 
-				   struct sk_buff *skb, 
-				   struct irlap_info *info) 
+static int irlap_state_reset_check( struct irlap_cb *self, IRLAP_EVENT event,
+				   struct sk_buff *skb,
+				   struct irlap_info *info)
 {
 	int ret = 0;
 
-	IRDA_DEBUG(1, __FUNCTION__ "(), event=%s\n", irlap_event[event]); 
+	IRDA_DEBUG(1, __FUNCTION__ "(), event=%s\n", irlap_event[event]);
 
 	ASSERT(self != NULL, return -ENODEV;);
 	ASSERT(self->magic == LAP_MAGIC, return -EBADR;);
-	
+
 	switch (event) {
 	case RESET_RESPONSE:
 		irlap_send_ua_response_frame(self, &self->qos_rx);
 		irlap_initiate_connection_state(self);
 		irlap_start_wd_timer(self, WD_TIMEOUT);
 		irlap_flush_all_queues(self);
-		
+
 		irlap_next_state(self, LAP_NRM_S);
 		break;
 	case DISCONNECT_REQUEST:
@@ -2205,7 +2202,7 @@
 		irlap_next_state(self, LAP_SCLOSE);
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", 
+		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n",
 			   event, irlap_event[event]);
 
 		ret = -EINVAL;
#42 lore raw

PATCH 1/1 2.5.21 kill warnings 15/19

In reply to Linus Torvalds

irlmp abused __FUNCTION__ and the space bar as well.

net/irda/irlmp.c +186 -198
diff -urN linux-2.5.21/net/irda/irlmp.c linux/net/irda/irlmp.c
@@ -1,25 +1,25 @@
 /*********************************************************************
- *                
+ *
  * Filename:      irlmp.c
  * Version:       1.0
- * Description:   IrDA Link Management Protocol (LMP) layer                 
+ * Description:   IrDA Link Management Protocol (LMP) layer
  * Status:        Stable.
  * Author:        Dag Brattli <[email protected]>
  * Created at:    Sun Aug 17 20:54:32 1997
  * Modified at:   Wed Jan  5 11:26:03 2000
  * Modified by:   Dag Brattli <[email protected]>
- * 
- *     Copyright (c) 1998-2000 Dag Brattli <[email protected]>, 
+ *
+ *     Copyright (c) 1998-2000 Dag Brattli <[email protected]>,
  *     All Rights Reserved.
  *     Copyright (c) 2000-2001 Jean Tourrilhes <[email protected]>
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
  ********************************************************************/
@@ -82,7 +82,7 @@
 	if (irlmp == NULL)
 		return -ENOMEM;
 	memset(irlmp, 0, sizeof(struct irlmp_cb));
-	
+
 	irlmp->magic = LMP_MAGIC;
 	spin_lock_init(&irlmp->log_lock);
 
@@ -91,13 +91,13 @@
 	irlmp->links = hashbin_new(HB_GLOBAL);
 	irlmp->unconnected_lsaps = hashbin_new(HB_GLOBAL);
 	irlmp->cachelog = hashbin_new(HB_GLOBAL);
-	
+
 	irlmp->free_lsap_sel = 0x10; /* Reserved 0x00-0x0f */
 	strcpy(sysctl_devname, "Linux");
-	
+
 	/* Do discovery every 3 seconds */
 	init_timer(&irlmp->discovery_timer);
-   	irlmp_start_discovery_timer(irlmp, sysctl_discovery_timeout*HZ);
+	irlmp_start_discovery_timer(irlmp, sysctl_discovery_timeout*HZ);
 
 	return 0;
 }
@@ -108,20 +108,20 @@
  *    Remove IrLMP layer
  *
  */
-void irlmp_cleanup(void) 
+void irlmp_cleanup(void)
 {
 	/* Check for main structure */
 	ASSERT(irlmp != NULL, return;);
 	ASSERT(irlmp->magic == LMP_MAGIC, return;);
 
 	del_timer(&irlmp->discovery_timer);
-	
+
 	hashbin_delete(irlmp->links, (FREE_FUNC) kfree);
 	hashbin_delete(irlmp->unconnected_lsaps, (FREE_FUNC) kfree);
 	hashbin_delete(irlmp->clients, (FREE_FUNC) kfree);
 	hashbin_delete(irlmp->services, (FREE_FUNC) kfree);
 	hashbin_delete(irlmp->cachelog, (FREE_FUNC) kfree);
-	
+
 	/* De-allocate main structure */
 	kfree(irlmp);
 	irlmp = NULL;
@@ -152,11 +152,11 @@
 	/* Allocate new instance of a LSAP connection */
 	self = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC);
 	if (self == NULL) {
-		ERROR(__FUNCTION__ "(), can't allocate memory");
+		ERROR("%s: can't allocate memory", __FUNCTION__);
 		return NULL;
 	}
 	memset(self, 0, sizeof(struct lsap_cb));
-	
+
 	self->magic = LMP_LSAP_MAGIC;
 	self->slsap_sel = slsap_sel;
 
@@ -176,11 +176,11 @@
 	self->notify = *notify;
 
 	self->lsap_state = LSAP_DISCONNECTED;
-	
+
 	/* Insert into queue of unconnected LSAPs */
 	hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self, (int) self, 
 		       NULL);
-	
+
 	return self;
 }
 
@@ -247,11 +247,11 @@
 	self->lap = NULL;
 	/* Check if we found the LSAP! If not then try the unconnected lsaps */
 	if (!lsap) {
-		lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, 
+		lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self,
 				      NULL);
 	}
 	if (!lsap) {
-		IRDA_DEBUG(0, __FUNCTION__ 
+		IRDA_DEBUG(0, __FUNCTION__
 		     "(), Looks like somebody has removed me already!\n");
 		return;
 	}
@@ -278,11 +278,11 @@
 	 */
 	lap = kmalloc(sizeof(struct lap_cb), GFP_KERNEL);
 	if (lap == NULL) {
-		ERROR(__FUNCTION__ "(), unable to kmalloc\n");
+		ERROR("%s: unable to kmalloc\n", __FUNCTION__);
 		return;
 	}
 	memset(lap, 0, sizeof(struct lap_cb));
-	
+
 	lap->irlap = irlap;
 	lap->magic = LMP_LAP_MAGIC;
 	lap->saddr = saddr;
@@ -293,7 +293,7 @@
 #endif
 
 	lap->lap_state = LAP_STANDBY;
-	
+
 	init_timer(&lap->idle_timer);
 
 	/*
@@ -301,9 +301,9 @@
 	 */
 	hashbin_insert(irlmp->links, (irda_queue_t *) lap, lap->saddr, NULL);
 
-	/* 
+	/*
 	 *  We set only this variable so IrLAP can tell us on which link the
-	 *  different events happened on 
+	 *  different events happened on
 	 */
 	irda_notify_init(notify);
 	notify->instance = lap;
@@ -328,7 +328,7 @@
 		/* Remove all discoveries discovered at this link */
 		irlmp_expire_discoveries(irlmp->cachelog, link->saddr, TRUE);
 
-		del_timer(&link->idle_timer);	
+		del_timer(&link->idle_timer);
 
 		link->magic = 0;
 		kfree(link);
@@ -338,12 +338,12 @@
 /*
  * Function irlmp_connect_request (handle, dlsap, userdata)
  *
- *    Connect with a peer LSAP  
+ *    Connect with a peer LSAP
  *
  */
-int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel, 
-			  __u32 saddr, __u32 daddr, 
-			  struct qos_info *qos, struct sk_buff *userdata) 
+int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel,
+			  __u32 saddr, __u32 daddr,
+			  struct qos_info *qos, struct sk_buff *userdata)
 {
 	struct sk_buff *skb = NULL;
 	struct lap_cb *lap;
@@ -352,18 +352,18 @@
 
 	ASSERT(self != NULL, return -EBADR;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return -EBADR;);
-	
-	IRDA_DEBUG(2, __FUNCTION__ 
-	      "(), slsap_sel=%02x, dlsap_sel=%02x, saddr=%08x, daddr=%08x\n", 
+
+	IRDA_DEBUG(2, __FUNCTION__
+	      "(), slsap_sel=%02x, dlsap_sel=%02x, saddr=%08x, daddr=%08x\n",
 	      self->slsap_sel, dlsap_sel, saddr, daddr);
-	
+
 	if (test_bit(0, &self->connected))
 		return -EISCONN;
-	
+
 	/* Client must supply destination device address */
 	if (!daddr)
 		return -EINVAL;
-	
+
 	/* Any userdata? */
 	if (userdata == NULL) {
 		skb = dev_alloc_skb(64);
@@ -373,27 +373,27 @@
 		skb_reserve(skb, LMP_MAX_HEADER);
 	} else
 		skb = userdata;
-	
+
 	/* Make room for MUX control header (3 bytes) */
 	ASSERT(skb_headroom(skb) >= LMP_CONTROL_HEADER, return -1;);
 	skb_push(skb, LMP_CONTROL_HEADER);
 
 	self->dlsap_sel = dlsap_sel;
-	
-	/*  
+
+	/*
 	 * Find the link to where we should try to connect since there may
 	 * be more than one IrDA port on this machine. If the client has
 	 * passed us the saddr (and already knows which link to use), then
 	 * we use that to find the link, if not then we have to look in the
 	 * discovery log and check if any of the links has discovered a
-	 * device with the given daddr 
+	 * device with the given daddr
 	 */
 	if ((!saddr) || (saddr == DEV_ADDR_ANY)) {
 		if (daddr != DEV_ADDR_ANY)
 			discovery = hashbin_find(irlmp->cachelog, daddr, NULL);
 		else {
 			IRDA_DEBUG(2, __FUNCTION__ "(), no daddr\n");
-			discovery = (discovery_t *) 
+			discovery = (discovery_t *)
 				hashbin_get_first(irlmp->cachelog);
 		}
 
@@ -402,7 +402,7 @@
 			daddr = discovery->daddr;
 		}
 	}
-	lap = hashbin_find(irlmp->links, saddr, NULL);	
+	lap = hashbin_find(irlmp->links, saddr, NULL);
 	if (lap == NULL) {
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unable to find a usable link!\n");
 		return -EHOSTUNREACH;
@@ -433,9 +433,9 @@
 
 	self->lap = lap;
 
-	/* 
-	 *  Remove LSAP from list of unconnected LSAPs and insert it into the 
-	 *  list of connected LSAPs for the particular link 
+	/*
+	 *  Remove LSAP from list of unconnected LSAPs and insert it into the
+	 *  list of connected LSAPs for the particular link
 	 */
 	lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, NULL);
 
@@ -447,13 +447,13 @@
 	hashbin_insert(self->lap->lsaps, (irda_queue_t *) self, (int) self, NULL);
 
 	set_bit(0, &self->connected);	/* TRUE */
-	
+
 	/*
 	 *  User supplied qos specifications?
 	 */
 	if (qos)
 		self->qos = *qos;
-	
+
 	irlmp_do_lsap_event(self, LM_CONNECT_REQUEST, skb);
 
 	return 0;
@@ -465,18 +465,18 @@
  *    Incoming connection
  *
  */
-void irlmp_connect_indication(struct lsap_cb *self, struct sk_buff *skb) 
+void irlmp_connect_indication(struct lsap_cb *self, struct sk_buff *skb)
 {
 	int max_seg_size;
 	int lap_header_size;
 	int max_header_size;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
 	ASSERT(skb != NULL, return;);
 	ASSERT(self->lap != NULL, return;);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), slsap_sel=%02x, dlsap_sel=%02x\n", 
+	IRDA_DEBUG(2, __FUNCTION__ "(), slsap_sel=%02x, dlsap_sel=%02x\n",
 		   self->slsap_sel, self->dlsap_sel);
 
 	/* Note : self->lap is set in irlmp_link_data_indication(),
@@ -492,10 +492,10 @@
 
 	/* Hide LMP_CONTROL_HEADER header from layer above */
 	skb_pull(skb, LMP_CONTROL_HEADER);
-	
+
 	if (self->notify.connect_indication)
-		self->notify.connect_indication(self->notify.instance, self, 
-						&self->qos, max_seg_size, 
+		self->notify.connect_indication(self->notify.instance, self,
+						&self->qos, max_seg_size,
 						max_header_size, skb);
 	else
 		dev_kfree_skb(skb);
@@ -507,7 +507,7 @@
  *    Service user is accepting connection
  *
  */
-int irlmp_connect_response(struct lsap_cb *self, struct sk_buff *userdata) 
+int irlmp_connect_response(struct lsap_cb *self, struct sk_buff *userdata)
 {
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
@@ -515,13 +515,13 @@
 
 	set_bit(0, &self->connected);	/* TRUE */
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), slsap_sel=%02x, dlsap_sel=%02x\n", 
+	IRDA_DEBUG(2, __FUNCTION__ "(), slsap_sel=%02x, dlsap_sel=%02x\n",
 		   self->slsap_sel, self->dlsap_sel);
 
 	/* Make room for MUX control header (3 bytes) */
 	ASSERT(skb_headroom(userdata) >= LMP_CONTROL_HEADER, return -1;);
 	skb_push(userdata, LMP_CONTROL_HEADER);
-	
+
 	irlmp_do_lsap_event(self, LM_CONNECT_RESPONSE, userdata);
 
 	return 0;
@@ -532,26 +532,26 @@
  *
  *    LSAP connection confirmed peer device!
  */
-void irlmp_connect_confirm(struct lsap_cb *self, struct sk_buff *skb) 
+void irlmp_connect_confirm(struct lsap_cb *self, struct sk_buff *skb)
 {
 	int max_header_size;
 	int lap_header_size;
 	int max_seg_size;
 
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
-	
+
 	ASSERT(skb != NULL, return;);
 	ASSERT(self != NULL, return;);
-	ASSERT(self->magic == LMP_LSAP_MAGIC, return;);	
+	ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
 	ASSERT(self->lap != NULL, return;);
 
 	self->qos = *self->lap->qos;
 
 	max_seg_size    = self->lap->qos->data_size.value-LMP_HEADER;
-	lap_header_size = IRLAP_GET_HEADER_SIZE(self->lap->irlap);	
+	lap_header_size = IRLAP_GET_HEADER_SIZE(self->lap->irlap);
 	max_header_size = LMP_HEADER + lap_header_size;
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), max_header_size=%d\n", 
+	IRDA_DEBUG(2, __FUNCTION__ "(), max_header_size=%d\n",
 		   max_header_size);
 
 	/* Hide LMP_CONTROL_HEADER header from layer above */
@@ -572,7 +572,7 @@
  *    new LSAP so it can keep listening on the old one.
  *
  */
-struct lsap_cb *irlmp_dup(struct lsap_cb *orig, void *instance) 
+struct lsap_cb *irlmp_dup(struct lsap_cb *orig, void *instance)
 {
 	struct lsap_cb *new;
 
@@ -595,8 +595,8 @@
 	/* new->slsap_sel = orig->slsap_sel; => done in the memcpy() */
 
 	init_timer(&new->watchdog_timer);
-	
-	hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) new, (int) new, 
+
+	hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) new, (int) new,
 		       NULL);
 
 	/* Make sure that we invalidate the cache */
@@ -610,10 +610,10 @@
 /*
  * Function irlmp_disconnect_request (handle, userdata)
  *
- *    The service user is requesting disconnection, this will not remove the 
+ *    The service user is requesting disconnection, this will not remove the
  *    LSAP, but only mark it as disconnected
  */
-int irlmp_disconnect_request(struct lsap_cb *self, struct sk_buff *userdata) 
+int irlmp_disconnect_request(struct lsap_cb *self, struct sk_buff *userdata)
 {
 	struct lsap_cb *lsap;
 
@@ -633,13 +633,13 @@
 
 	skb_push(userdata, LMP_CONTROL_HEADER);
 
-	/* 
+	/*
 	 *  Do the event before the other stuff since we must know
 	 *  which lap layer that the frame should be transmitted on
 	 */
 	irlmp_do_lsap_event(self, LM_DISCONNECT_REQUEST, userdata);
 
-	/* 
+	/*
 	 *  Remove LSAP from list of connected LSAPs for the particular link
 	 *  and insert it into the list of unconnected LSAPs
 	 */
@@ -653,13 +653,13 @@
 	ASSERT(lsap->magic == LMP_LSAP_MAGIC, return -1;);
 	ASSERT(lsap == self, return -1;);
 
-	hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self, (int) self, 
+	hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self, (int) self,
 		       NULL);
-	
+
 	/* Reset some values */
 	self->dlsap_sel = LSAP_ANY;
 	self->lap = NULL;
-	
+
 	return 0;
 }
 
@@ -668,8 +668,8 @@
  *
  *    LSAP is being closed!
  */
-void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason, 
-				 struct sk_buff *userdata) 
+void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
+				 struct sk_buff *userdata)
 {
 	struct lsap_cb *lsap;
 
@@ -677,7 +677,7 @@
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
 
-	IRDA_DEBUG(3, __FUNCTION__ "(), slsap_sel=%02x, dlsap_sel=%02x\n", 
+	IRDA_DEBUG(3, __FUNCTION__ "(), slsap_sel=%02x, dlsap_sel=%02x\n",
 		   self->slsap_sel, self->dlsap_sel);
 
 	/* Already disconnected ?
@@ -691,12 +691,12 @@
 		return;
 	}
 
-	/* 
-	 *  Remove association between this LSAP and the link it used 
+	/*
+	 *  Remove association between this LSAP and the link it used
 	 */
 	ASSERT(self->lap != NULL, return;);
 	ASSERT(self->lap->lsaps != NULL, return;);
-	
+
 	lsap = hashbin_remove(self->lap->lsaps, (int) self, NULL);
 #ifdef CONFIG_IRDA_CACHE_LAST_LSAP
 	self->lap->cache.valid = FALSE;
@@ -704,17 +704,17 @@
 
 	ASSERT(lsap != NULL, return;);
 	ASSERT(lsap == self, return;);
-	hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) lsap, (int) lsap, 
+	hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) lsap, (int) lsap,
 		       NULL);
 
 	self->dlsap_sel = LSAP_ANY;
 	self->lap = NULL;
-	
+
 	/*
 	 *  Inform service user
 	 */
 	if (self->notify.disconnect_indication)
-		self->notify.disconnect_indication(self->notify.instance, 
+		self->notify.disconnect_indication(self->notify.instance,
 						   self, reason, userdata);
 	else {
 		IRDA_DEBUG(0, __FUNCTION__ "(), no handler\n");
@@ -747,7 +747,7 @@
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	while (lap != NULL) {
 		ASSERT(lap->magic == LMP_LAP_MAGIC, return;);
-		
+
 		if (lap->lap_state == LAP_STANDBY) {
 			/* Expire discoveries discovered on this link */
 			irlmp_expire_discoveries(irlmp->cachelog, lap->saddr,
@@ -770,35 +770,35 @@
 
 	/* Make sure the value is sane */
 	if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){
-		WARNING(__FUNCTION__ 
-		       "(), invalid value for number of slots!\n");
+		WARNING("%s: invalid value for number of slots!\n",
+				__FUNCTION__);
 		nslots = sysctl_discovery_slots = 8;
 	}
 
 	/* Construct new discovery info to be used by IrLAP, */
 	irlmp->discovery_cmd.hints.word = irlmp->hints.word;
-	
-	/* 
-	 *  Set character set for device name (we use ASCII), and 
-	 *  copy device name. Remember to make room for a \0 at the 
+
+	/*
+	 *  Set character set for device name (we use ASCII), and
+	 *  copy device name. Remember to make room for a \0 at the
 	 *  end
 	 */
 	irlmp->discovery_cmd.charset = CS_ASCII;
-	strncpy(irlmp->discovery_cmd.nickname, sysctl_devname, 
+	strncpy(irlmp->discovery_cmd.nickname, sysctl_devname,
 		NICKNAME_MAX_LEN);
 	irlmp->discovery_cmd.name_len = strlen(irlmp->discovery_cmd.nickname);
 	irlmp->discovery_cmd.nslots = nslots;
-	
+
 	/*
 	 * Try to send discovery packets on all links
 	 */
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	while (lap != NULL) {
 		ASSERT(lap->magic == LMP_LAP_MAGIC, return;);
-		
+
 		if (lap->lap_state == LAP_STANDBY) {
 			/* Try to discover */
-			irlmp_do_lap_event(lap, LM_LAP_DISCOVERY_REQUEST, 
+			irlmp_do_lap_event(lap, LM_LAP_DISCOVERY_REQUEST,
 					   NULL);
 		}
 		lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
@@ -816,9 +816,9 @@
 	/* Return current cached discovery log */
 	irlmp_discovery_confirm(irlmp->cachelog, DISCOVERY_LOG);
 
-	/* 
+	/*
 	 * Start a single discovery operation if discovery is not already
-         * running 
+         * running
 	 */
 	if (!sysctl_discovery) {
 		/* Check if user wants to override the default */
@@ -864,9 +864,6 @@
 #if 0
 /*
  * Function irlmp_check_services (discovery)
- *
- *    
- *
  */
 void irlmp_check_services(discovery_t *discovery)
 {
@@ -896,7 +893,7 @@
 			/* Don't notify about the ANY service */
 			if (service == S_ANY)
 				continue;
-			/*  
+			/*
 			 * Found no clients for dealing with this service,
 			 */
 		}
@@ -923,20 +920,20 @@
 	discovery_t *discovery;
 
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
-	
+
 	/* Check if client wants or not partial/selective log (optimisation) */
 	if (!client->disco_callback)
 		return;
 
-	/* 
-	 * Now, check all discovered devices (if any), and notify client 
-	 * only about the services that the client is interested in 
+	/*
+	 * Now, check all discovered devices (if any), and notify client
+	 * only about the services that the client is interested in
 	 */
 	discovery = (discovery_t *) hashbin_get_first(log);
 	while (discovery != NULL) {
-		IRDA_DEBUG(3, "discovery->daddr = 0x%08x\n", discovery->daddr); 
-		
-		/* 
+		IRDA_DEBUG(3, "discovery->daddr = 0x%08x\n", discovery->daddr);
+
+		/*
 		 * Any common hint bits? Remember to mask away the extension
 		 * bits ;-)
 		 */
@@ -952,24 +949,24 @@
  *
  *    Some device(s) answered to our discovery request! Check to see which
  *    device it is, and give indication to the client(s)
- * 
+ *
  */
-void irlmp_discovery_confirm(hashbin_t *log, DISCOVERY_MODE mode) 
+void irlmp_discovery_confirm(hashbin_t *log, DISCOVERY_MODE mode)
 {
 	irlmp_client_t *client;
-	
+
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
-	
+
 	ASSERT(log != NULL, return;);
-	
+
 	if (!(HASHBIN_GET_SIZE(log)))
 		return;
-	
+
 	client = (irlmp_client_t *) hashbin_get_first(irlmp->clients);
 	while (client != NULL) {
 		/* Check if we should notify client */
 		irlmp_notify_client(client, log, mode);
-			
+
 		client = (irlmp_client_t *) hashbin_get_next(irlmp->clients);
 	}
 }
@@ -980,19 +977,19 @@
  *	This device is no longer been discovered, and therefore it is beeing
  *	purged from the discovery log. Inform all clients who have
  *	registered for this event...
- * 
+ *
  *	Note : called exclusively from discovery.c
  *	Note : as we are currently processing the log, the clients callback
  *	should *NOT* attempt to touch the log now.
  */
-void irlmp_discovery_expiry(discovery_t *expiry) 
+void irlmp_discovery_expiry(discovery_t *expiry)
 {
 	irlmp_client_t *client;
-	
+
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
 
 	ASSERT(expiry != NULL, return;);
-	
+
 	client = (irlmp_client_t *) hashbin_get_first(irlmp->clients);
 	while (client != NULL) {
 		/* Check if we should notify client */
@@ -1020,14 +1017,14 @@
 
 	irlmp->discovery_rsp.hints.word = irlmp->hints.word;
 
-	/* 
-	 *  Set character set for device name (we use ASCII), and 
-	 *  copy device name. Remember to make room for a \0 at the 
+	/*
+	 *  Set character set for device name (we use ASCII), and
+	 *  copy device name. Remember to make room for a \0 at the
 	 *  end
 	 */
 	irlmp->discovery_rsp.charset = CS_ASCII;
 
-	strncpy(irlmp->discovery_rsp.nickname, sysctl_devname, 
+	strncpy(irlmp->discovery_rsp.nickname, sysctl_devname,
 		NICKNAME_MAX_LEN);
 	irlmp->discovery_rsp.name_len = strlen(irlmp->discovery_rsp.nickname);
 
@@ -1040,15 +1037,15 @@
  *    Send some data to peer device
  *
  */
-int irlmp_data_request(struct lsap_cb *self, struct sk_buff *skb) 
+int irlmp_data_request(struct lsap_cb *self, struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
-	
+
 	/* Make room for MUX header */
 	ASSERT(skb_headroom(skb) >= LMP_HEADER, return -1;);
 	skb_push(skb, LMP_HEADER);
-	
+
 	return irlmp_do_lsap_event(self, LM_DATA_REQUEST, skb);
 }
 
@@ -1058,7 +1055,7 @@
  *    Got data from LAP layer so pass it up to upper layer
  *
  */
-void irlmp_data_indication(struct lsap_cb *self, struct sk_buff *skb) 
+void irlmp_data_indication(struct lsap_cb *self, struct sk_buff *skb)
 {
 	/* Hide LMP header from layer above */
 	skb_pull(skb, LMP_HEADER);
@@ -1071,16 +1068,13 @@
 
 /*
  * Function irlmp_udata_request (self, skb)
- *
- *    
- *
  */
-int irlmp_udata_request(struct lsap_cb *self, struct sk_buff *skb) 
+int irlmp_udata_request(struct lsap_cb *self, struct sk_buff *skb)
 {
- 	IRDA_DEBUG(4, __FUNCTION__ "()\n"); 
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(skb != NULL, return -1;);
-	
+
 	/* Make room for MUX header */
 	ASSERT(skb_headroom(skb) >= LMP_HEADER, return -1;);
 	skb_push(skb, LMP_HEADER);
@@ -1094,9 +1088,9 @@
  *    Send unreliable data (but still within the connection)
  *
  */
-void irlmp_udata_indication(struct lsap_cb *self, struct sk_buff *skb) 
+void irlmp_udata_indication(struct lsap_cb *self, struct sk_buff *skb)
 {
- 	IRDA_DEBUG(4, __FUNCTION__ "()\n"); 
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
@@ -1106,7 +1100,7 @@
 	skb_pull(skb, LMP_HEADER);
 
 	if (self->notify.udata_indication)
-		self->notify.udata_indication(self->notify.instance, self, 
+		self->notify.udata_indication(self->notify.instance, self,
 					      skb);
 	else
 		dev_kfree_skb(skb);
@@ -1114,23 +1108,20 @@
 
 /*
  * Function irlmp_connless_data_request (self, skb)
- *
- *    
- *
  */
 #ifdef CONFIG_IRDA_ULTRA
-int irlmp_connless_data_request(struct lsap_cb *self, struct sk_buff *skb) 
+int irlmp_connless_data_request(struct lsap_cb *self, struct sk_buff *skb)
 {
 	struct sk_buff *clone_skb;
 	struct lap_cb *lap;
 
- 	IRDA_DEBUG(4, __FUNCTION__ "()\n"); 
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(skb != NULL, return -1;);
-	
+
 	/* Make room for MUX and PID header */
 	ASSERT(skb_headroom(skb) >= LMP_HEADER+LMP_PID_HEADER, return -1;);
-	
+
 	/* Insert protocol identifier */
 	skb_push(skb, LMP_PID_HEADER);
 	skb->data[0] = self->pid;
@@ -1149,7 +1140,7 @@
 			return -ENOMEM;
 
 		irlap_unitdata_request(lap->irlap, clone_skb);
-		
+
 		lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
 	}
 	dev_kfree_skb(skb);
@@ -1165,9 +1156,9 @@
  *
  */
 #ifdef CONFIG_IRDA_ULTRA
-void irlmp_connless_data_indication(struct lsap_cb *self, struct sk_buff *skb) 
+void irlmp_connless_data_indication(struct lsap_cb *self, struct sk_buff *skb)
 {
- 	IRDA_DEBUG(4, __FUNCTION__ "()\n"); 
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
@@ -1184,7 +1175,7 @@
 }
 #endif /* CONFIG_IRDA_ULTRA */
 
-void irlmp_status_request(void) 
+void irlmp_status_request(void)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented\n");
 }
@@ -1197,7 +1188,7 @@
  * Jean II
  */
 void irlmp_status_indication(struct lap_cb *self,
-			     LINK_STATUS link, LOCK_STATUS lock) 
+			     LINK_STATUS link, LOCK_STATUS lock)
 {
 	struct lsap_cb *next;
 	struct lsap_cb *curr;
@@ -1213,7 +1204,7 @@
 		 *  Inform service user if he has requested it
 		 */
 		if (curr->notify.status_indication != NULL)
-			curr->notify.status_indication(curr->notify.instance, 
+			curr->notify.status_indication(curr->notify.instance,
 						       link, lock);
 		else
 			IRDA_DEBUG(2, __FUNCTION__ "(), no handler\n");
@@ -1279,7 +1270,7 @@
 
 		/* Inform lsap user that it can send one more packet. */
 		if (curr->notify.flow_indication != NULL)
-			curr->notify.flow_indication(curr->notify.instance, 
+			curr->notify.flow_indication(curr->notify.instance,
 						     curr, flow);
 		else
 			IRDA_DEBUG(1, __FUNCTION__ "(), no handler\n");
@@ -1297,8 +1288,8 @@
 	__u8 *service;
 	int i = 0;
 
-	/* 
-	 * Allocate array to store services in. 16 entries should be safe 
+	/*
+	 * Allocate array to store services in. 16 entries should be safe
 	 * since we currently only support 2 hint bytes
 	 */
 	service = kmalloc(16, GFP_ATOMIC);
@@ -1327,10 +1318,10 @@
 	if (hint[0] & HINT_FAX)
 		IRDA_DEBUG(1, "Fax ");
 	if (hint[0] & HINT_LAN) {
-		IRDA_DEBUG(1, "LAN Access ");		
+		IRDA_DEBUG(1, "LAN Access ");
 		service[i++] = S_LAN;
 	}
-	/* 
+	/*
 	 *  Test if extension byte exists. This byte will usually be
 	 *  there, but this is not really required by the standard.
 	 *  (IrLMP p. 29)
@@ -1341,7 +1332,7 @@
 			service[i++] = S_TELEPHONY;
 		} if (hint[1] & HINT_FILE_SERVER)
 			IRDA_DEBUG(1, "File Server ");
-		
+
 		if (hint[1] & HINT_COMM) {
 			IRDA_DEBUG(1, "IrCOMM ");
 			service[i++] = S_COMM;
@@ -1357,7 +1348,7 @@
 	service[i++] = S_ANY;
 
 	service[i] = S_END;
-	
+
 	return service;
 }
 
@@ -1436,7 +1427,7 @@
 	irlmp->hints.word |= hints;
 
 	/* Make a new registration */
- 	service = kmalloc(sizeof(irlmp_service_t), GFP_ATOMIC);
+	service = kmalloc(sizeof(irlmp_service_t), GFP_ATOMIC);
 	if (!service) {
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unable to kmalloc!\n");
 		return 0;
@@ -1450,19 +1441,19 @@
 /*
  * Function irlmp_unregister_service (handle)
  *
- *    Unregister service with IrLMP. 
+ *    Unregister service with IrLMP.
  *
  *    Returns: 0 on success, -1 on error
  */
 int irlmp_unregister_service(__u32 handle)
 {
 	irlmp_service_t *service;
-		
- 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	if (!handle)
 		return -1;
- 
+
 	service = hashbin_find(irlmp->services, handle, NULL);
 	if (!service) {
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown service!\n");
@@ -1503,14 +1494,14 @@
 
 	IRDA_DEBUG(1, __FUNCTION__ "()\n");
 	ASSERT(irlmp != NULL, return 0;);
-	
+
 	/* Get a unique handle for this client */
 	get_random_bytes(&handle, sizeof(handle));
 	while (hashbin_find(irlmp->clients, handle, NULL) || !handle)
 		get_random_bytes(&handle, sizeof(handle));
 
 	/* Make a new registration */
- 	client = kmalloc(sizeof(irlmp_client_t), GFP_ATOMIC);
+	client = kmalloc(sizeof(irlmp_client_t), GFP_ATOMIC);
 	if (!client) {
 		IRDA_DEBUG( 1, __FUNCTION__ "(), Unable to kmalloc!\n");
 		return 0;
@@ -1522,7 +1513,7 @@
 	client->expir_callback = expir_clb;
 	client->priv = priv;
 
- 	hashbin_insert(irlmp->clients, (irda_queue_t *) client, handle, NULL);
+	hashbin_insert(irlmp->clients, (irda_queue_t *) client, handle, NULL);
 
 	return handle;
 }
@@ -1535,8 +1526,8 @@
  *
  *    Returns: 0 on success, -1 on error
  */
-int irlmp_update_client(__u32 handle, __u16 hint_mask, 
-			DISCOVERY_CALLBACK1 disco_clb, 
+int irlmp_update_client(__u32 handle, __u16 hint_mask,
+			DISCOVERY_CALLBACK1 disco_clb,
 			DISCOVERY_CALLBACK1 expir_clb, void *priv)
 {
 	irlmp_client_t *client;
@@ -1554,7 +1545,7 @@
 	client->disco_callback = disco_clb;
 	client->expir_callback = expir_clb;
 	client->priv = priv;
-	
+
 	return 0;
 }
 
@@ -1566,13 +1557,13 @@
  */
 int irlmp_unregister_client(__u32 handle)
 {
- 	struct irlmp_client *client;
- 
- 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	struct irlmp_client *client;
+
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	if (!handle)
 		return -1;
- 
+
 	client = hashbin_find(irlmp->clients, handle, NULL);
 	if (!client) {
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown client!\n");
@@ -1583,7 +1574,7 @@
 	client = hashbin_remove( irlmp->clients, handle, NULL);
 	if (client)
 		kfree(client);
-	
+
 	return 0;
 }
 
@@ -1628,13 +1619,13 @@
 
 			if ((self->slsap_sel == slsap_sel)) {
 				IRDA_DEBUG(4, "Source LSAP selector=%02x in use\n",
-				      self->slsap_sel); 
+				      self->slsap_sel);
 				return TRUE;
 			}
 			self = (struct lsap_cb*) hashbin_get_next(lap->lsaps);
 		}
 		lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
-	}     
+	}
 	return FALSE;
 }
 
@@ -1644,16 +1635,16 @@
  *    Find a free source LSAP to use. This function is called if the service
  *    user has requested a source LSAP equal to LM_ANY
  */
-__u8 irlmp_find_free_slsap(void) 
+__u8 irlmp_find_free_slsap(void)
 {
 	__u8 lsap_sel;
 	int wrapped = 0;
 
 	ASSERT(irlmp != NULL, return -1;);
 	ASSERT(irlmp->magic == LMP_MAGIC, return -1;);
-      
+
 	lsap_sel = irlmp->free_lsap_sel++;
-	
+
 	/* Check if the new free lsap is really free */
 	while (irlmp_slsap_inuse(irlmp->free_lsap_sel)) {
 		irlmp->free_lsap_sel++;
@@ -1668,7 +1659,7 @@
 		}
 	}
 	IRDA_DEBUG(4, __FUNCTION__ "(), next free lsap_sel=%02x\n", lsap_sel);
-	
+
 	return lsap_sel;
 }
 
@@ -1683,7 +1674,7 @@
 {
 	int reason = LM_LAP_DISCONNECT;
 
-	switch (lap_reason) {		
+	switch (lap_reason) {
 	case LAP_DISC_INDICATION: /* Received a disconnect request from peer */
 		IRDA_DEBUG( 1, __FUNCTION__ "(), LAP_DISC_INDICATION\n");
 		reason = LM_USER_REQUEST;
@@ -1703,14 +1694,14 @@
 		reason = LM_CONNECT_FAILURE;
 		break;
 	default:
-		IRDA_DEBUG(1, __FUNCTION__ 
+		IRDA_DEBUG(1, __FUNCTION__
 		      "(), Unknow IrLAP disconnect reason %d!\n", lap_reason);
 		reason = LM_LAP_DISCONNECT;
 		break;
 	}
 
 	return reason;
-}	
+}
 
 __u32 irlmp_get_saddr(struct lsap_cb *self)
 {
@@ -1724,7 +1715,7 @@
 {
 	ASSERT(self != NULL, return 0;);
 	ASSERT(self->lap != NULL, return 0;);
-	
+
 	return self->lap->daddr;
 }
 
@@ -1742,37 +1733,37 @@
 	unsigned long flags;
 
 	ASSERT(irlmp != NULL, return 0;);
-	
+
 	save_flags( flags);
 	cli();
 
 	len = 0;
-	
+
 	len += sprintf( buf+len, "Unconnected LSAPs:\n");
 	self = (struct lsap_cb *) hashbin_get_first( irlmp->unconnected_lsaps);
 	while (self != NULL) {
 		ASSERT(self->magic == LMP_LSAP_MAGIC, return 0;);
-		len += sprintf(buf+len, "lsap state: %s, ", 
+		len += sprintf(buf+len, "lsap state: %s, ",
 			       irlsap_state[ self->lsap_state]);
-		len += sprintf(buf+len, 
+		len += sprintf(buf+len,
 			       "slsap_sel: %#02x, dlsap_sel: %#02x, ",
-			       self->slsap_sel, self->dlsap_sel); 
+			       self->slsap_sel, self->dlsap_sel);
 		len += sprintf(buf+len, "(%s)", self->notify.name);
 		len += sprintf(buf+len, "\n");
 
 		self = (struct lsap_cb *) hashbin_get_next(
 			irlmp->unconnected_lsaps);
- 	} 
+	}
 
 	len += sprintf(buf+len, "\nRegistred Link Layers:\n");
 
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	while (lap != NULL) {
-		len += sprintf(buf+len, "lap state: %s, ", 
+		len += sprintf(buf+len, "lap state: %s, ",
 			       irlmp_state[lap->lap_state]);
 
 		len += sprintf(buf+len, "saddr: %#08x, daddr: %#08x, ",
-			       lap->saddr, lap->daddr); 
+			       lap->saddr, lap->daddr);
 		len += sprintf(buf+len, "num lsaps: %d",
 			       HASHBIN_GET_SIZE(lap->lsaps));
 		len += sprintf(buf+len, "\n");
@@ -1781,27 +1772,24 @@
 		self = (struct lsap_cb *) hashbin_get_first(lap->lsaps);
 		while (self != NULL) {
 			ASSERT(self->magic == LMP_LSAP_MAGIC, return 0;);
-			len += sprintf(buf+len, "  lsap state: %s, ", 
+			len += sprintf(buf+len, "  lsap state: %s, ",
 				       irlsap_state[ self->lsap_state]);
-			len += sprintf(buf+len, 
+			len += sprintf(buf+len,
 				       "slsap_sel: %#02x, dlsap_sel: %#02x, ",
 				       self->slsap_sel, self->dlsap_sel);
 			len += sprintf(buf+len, "(%s)", self->notify.name);
 			len += sprintf(buf+len, "\n");
-			
-			self = (struct lsap_cb *) hashbin_get_next( 
+
+			self = (struct lsap_cb *) hashbin_get_next(
 				lap->lsaps);
-		} 
+		}
 		len += sprintf(buf+len, "\n");
 
 		lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
- 	} 
+	}
 	restore_flags(flags);
-	
+
 	return len;
 }
 
 #endif /* PROC_FS */
-
-
-
#43 lore raw

PATCH 1/1 2.5.21 kill warinigs 14/19

In reply to Linus Torvalds

irlap_frame this time. Let me guess they used emacs?!

net/irda/irlap_frame.c +192 -193
diff -urN linux-2.5.21/net/irda/irlap_frame.c linux/net/irda/irlap_frame.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      irlap_frame.c
  * Version:       1.0
  * Description:   Build and transmit IrLAP frames
@@ -8,18 +8,18 @@
  * Created at:    Tue Aug 19 10:27:26 1997
  * Modified at:   Wed Jan  5 08:59:04 2000
  * Modified by:   Dag Brattli <[email protected]>
- * 
- *     Copyright (c) 1998-2000 Dag Brattli <[email protected]>, 
+ *
+ *     Copyright (c) 1998-2000 Dag Brattli <[email protected]>,
  *     All Rights Reserved.
  *     Copyright (c) 2000-2001 Jean Tourrilhes <[email protected]>
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
  ********************************************************************/
@@ -29,10 +29,10 @@
 #include <linux/if_ether.h>
 #include <linux/netdevice.h>
 #include <linux/irda.h>
- 
+
 #include <net/pkt_sched.h>
 #include <net/sock.h>
- 
+
 #include <asm/byteorder.h>
 
 #include <net/irda/irda.h>
@@ -46,18 +46,18 @@
 /*
  * Function irlap_insert_info (self, skb)
  *
- *    Insert minimum turnaround time and speed information into the skb. We 
+ *    Insert minimum turnaround time and speed information into the skb. We
  *    need to do this since it's per packet relevant information. Safe to
  *    have this function inlined since it's only called from one place
  */
-static inline void irlap_insert_info(struct irlap_cb *self, 
+static inline void irlap_insert_info(struct irlap_cb *self,
 				     struct sk_buff *skb)
 {
 	struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb;
 
-	/*  
+	/*
 	 * Insert MTT (min. turn time) and speed into skb, so that the
-	 * device driver knows which settings to use 
+	 * device driver knows which settings to use
 	 */
 	cb->magic = LAP_MAGIC;
 	cb->mtt = self->mtt_required;
@@ -65,15 +65,15 @@
 
 	/* Reset */
 	self->mtt_required = 0;
-	
-	/* 
-	 * Delay equals negotiated BOFs count, plus the number of BOFs to 
-	 * force the negotiated minimum turnaround time 
+
+	/*
+	 * Delay equals negotiated BOFs count, plus the number of BOFs to
+	 * force the negotiated minimum turnaround time
 	 */
 	cb->xbofs = self->bofs_count;
 	cb->next_xbofs = self->next_bofs;
 	cb->xbofs_delay = self->xbofs_delay;
-	
+
 	/* Reset XBOF's delay (used only for getting min turn time) */
 	self->xbofs_delay = 0;
 	/* Put the correct xbofs value for the next packet */
@@ -91,7 +91,7 @@
 	/* Some common init stuff */
 	skb->dev = self->netdev;
 	skb->h.raw = skb->nh.raw = skb->mac.raw = skb->data;
- 	skb->protocol = htons(ETH_P_IRDA);
+	skb->protocol = htons(ETH_P_IRDA);
 	skb->priority = TC_PRIO_BESTEFFORT;
 
 	irlap_insert_info(self, skb);
@@ -104,7 +104,7 @@
  *
  *    Transmits a connect SNRM command frame
  */
-void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos) 
+void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos)
 {
 	struct sk_buff *skb;
 	struct snrm_frame *frame;
@@ -118,7 +118,7 @@
 	if (!skb)
 		return;
 
-	frame = (struct snrm_frame *) skb_put(skb, 2); 
+	frame = (struct snrm_frame *) skb_put(skb, 2);
 
 	/* Insert connection address field */
 	if (qos)
@@ -127,10 +127,10 @@
 		frame->caddr = CMD_FRAME | self->caddr;
 
 	/* Insert control field */
- 	frame->control = SNRM_CMD | PF_BIT;
-	
+	frame->control = SNRM_CMD | PF_BIT;
+
 	/*
-	 *  If we are establishing a connection then insert QoS paramerters 
+	 *  If we are establishing a connection then insert QoS paramerters
 	 */
 	if (qos) {
 		skb_put(skb, 9); /* 21 left */
@@ -138,7 +138,7 @@
 		frame->daddr = cpu_to_le32(self->daddr);
 
 		frame->ncaddr = self->caddr;
-				
+
 		ret = irlap_insert_qos_negotiation_params(self, skb);
 		if (ret < 0) {
 			dev_kfree_skb(skb);
@@ -154,28 +154,28 @@
  *    Received SNRM (Set Normal Response Mode) command frame
  *
  */
-static void irlap_recv_snrm_cmd(struct irlap_cb *self, struct sk_buff *skb, 
-				struct irlap_info *info) 
+static void irlap_recv_snrm_cmd(struct irlap_cb *self, struct sk_buff *skb,
+				struct irlap_info *info)
 {
 	struct snrm_frame *frame;
 
 	frame = (struct snrm_frame *) skb->data;
-	
+
 	if (skb->len >= sizeof(struct snrm_frame)) {
 		/* Copy the new connection address */
 		info->caddr = frame->ncaddr;
 
 		/* Check if the new connection address is valid */
 		if ((info->caddr == 0x00) || (info->caddr == 0xfe)) {
-			IRDA_DEBUG(3, __FUNCTION__ 
+			IRDA_DEBUG(3, __FUNCTION__
 			      "(), invalid connection address!\n");
 			return;
 		}
-		
+
 		/* Copy peer device address */
 		info->daddr = le32_to_cpu(frame->saddr);
 		info->saddr = le32_to_cpu(frame->daddr);
-		
+
 		/* Only accept if addressed directly to us */
 		if (info->saddr != self->saddr) {
 			IRDA_DEBUG(2, __FUNCTION__ "(), not addressed to us!\n");
@@ -199,9 +199,9 @@
 	struct sk_buff *skb;
 	struct ua_frame *frame;
 	int ret;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "() <%ld>\n", jiffies);
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
@@ -213,10 +213,10 @@
 		return;
 
 	frame = (struct ua_frame *) skb_put(skb, 10);
-	
+
 	/* Build UA response */
 	frame->caddr = self->caddr;
- 	frame->control = UA_RSP | PF_BIT;
+	frame->control = UA_RSP | PF_BIT;
 
 	frame->saddr = cpu_to_le32(self->saddr);
 	frame->daddr = cpu_to_le32(self->daddr);
@@ -244,7 +244,7 @@
 {
 	struct sk_buff *skb = NULL;
 	__u8 *frame;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
@@ -253,7 +253,7 @@
 		return;
 
 	frame = skb_put( skb, 2);
-	
+
 	if (self->state == LAP_NDM)
 		frame[0] = CBROADCAST;
 	else
@@ -261,7 +261,7 @@
 
 	frame[1] = DM_RSP | PF_BIT;
 
-	irlap_queue_xmit(self, skb);	
+	irlap_queue_xmit(self, skb);
 }
 
 /*
@@ -270,11 +270,11 @@
  *    Send disconnect (DISC) frame
  *
  */
-void irlap_send_disc_frame(struct irlap_cb *self) 
+void irlap_send_disc_frame(struct irlap_cb *self)
 {
 	struct sk_buff *skb = NULL;
 	__u8 *frame;
-	
+
 	IRDA_DEBUG(3, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
@@ -285,7 +285,7 @@
 		return;
 
 	frame = skb_put(skb, 2);
-	
+
 	frame[0] = self->caddr | CMD_FRAME;
 	frame[1] = DISC_CMD | PF_BIT;
 
@@ -296,17 +296,17 @@
  * Function irlap_send_discovery_xid_frame (S, s, command)
  *
  *    Build and transmit a XID (eXchange station IDentifier) discovery
- *    frame. 
+ *    frame.
  */
-void irlap_send_discovery_xid_frame(struct irlap_cb *self, int S, __u8 s, 
-				    __u8 command, discovery_t *discovery) 
+void irlap_send_discovery_xid_frame(struct irlap_cb *self, int S, __u8 s,
+				    __u8 command, discovery_t *discovery)
 {
 	struct sk_buff *skb = NULL;
 	struct xid_frame *frame;
 	__u32 bcast = BROADCAST;
 	__u8 *info;
 
- 	IRDA_DEBUG(4, __FUNCTION__ "(), s=%d, S=%d, command=%d\n", s, S, 
+	IRDA_DEBUG(4, __FUNCTION__ "(), s=%d, S=%d, command=%d\n", s, S,
 		   command);
 
 	ASSERT(self != NULL, return;);
@@ -335,7 +335,7 @@
 		frame->daddr = cpu_to_le32(bcast);
 	else
 		frame->daddr = cpu_to_le32(discovery->daddr);
-	
+
 	switch (S) {
 	case 1:
 		frame->flags = 0x00;
@@ -354,10 +354,10 @@
 		break;
 	}
 
-	frame->slotnr = s; 
+	frame->slotnr = s;
 	frame->version = 0x00;
 
-	/*  
+	/*
 	 *  Provide info for final slot only in commands, and for all
 	 *  responses. Send the second byte of the hint only if the
 	 *  EXTENSION bit is set in the first byte.
@@ -366,7 +366,7 @@
 		int len;
 
 		if (discovery->hints.byte[0] & HINT_EXTENSION) {
-			info = skb_put(skb, 2);		
+			info = skb_put(skb, 2);
 			info[0] = discovery->hints.byte[0];
 			info[1] = discovery->hints.byte[1];
 		} else {
@@ -379,7 +379,7 @@
 		len = IRDA_MIN(discovery->name_len, skb_tailroom(skb));
 		info = skb_put(skb, len);
 		memcpy(info, discovery->nickname, len);
-	} 
+	}
 	irlap_queue_xmit(self, skb);
 }
 
@@ -389,9 +389,9 @@
  *    Received a XID discovery response
  *
  */
-static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, 
-					 struct sk_buff *skb, 
-					 struct irlap_info *info) 
+static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self,
+					 struct sk_buff *skb,
+					 struct irlap_info *info)
 {
 	struct xid_frame *xid;
 	discovery_t *discovery = NULL;
@@ -410,13 +410,13 @@
 
 	/* Make sure frame is addressed to us */
 	if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) {
-		IRDA_DEBUG(0, __FUNCTION__ 
+		IRDA_DEBUG(0, __FUNCTION__
 			   "(), frame is not addressed to us!\n");
 		return;
 	}
 
 	if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) {
-		WARNING(__FUNCTION__ "(), kmalloc failed!\n");
+		WARNING("%s: kmalloc failed!\n", __FUNCTION__);
 		return;
 	}
 	memset(discovery, 0, sizeof(discovery_t));
@@ -441,11 +441,11 @@
 		discovery->charset = discovery_info[1];
 		text = (char *) &discovery_info[2];
 	}
-	/* 
-	 *  Terminate info string, should be safe since this is where the 
+	/*
+	 *  Terminate info string, should be safe since this is where the
 	 *  FCS bytes resides.
 	 */
-	skb->data[skb->len] = '\0'; 
+	skb->data[skb->len] = '\0';
 	strncpy(discovery->nickname, text, NICKNAME_MAX_LEN);
 	discovery->name_len = strlen(discovery->nickname);
 
@@ -460,9 +460,9 @@
  *    Received a XID discovery command
  *
  */
-static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, 
-					 struct sk_buff *skb, 
-					 struct irlap_info *info) 
+static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
+					 struct sk_buff *skb,
+					 struct irlap_info *info)
 {
 	struct xid_frame *xid;
 	discovery_t *discovery = NULL;
@@ -476,7 +476,7 @@
 
 	/* Make sure frame is addressed to us */
 	if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) {
-		IRDA_DEBUG(0, __FUNCTION__ 
+		IRDA_DEBUG(0, __FUNCTION__
 			   "(), frame is not addressed to us!\n");
 		return;
 	}
@@ -500,16 +500,16 @@
 		return;
 	}
 	info->s = xid->slotnr;
-	
+
 	discovery_info = skb_pull(skb, sizeof(struct xid_frame));
 
-	/* 
-	 *  Check if last frame 
+	/*
+	 *  Check if last frame
 	 */
 	if (info->s == 0xff) {
 		/* Check if things are sane at this point... */
 		if((discovery_info == NULL) || (skb->len < 3)) {
-			ERROR(__FUNCTION__ "(), discovery frame to short!\n");
+			ERROR("%s: discovery frame to short!\n", __FUNCTION__);
 			return;
 		}
 
@@ -518,10 +518,10 @@
 		 */
 		discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC);
 		if (!discovery) {
-			WARNING(__FUNCTION__ "(), unable to malloc!\n");
+			WARNING("%s: unable to malloc!\n", __FUNCTION__);
 			return;
 		}
-	      
+
 		discovery->daddr = info->daddr;
 		discovery->saddr = self->saddr;
 		discovery->timestamp = jiffies;
@@ -536,11 +536,11 @@
 			discovery->charset = discovery_info[1];
 			text = (char *) &discovery_info[2];
 		}
-		/* 
-		 *  Terminate string, should be safe since this is where the 
+		/*
+		 *  Terminate string, should be safe since this is where the
 		 *  FCS bytes resides.
 		 */
-		skb->data[skb->len] = '\0'; 
+		skb->data[skb->len] = '\0';
 		strncpy(discovery->nickname, text, NICKNAME_MAX_LEN);
 		discovery->name_len = strlen(discovery->nickname);
 
@@ -557,7 +557,7 @@
  *    Build and transmit RR (Receive Ready) frame. Notice that it is currently
  *    only possible to send RR frames with the poll bit set.
  */
-void irlap_send_rr_frame(struct irlap_cb *self, int command) 
+void irlap_send_rr_frame(struct irlap_cb *self, int command)
 {
 	struct sk_buff *skb;
 	__u8 *frame;
@@ -565,9 +565,9 @@
 	skb = dev_alloc_skb(16);
 	if (!skb)
 		return;
-	
+
 	frame = skb_put(skb, 2);
-	
+
 	frame[0] = self->caddr;
 	frame[0] |= (command) ? CMD_FRAME : 0;
 
@@ -579,7 +579,7 @@
 /*
  * Function irlap_send_rd_frame (self)
  *
- *    Request disconnect. Used by a secondary station to request the 
+ *    Request disconnect. Used by a secondary station to request the
  *    disconnection of the link.
  */
 void irlap_send_rd_frame(struct irlap_cb *self)
@@ -590,9 +590,9 @@
 	skb = dev_alloc_skb(16);
 	if (!skb)
 		return;
-	
+
 	frame = skb_put(skb, 2);
-	
+
 	frame[0] = self->caddr;
 	frame[1] = RD_RSP | PF_BIT;
 
@@ -606,8 +606,8 @@
  *    making it inline since its called only from one single place
  *    (irlap_driver_rcv).
  */
-static inline void irlap_recv_rr_frame(struct irlap_cb *self, 
-				       struct sk_buff *skb, 
+static inline void irlap_recv_rr_frame(struct irlap_cb *self,
+				       struct sk_buff *skb,
 				       struct irlap_info *info, int command)
 {
 	info->nr = skb->data[1] >> 5;
@@ -623,7 +623,7 @@
 {
 	struct sk_buff *skb = NULL;
 	__u8 *frame;
-	
+
 	ASSERT( self != NULL, return;);
 	ASSERT( self->magic == LAP_MAGIC, return;);
 
@@ -632,7 +632,7 @@
 		return;
 
 	frame = skb_put( skb, 2);
-	
+
 	frame[0] = self->caddr;
 	frame[0] |= (command) ? CMD_FRAME : 0;
 
@@ -642,7 +642,7 @@
 
 	frame[2] = 0;
 
-   	IRDA_DEBUG(4, __FUNCTION__ "(), vr=%d, %ld\n",self->vr, jiffies); 
+	IRDA_DEBUG(4, __FUNCTION__ "(), vr=%d, %ld\n",self->vr, jiffies);
 
 	irlap_queue_xmit(self, skb);
 }
@@ -653,8 +653,8 @@
  *    Received RNR (Receive Not Ready) frame from peer station
  *
  */
-static void irlap_recv_rnr_frame(struct irlap_cb *self, struct sk_buff *skb, 
-				 struct irlap_info *info, int command) 
+static void irlap_recv_rnr_frame(struct irlap_cb *self, struct sk_buff *skb,
+				 struct irlap_info *info, int command)
 {
 	info->nr = skb->data[1] >> 5;
 
@@ -666,13 +666,13 @@
 		irlap_do_event(self, RECV_RNR_RSP, skb, info);
 }
 
-static void irlap_recv_rej_frame(struct irlap_cb *self, struct sk_buff *skb, 
+static void irlap_recv_rej_frame(struct irlap_cb *self, struct sk_buff *skb,
 				 struct irlap_info *info, int command)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
 
 	info->nr = skb->data[1] >> 5;
-	
+
 	/* Check if this is a command or a response frame */
 	if (command)
 		irlap_do_event(self, RECV_REJ_CMD, skb, info);
@@ -680,13 +680,13 @@
 		irlap_do_event(self, RECV_REJ_RSP, skb, info);
 }
 
-static void irlap_recv_srej_frame(struct irlap_cb *self, struct sk_buff *skb, 
+static void irlap_recv_srej_frame(struct irlap_cb *self, struct sk_buff *skb,
 				  struct irlap_info *info, int command)
 {
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
 
 	info->nr = skb->data[1] >> 5;
-	
+
 	/* Check if this is a command or a response frame */
 	if (command)
 		irlap_do_event(self, RECV_SREJ_CMD, skb, info);
@@ -694,7 +694,7 @@
 		irlap_do_event(self, RECV_SREJ_RSP, skb, info);
 }
 
-static void irlap_recv_disc_frame(struct irlap_cb *self, struct sk_buff *skb, 
+static void irlap_recv_disc_frame(struct irlap_cb *self, struct sk_buff *skb,
 				  struct irlap_info *info, int command)
 {
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
@@ -712,9 +712,9 @@
  *    Received UA (Unnumbered Acknowledgement) frame
  *
  */
-static inline void irlap_recv_ua_frame(struct irlap_cb *self, 
-				       struct sk_buff *skb, 
-				       struct irlap_info *info) 
+static inline void irlap_recv_ua_frame(struct irlap_cb *self,
+				       struct sk_buff *skb,
+				       struct irlap_info *info)
 {
 	irlap_do_event(self, RECV_UA_RSP, skb, info);
 }
@@ -731,25 +731,25 @@
 
 	if (skb->data[1] == I_FRAME) {
 
-		/*  
+		/*
 		 *  Insert frame sequence number (Vs) in control field before
 		 *  inserting into transmit window queue.
 		 */
 		skb->data[1] = I_FRAME | (self->vs << 1);
-		
+
 		/* Copy buffer */
 		tx_skb = skb_clone(skb, GFP_ATOMIC);
 		if (tx_skb == NULL) {
 			return;
 		}
-		
-		/* 
-		 *  Insert frame in store, in case of retransmissions 
+
+		/*
+		 *  Insert frame in store, in case of retransmissions
 		 */
 		skb_queue_tail(&self->wx_list, skb_get(skb));
-		
+
 		self->vs = (self->vs + 1) % 8;
-		self->ack_required = FALSE;		
+		self->ack_required = FALSE;
 		self->window -= 1;
 
 		irlap_send_i_frame( self, tx_skb, CMD_FRAME);
@@ -764,40 +764,40 @@
  *
  *    Send I(nformation) frame as primary with poll bit set
  */
-void irlap_send_data_primary_poll(struct irlap_cb *self, struct sk_buff *skb) 
+void irlap_send_data_primary_poll(struct irlap_cb *self, struct sk_buff *skb)
 {
 	struct sk_buff *tx_skb;
 
 	/* Stop P timer */
 	del_timer(&self->poll_timer);
-		
+
 	/* Is this reliable or unreliable data? */
 	if (skb->data[1] == I_FRAME) {
-		
-		/*  
+
+		/*
 		 *  Insert frame sequence number (Vs) in control field before
 		 *  inserting into transmit window queue.
 		 */
 		skb->data[1] = I_FRAME | (self->vs << 1);
-		
+
 		/* Copy buffer */
 		tx_skb = skb_clone(skb, GFP_ATOMIC);
 		if (tx_skb == NULL) {
 			return;
 		}
-		
-		/* 
-		 *  Insert frame in store, in case of retransmissions 
+
+		/*
+		 *  Insert frame in store, in case of retransmissions
 		 */
 		skb_queue_tail(&self->wx_list, skb_get(skb));
-		
-		/*  
+
+		/*
 		 *  Set poll bit if necessary. We do this to the copied
 		 *  skb, since retransmitted need to set or clear the poll
-		 *  bit depending on when they are sent.  
+		 *  bit depending on when they are sent.
 		 */
 		tx_skb->data[1] |= PF_BIT;
-		
+
 		self->vs = (self->vs + 1) % 8;
 		self->ack_required = FALSE;
 
@@ -830,8 +830,8 @@
  *    Send I(nformation) frame as secondary with final bit set
  *
  */
-void irlap_send_data_secondary_final(struct irlap_cb *self, 
-				     struct sk_buff *skb) 
+void irlap_send_data_secondary_final(struct irlap_cb *self,
+				     struct sk_buff *skb)
 {
 	struct sk_buff *tx_skb = NULL;
 
@@ -842,26 +842,26 @@
 	/* Is this reliable or unreliable data? */
 	if (skb->data[1] == I_FRAME) {
 
-		/*  
+		/*
 		 *  Insert frame sequence number (Vs) in control field before
 		 *  inserting into transmit window queue.
 		 */
 		skb->data[1] = I_FRAME | (self->vs << 1);
-		
+
 		tx_skb = skb_clone(skb, GFP_ATOMIC);
 		if (tx_skb == NULL) {
 			return;
-		}		
+		}
 
 		/* Insert frame in store */
 		skb_queue_tail(&self->wx_list, skb_get(skb));
-		
+
 		tx_skb->data[1] |= PF_BIT;
-		
-		self->vs = (self->vs + 1) % 8; 
+
+		self->vs = (self->vs + 1) % 8;
 		self->ack_required = FALSE;
-		
-		irlap_send_i_frame(self, tx_skb, RSP_FRAME); 
+
+		irlap_send_i_frame(self, tx_skb, RSP_FRAME);
 	} else {
 		if (self->ack_required) {
 			irlap_send_ui_frame(self, skb_get(skb), self->caddr, RSP_FRAME);
@@ -888,32 +888,32 @@
  *    Send I(nformation) frame as secondary without final bit set
  *
  */
-void irlap_send_data_secondary(struct irlap_cb *self, struct sk_buff *skb) 
+void irlap_send_data_secondary(struct irlap_cb *self, struct sk_buff *skb)
 {
 	struct sk_buff *tx_skb = NULL;
 
 	/* Is this reliable or unreliable data? */
 	if (skb->data[1] == I_FRAME) {
-		
-		/*  
+
+		/*
 		 *  Insert frame sequence number (Vs) in control field before
 		 *  inserting into transmit window queue.
 		 */
 		skb->data[1] = I_FRAME | (self->vs << 1);
-		
+
 		tx_skb = skb_clone(skb, GFP_ATOMIC);
 		if (tx_skb == NULL) {
 			return;
-		}		
-		
+		}
+
 		/* Insert frame in store */
 		skb_queue_tail(&self->wx_list, skb_get(skb));
-		
+
 		self->vs = (self->vs + 1) % 8;
-		self->ack_required = FALSE;		
+		self->ack_required = FALSE;
 		self->window -= 1;
 
-		irlap_send_i_frame(self, tx_skb, RSP_FRAME); 
+		irlap_send_i_frame(self, tx_skb, RSP_FRAME);
 	} else {
 		irlap_send_ui_frame(self, skb_get(skb), self->caddr, RSP_FRAME);
 		self->window -= 1;
@@ -923,8 +923,8 @@
 /*
  * Function irlap_resend_rejected_frames (nr)
  *
- *    Resend frames which has not been acknowledged. Should be safe to 
- *    traverse the list without locking it since this function will only be 
+ *    Resend frames which has not been acknowledged. Should be safe to
+ *    traverse the list without locking it since this function will only be
  *    called from interrupt context (BH)
  */
 void irlap_resend_rejected_frames(struct irlap_cb *self, int command)
@@ -946,8 +946,8 @@
 	while (skb != NULL) {
 		irlap_wait_min_turn_around(self, &self->qos_tx);
 
-		/* We copy the skb to be retransmitted since we will have to 
-		 * modify it. Cloning will confuse packet sniffers 
+		/* We copy the skb to be retransmitted since we will have to
+		 * modify it. Cloning will confuse packet sniffers
 		 */
 		/* tx_skb = skb_clone( skb, GFP_ATOMIC); */
 		tx_skb = skb_copy(skb, GFP_ATOMIC);
@@ -962,17 +962,17 @@
 		/* Clear old Nr field + poll bit */
 		tx_skb->data[1] &= 0x0f;
 
-		/* 
+		/*
 		 *  Set poll bit on the last frame retransmitted
 		 */
-	 	if (count-- == 1)
-	 		tx_skb->data[1] |= PF_BIT; /* Set p/f bit */
+		if (count-- == 1)
+			tx_skb->data[1] |= PF_BIT; /* Set p/f bit */
 		else
 			tx_skb->data[1] &= ~PF_BIT; /* Clear p/f bit */
-	      	
+
 		irlap_send_i_frame(self, tx_skb, command);
 
-		/* 
+		/*
 		 *  If our skb is the last buffer in the list, then
 		 *  we are finished, if not, move to the next sk-buffer
 		 */
@@ -982,23 +982,23 @@
 			skb = skb->next;
 	}
 #if 0 /* Not yet */
-	/* 
+	/*
 	 *  We can now fill the window with additinal data frames
 	 */
 	while (skb_queue_len( &self->txq) > 0) {
-		
+
 		IRDA_DEBUG(0, __FUNCTION__ "(), sending additional frames!\n");
-		if ((skb_queue_len( &self->txq) > 0) && 
+		if ((skb_queue_len( &self->txq) > 0) &&
 		    (self->window > 0)) {
-			skb = skb_dequeue( &self->txq); 
+			skb = skb_dequeue( &self->txq);
 			ASSERT(skb != NULL, return;);
 
 			/*
-			 *  If send window > 1 then send frame with pf 
+			 *  If send window > 1 then send frame with pf
 			 *  bit cleared
-			 */ 
-			if ((self->window > 1) && 
-			    skb_queue_len(&self->txq) > 0) 
+			 */
+			if ((self->window > 1) &&
+			    skb_queue_len(&self->txq) > 0)
 			{
 				irlap_send_data_primary(self, skb);
 			} else {
@@ -1026,14 +1026,14 @@
 	if (skb != NULL) {
 		irlap_wait_min_turn_around(self, &self->qos_tx);
 
-		/* We copy the skb to be retransmitted since we will have to 
-		 * modify it. Cloning will confuse packet sniffers 
+		/* We copy the skb to be retransmitted since we will have to
+		 * modify it. Cloning will confuse packet sniffers
 		 */
 		/* tx_skb = skb_clone( skb, GFP_ATOMIC); */
 		tx_skb = skb_copy(skb, GFP_ATOMIC);
 		if (!tx_skb) {
 			IRDA_DEBUG(0, __FUNCTION__ "(), unable to copy\n");
-			return;	
+			return;
 		}
 		/* Unlink tx_skb from list */
 		tx_skb->next = tx_skb->prev = NULL;
@@ -1044,7 +1044,7 @@
 
 		/*  Set poll/final bit */
 		tx_skb->data[1] |= PF_BIT; /* Set p/f bit */
-	      	
+
 		irlap_send_i_frame(self, tx_skb, command);
 	}
 }
@@ -1055,15 +1055,15 @@
  *    Contruct and transmit an Unnumbered Information (UI) frame
  *
  */
-void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, 
+void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb,
 			 __u8 caddr, int command)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 	ASSERT(skb != NULL, return;);
-	
+
 	/* Insert connection address */
 	skb->data[0] = caddr | ((command) ? CMD_FRAME : 0);
 
@@ -1075,13 +1075,13 @@
  *
  *    Contruct and transmit Information (I) frame
  */
-void irlap_send_i_frame(struct irlap_cb *self, struct sk_buff *skb, 
-			int command) 
+void irlap_send_i_frame(struct irlap_cb *self, struct sk_buff *skb,
+			int command)
 {
 	/* Insert connection address */
 	skb->data[0] = self->caddr;
 	skb->data[0] |= (command) ? CMD_FRAME : 0;
-	
+
 	/* Insert next to receive (Vr) */
 	skb->data[1] |= (self->vr << 5);  /* insert nr */
 
@@ -1094,9 +1094,9 @@
  *    Receive and parse an I (Information) frame, no harm in making it inline
  *    since it's called only from one single place (irlap_driver_rcv).
  */
-static inline void irlap_recv_i_frame(struct irlap_cb *self, 
-				      struct sk_buff *skb, 
-				      struct irlap_info *info, int command) 
+static inline void irlap_recv_i_frame(struct irlap_cb *self,
+				      struct sk_buff *skb,
+				      struct irlap_info *info, int command)
 {
 	info->nr = skb->data[1] >> 5;          /* Next to receive */
 	info->pf = skb->data[1] & PF_BIT;      /* Final bit */
@@ -1115,7 +1115,7 @@
  *    Receive and parse an Unnumbered Information (UI) frame
  *
  */
-static void irlap_recv_ui_frame(struct irlap_cb *self, struct sk_buff *skb, 
+static void irlap_recv_ui_frame(struct irlap_cb *self, struct sk_buff *skb,
 				struct irlap_info *info)
 {
 	IRDA_DEBUG( 4, __FUNCTION__ "()\n");
@@ -1131,19 +1131,19 @@
  *    Received Frame Reject response.
  *
  */
-static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb, 
-				  struct irlap_info *info) 
+static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb,
+				  struct irlap_info *info)
 {
 	__u8 *frame;
 	int w, x, y, z;
 
 	IRDA_DEBUG(0, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 	ASSERT(skb != NULL, return;);
 	ASSERT(info != NULL, return;);
-	
+
 	frame = skb->data;
 
 	info->nr = frame[2] >> 5;          /* Next to receive */
@@ -1154,11 +1154,11 @@
 	x = frame[3] & 0x02;
 	y = frame[3] & 0x04;
 	z = frame[3] & 0x08;
-	
+
 	if (w) {
 		IRDA_DEBUG(0, "Rejected control field is undefined or not "
 		      "implemented.\n");
-	} 
+	}
 	if (x) {
 		IRDA_DEBUG(0, "Rejected control field was invalid because it "
 		      "contained a non permitted I field.\n");
@@ -1181,7 +1181,7 @@
  *    Send a test frame response
  *
  */
-void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr, 
+void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr,
 			   struct sk_buff *cmd)
 {
 	struct sk_buff *skb;
@@ -1194,7 +1194,7 @@
 
 	/* Broadcast frames must include saddr and daddr fields */
 	if (caddr == CBROADCAST) {
-		frame = (struct test_frame *) 
+		frame = (struct test_frame *)
 			skb_put(skb, sizeof(struct test_frame));
 
 		/* Insert the swapped addresses */
@@ -1221,29 +1221,29 @@
  *    Receive a test frame
  *
  */
-static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb, 
+static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb,
 				  struct irlap_info *info, int command)
 {
 	struct test_frame *frame;
 
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
-	
+
 	frame = (struct test_frame *) skb->data;
-		
+
 	/* Broadcast frames must carry saddr and daddr fields */
 	if (info->caddr == CBROADCAST) {
 		if (skb->len < sizeof(struct test_frame)) {
-			IRDA_DEBUG(0, __FUNCTION__ 
+			IRDA_DEBUG(0, __FUNCTION__
 				   "() test frame to short!\n");
 			return;
 		}
-		
+
 		/* Read and swap addresses */
 		info->daddr = le32_to_cpu(frame->saddr);
 		info->saddr = le32_to_cpu(frame->daddr);
 
 		/* Make sure frame is addressed to us */
-		if ((info->saddr != self->saddr) && 
+		if ((info->saddr != self->saddr) &&
 		    (info->saddr != BROADCAST)) {
 			return;
 		}
@@ -1258,18 +1258,18 @@
 /*
  * Function irlap_driver_rcv (skb, netdev, ptype)
  *
- *    Called when a frame is received. Dispatches the right receive function 
+ *    Called when a frame is received. Dispatches the right receive function
  *    for processing of the frame.
  *
  */
-int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, 
+int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
 		     struct packet_type *ptype)
 {
 	struct irlap_info info;
 	struct irlap_cb *self;
 	int command;
 	__u8 control;
-	
+
 	/* FIXME: should we get our own field? */
 	self = (struct irlap_cb *) dev->atalk_ptr;
 
@@ -1281,14 +1281,14 @@
 
 	/* Check if frame is large enough for parsing */
 	if (skb->len < 2) {
-		ERROR(__FUNCTION__ "(), frame to short!\n");
+		ERROR("%s: frame to short!\n", __FUNCTION__);
 		dev_kfree_skb(skb);
 		return -1;
 	}
-	
+
 	command    = skb->data[0] & CMD_FRAME;
 	info.caddr = skb->data[0] & CBROADCAST;
-	
+
 	info.pf      = skb->data[1] &  PF_BIT;
 	info.control = skb->data[1] & ~PF_BIT; /* Mask away poll/final bit */
 
@@ -1299,7 +1299,7 @@
 		IRDA_DEBUG(0, __FUNCTION__ "(), wrong connection address!\n");
 		goto out;
 	}
-	/*  
+	/*
 	 *  Optimize for the common case and check if the frame is an
 	 *  I(nformation) frame. Only I-frames have bit 0 set to 0
 	 */
@@ -1308,11 +1308,11 @@
 		goto out;
 	}
 	/*
-	 *  We now check is the frame is an S(upervisory) frame. Only 
+	 *  We now check is the frame is an S(upervisory) frame. Only
 	 *  S-frames have bit 0 set to 1 and bit 1 set to 0
 	 */
 	if (~control & 0x02) {
-		/* 
+		/*
 		 *  Received S(upervisory) frame, check which frame type it is
 		 *  only the first nibble is of interest
 		 */
@@ -1330,15 +1330,14 @@
 			irlap_recv_srej_frame(self, skb, &info, command);
 			break;
 		default:
-			WARNING(__FUNCTION__ 
-				"() Unknown S-frame %02x received!\n",
-				info.control);
+			WARNING("%s: Unknown S-frame %02x received!\n",
+				__FUNCTION__, info.control);
 			break;
 		}
 		goto out;
 	}
-	/* 
-	 *  This must be a C(ontrol) frame 
+	/*
+	 *  This must be a C(ontrol) frame
 	 */
 	switch (control) {
 	case XID_RSP:
@@ -1369,11 +1368,11 @@
 		irlap_recv_ui_frame(self, skb, &info);
 		break;
 	default:
-		WARNING(__FUNCTION__ "(), Unknown frame %02x received!\n", 
-			info.control);
+		WARNING("%s: Unknown frame %02x received!\n",
+				__FUNCTION__, info.control);
 		break;
 	}
 out:
-	dev_kfree_skb(skb); 
+	dev_kfree_skb(skb);
 	return 0;
 }
#44 lore raw

PATCH 1/1 2.5.21 kill warnings 16/19

In reply to Linus Torvalds

irlmp_event was abusing __FUCTION__ too.
And of course it appears all red in my gvim as well.

net/irda/irlmp_event.c +131 -131
diff -urN linux-2.5.21/net/irda/irlmp_event.c linux/net/irda/irlmp_event.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      irlmp_event.c
  * Version:       0.8
  * Description:   An IrDA LMP event driver for Linux
@@ -8,18 +8,18 @@
  * Created at:    Mon Aug  4 20:40:53 1997
  * Modified at:   Tue Dec 14 23:04:16 1999
  * Modified by:   Dag Brattli <[email protected]>
- * 
- *     Copyright (c) 1998-1999 Dag Brattli <[email protected]>, 
+ *
+ *     Copyright (c) 1998-1999 Dag Brattli <[email protected]>,
  *     All Rights Reserved.
  *     Copyright (c) 2000-2001 Jean Tourrilhes <[email protected]>
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
  ********************************************************************/
@@ -52,52 +52,52 @@
 #ifdef CONFIG_IRDA_DEBUG
 static const char *irlmp_event[] = {
 	"LM_CONNECT_REQUEST",
- 	"LM_CONNECT_CONFIRM",
+	"LM_CONNECT_CONFIRM",
 	"LM_CONNECT_RESPONSE",
- 	"LM_CONNECT_INDICATION", 	
-	
+	"LM_CONNECT_INDICATION",
+
 	"LM_DISCONNECT_INDICATION",
 	"LM_DISCONNECT_REQUEST",
 
- 	"LM_DATA_REQUEST",
+	"LM_DATA_REQUEST",
 	"LM_UDATA_REQUEST",
- 	"LM_DATA_INDICATION",
+	"LM_DATA_INDICATION",
 	"LM_UDATA_INDICATION",
 
 	"LM_WATCHDOG_TIMEOUT",
 
 	/* IrLAP events */
 	"LM_LAP_CONNECT_REQUEST",
- 	"LM_LAP_CONNECT_INDICATION", 
- 	"LM_LAP_CONNECT_CONFIRM",
- 	"LM_LAP_DISCONNECT_INDICATION", 
+	"LM_LAP_CONNECT_INDICATION",
+	"LM_LAP_CONNECT_CONFIRM",
+	"LM_LAP_DISCONNECT_INDICATION",
 	"LM_LAP_DISCONNECT_REQUEST",
 	"LM_LAP_DISCOVERY_REQUEST",
- 	"LM_LAP_DISCOVERY_CONFIRM",
+	"LM_LAP_DISCOVERY_CONFIRM",
 	"LM_LAP_IDLE_TIMEOUT",
 };
 #endif	/* CONFIG_IRDA_DEBUG */
 
 /* LAP Connection control proto declarations */
-static void irlmp_state_standby  (struct lap_cb *, IRLMP_EVENT, 
+static void irlmp_state_standby  (struct lap_cb *, IRLMP_EVENT,
 				  struct sk_buff *);
-static void irlmp_state_u_connect(struct lap_cb *, IRLMP_EVENT, 
+static void irlmp_state_u_connect(struct lap_cb *, IRLMP_EVENT,
 				  struct sk_buff *);
-static void irlmp_state_active   (struct lap_cb *, IRLMP_EVENT, 
+static void irlmp_state_active   (struct lap_cb *, IRLMP_EVENT,
 				  struct sk_buff *);
 
 /* LSAP Connection control proto declarations */
-static int irlmp_state_disconnected(struct lsap_cb *, IRLMP_EVENT, 
+static int irlmp_state_disconnected(struct lsap_cb *, IRLMP_EVENT,
 				    struct sk_buff *);
-static int irlmp_state_connect     (struct lsap_cb *, IRLMP_EVENT, 
+static int irlmp_state_connect     (struct lsap_cb *, IRLMP_EVENT,
 				    struct sk_buff *);
 static int irlmp_state_connect_pend(struct lsap_cb *, IRLMP_EVENT,
 				    struct sk_buff *);
-static int irlmp_state_dtr         (struct lsap_cb *, IRLMP_EVENT, 
+static int irlmp_state_dtr         (struct lsap_cb *, IRLMP_EVENT,
 				    struct sk_buff *);
-static int irlmp_state_setup       (struct lsap_cb *, IRLMP_EVENT, 
+static int irlmp_state_setup       (struct lsap_cb *, IRLMP_EVENT,
 				    struct sk_buff *);
-static int irlmp_state_setup_pend  (struct lsap_cb *, IRLMP_EVENT, 
+static int irlmp_state_setup_pend  (struct lsap_cb *, IRLMP_EVENT,
 				    struct sk_buff *);
 
 static void (*lap_state[]) (struct lap_cb *, IRLMP_EVENT, struct sk_buff *) =
@@ -118,7 +118,7 @@
 };
 
 static inline void irlmp_next_lap_state(struct lap_cb *self,
-					IRLMP_STATE state) 
+					IRLMP_STATE state)
 {
 	/*
 	IRDA_DEBUG(4, __FUNCTION__ "(), LMP LAP = %s\n", irlmp_state[state]);
@@ -127,7 +127,7 @@
 }
 
 static inline void irlmp_next_lsap_state(struct lsap_cb *self,
-					 LSAP_STATE state) 
+					 LSAP_STATE state)
 {
 	/*
 	ASSERT(self != NULL, return;);
@@ -137,7 +137,7 @@
 }
 
 /* Do connection control events */
-int irlmp_do_lsap_event(struct lsap_cb *self, IRLMP_EVENT event, 
+int irlmp_do_lsap_event(struct lsap_cb *self, IRLMP_EVENT event,
 			struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return -1;);
@@ -155,14 +155,14 @@
  *    Do IrLAP control events
  *
  */
-void irlmp_do_lap_event(struct lap_cb *self, IRLMP_EVENT event, 
-			struct sk_buff *skb) 
+void irlmp_do_lap_event(struct lap_cb *self, IRLMP_EVENT event,
+			struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LMP_LAP_MAGIC, return;);
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(), EVENT = %s, STATE = %s\n",
-		   irlmp_event[event], 
+		   irlmp_event[event],
 		   irlmp_state[self->lap_state]);
 
 	(*lap_state[self->lap_state]) (self, event, skb);
@@ -171,8 +171,8 @@
 void irlmp_discovery_timer_expired(void *data)
 {
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
-	/* We always cleanup the log (active & passive discovery) */ 
+
+	/* We always cleanup the log (active & passive discovery) */
 	irlmp_do_expiry();
 
 	/* Active discovery is conditional */
@@ -186,7 +186,7 @@
 void irlmp_watchdog_timer_expired(void *data)
 {
 	struct lsap_cb *self = (struct lsap_cb *) data;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
@@ -198,7 +198,7 @@
 void irlmp_idle_timer_expired(void *data)
 {
 	struct lap_cb *self = (struct lap_cb *) data;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
@@ -219,20 +219,20 @@
  *    STANDBY, The IrLAP connection does not exist.
  *
  */
-static void irlmp_state_standby(struct lap_cb *self, IRLMP_EVENT event, 
+static void irlmp_state_standby(struct lap_cb *self, IRLMP_EVENT event,
 				struct sk_buff *skb)
-{	
-	IRDA_DEBUG(4, __FUNCTION__ "()\n"); 
+{
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 	ASSERT(self->irlap != NULL, return;);
-	
+
 	switch (event) {
 	case LM_LAP_DISCOVERY_REQUEST:
 		/* irlmp_next_station_state( LMP_DISCOVER); */
-		
+
 		irlap_discovery_request(self->irlap, &irlmp->discovery_cmd);
 		break;
 	case LM_LAP_CONNECT_INDICATION:
-		/*  It's important to switch state first, to avoid IrLMP to 
+		/*  It's important to switch state first, to avoid IrLMP to
 		 *  think that the link is free since IrLMP may then start
 		 *  discovery before the connection is properly set up. DB.
 		 */
@@ -250,16 +250,16 @@
 		irlap_connect_request(self->irlap, self->daddr, NULL, 0);
 		break;
 	case LM_LAP_DISCONNECT_INDICATION:
-		IRDA_DEBUG(4, __FUNCTION__ 
+		IRDA_DEBUG(4, __FUNCTION__
 			   "(), Error LM_LAP_DISCONNECT_INDICATION\n");
-		
+
 		irlmp_next_lap_state(self, LAP_STANDBY);
 		break;
 	default:
 		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
+			dev_kfree_skb(skb);
 		break;
 	}
 }
@@ -271,17 +271,17 @@
  *    since the IrLAP connection does not exist, we must first start an
  *    IrLAP connection. We are now waiting response from IrLAP.
  * */
-static void irlmp_state_u_connect(struct lap_cb *self, IRLMP_EVENT event, 
+static void irlmp_state_u_connect(struct lap_cb *self, IRLMP_EVENT event,
 				  struct sk_buff *skb)
 {
 	struct lsap_cb *lsap;
 	struct lsap_cb *lsap_current;
-	
+
 	IRDA_DEBUG(2, __FUNCTION__ "(), event=%s\n", irlmp_event[event]);
 
 	switch (event) {
 	case LM_LAP_CONNECT_INDICATION:
-		/*  It's important to switch state first, to avoid IrLMP to 
+		/*  It's important to switch state first, to avoid IrLMP to
 		 *  think that the link is free since IrLMP may then start
 		 *  discovery before the connection is properly set up. DB.
 		 */
@@ -331,12 +331,12 @@
 		lsap = (struct lsap_cb *) hashbin_get_first( self->lsaps);
 		while (lsap != NULL ) {
 			ASSERT(lsap->magic == LMP_LSAP_MAGIC, return;);
-			
+
 			lsap_current = lsap;
 
 			/* Be sure to stay one item ahead */
 			lsap = (struct lsap_cb *) hashbin_get_next(self->lsaps);
-			irlmp_do_lsap_event(lsap_current, 
+			irlmp_do_lsap_event(lsap_current,
 					    LM_LAP_DISCONNECT_INDICATION,
 					    NULL);
 		}
@@ -354,9 +354,9 @@
 		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
+			dev_kfree_skb(skb);
 		break;
-	}	
+	}
 }
 
 /*
@@ -365,38 +365,38 @@
  *    ACTIVE, IrLAP connection is active
  *
  */
-static void irlmp_state_active(struct lap_cb *self, IRLMP_EVENT event, 
+static void irlmp_state_active(struct lap_cb *self, IRLMP_EVENT event,
 			       struct sk_buff *skb)
 {
 	struct lsap_cb *lsap;
 	struct lsap_cb *lsap_current;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n"); 
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
- 	switch (event) {
+	switch (event) {
 	case LM_LAP_CONNECT_REQUEST:
 		IRDA_DEBUG(4, __FUNCTION__ "(), LS_CONNECT_REQUEST\n");
 
 		/*
-		 *  LAP connection allready active, just bounce back! Since we 
-		 *  don't know which LSAP that tried to do this, we have to 
+		 *  LAP connection allready active, just bounce back! Since we
+		 *  don't know which LSAP that tried to do this, we have to
 		 *  notify all LSAPs using this LAP, but that should be safe to
 		 *  do anyway.
 		 */
 		lsap = (struct lsap_cb *) hashbin_get_first(self->lsaps);
 		while (lsap != NULL) {
 			irlmp_do_lsap_event(lsap, LM_LAP_CONNECT_CONFIRM, NULL);
- 			lsap = (struct lsap_cb*) hashbin_get_next(self->lsaps);
+			lsap = (struct lsap_cb*) hashbin_get_next(self->lsaps);
 		}
-		
+
 		/* Needed by connect indication */
 		lsap = (struct lsap_cb *) hashbin_get_first(irlmp->unconnected_lsaps);
 		while (lsap != NULL) {
 			lsap_current = lsap;
-			
+
 			/* Be sure to stay one item ahead */
- 			lsap = (struct lsap_cb*) hashbin_get_next(irlmp->unconnected_lsaps);
-			irlmp_do_lsap_event(lsap_current, 
+			lsap = (struct lsap_cb*) hashbin_get_next(irlmp->unconnected_lsaps);
+			irlmp_do_lsap_event(lsap_current,
 					    LM_LAP_CONNECT_CONFIRM, NULL);
 		}
 		/* Keep state */
@@ -404,8 +404,8 @@
 	case LM_LAP_DISCONNECT_REQUEST:
 		/*
 		 *  Need to find out if we should close IrLAP or not. If there
-		 *  is only one LSAP connection left on this link, that LSAP 
-		 *  must be the one that tries to close IrLAP. It will be 
+		 *  is only one LSAP connection left on this link, that LSAP
+		 *  must be the one that tries to close IrLAP. It will be
 		 *  removed later and moved to the list of unconnected LSAPs
 		 */
 		if (HASHBIN_GET_SIZE(self->lsaps) > 0) {
@@ -434,8 +434,8 @@
 		}
 		break;
 	case LM_LAP_DISCONNECT_INDICATION:
-		irlmp_next_lap_state(self, LAP_STANDBY);		
-		
+		irlmp_next_lap_state(self, LAP_STANDBY);
+
 		/* In some case, at this point our side has already closed
 		 * all lsaps, and we are waiting for the idle_timer to
 		 * expire. If another device reconnect immediately, the
@@ -444,18 +444,18 @@
 		 * Therefore, we must stop the timer... */
 		irlmp_stop_idle_timer(self);
 
-		/* 
+		/*
 		 *  Inform all connected LSAP's using this link
 		 */
 		lsap = (struct lsap_cb *) hashbin_get_first(self->lsaps);
 		while (lsap != NULL ) {
 			ASSERT(lsap->magic == LMP_LSAP_MAGIC, return;);
-			
+
 			lsap_current = lsap;
 
 			/* Be sure to stay one item ahead */
 			lsap = (struct lsap_cb *) hashbin_get_next(self->lsaps);
-			irlmp_do_lsap_event(lsap_current, 
+			irlmp_do_lsap_event(lsap_current,
 					    LM_LAP_DISCONNECT_INDICATION,
 					    NULL);
 		}
@@ -473,9 +473,9 @@
 		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
+			dev_kfree_skb(skb);
 		break;
-	}	
+	}
 }
 
 /*********************************************************************
@@ -491,7 +491,7 @@
  *
  */
 static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
-				    struct sk_buff *skb) 
+				    struct sk_buff *skb)
 {
 	int ret = 0;
 
@@ -503,15 +503,15 @@
 	switch (event) {
 #ifdef CONFIG_IRDA_ULTRA
 	case LM_UDATA_INDICATION:
-		irlmp_connless_data_indication(self, skb); 
+		irlmp_connless_data_indication(self, skb);
 		break;
 #endif /* CONFIG_IRDA_ULTRA */
 	case LM_CONNECT_REQUEST:
 		IRDA_DEBUG(4, __FUNCTION__ "(), LM_CONNECT_REQUEST\n");
 
 		if (self->conn_skb) {
-			WARNING(__FUNCTION__ 
-				"(), busy with another request!\n");
+			WARNING("%s: busy with another request!\n",
+					__FUNCTION__);
 			return -EBUSY;
 		}
 		self->conn_skb = skb;
@@ -525,8 +525,8 @@
 		break;
 	case LM_CONNECT_INDICATION:
 		if (self->conn_skb) {
-			WARNING(__FUNCTION__ 
-				"(), busy with another request!\n");
+			WARNING("%s: busy with another request!\n",
+					__FUNCTION__);
 			return -EBUSY;
 		}
 		self->conn_skb = skb;
@@ -549,10 +549,10 @@
 		irlmp_start_watchdog_timer(self, 1*HZ);
 		break;
 	default:
-		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
-  			dev_kfree_skb(skb);
+			dev_kfree_skb(skb);
 		break;
 	}
 	return ret;
@@ -564,34 +564,34 @@
  *    CONNECT
  *
  */
-static int irlmp_state_connect(struct lsap_cb *self, IRLMP_EVENT event, 
-				struct sk_buff *skb) 
+static int irlmp_state_connect(struct lsap_cb *self, IRLMP_EVENT event,
+				struct sk_buff *skb)
 {
 	struct lsap_cb *lsap;
 	int ret = 0;
 
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
 
 	switch (event) {
 	case LM_CONNECT_RESPONSE:
-		/* 
+		/*
 		 *  Bind this LSAP to the IrLAP link where the connect was
-		 *  received 
+		 *  received
 		 */
-		lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, 
+		lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self,
 				      NULL);
 
-		ASSERT(lsap == self, return -1;);		
+		ASSERT(lsap == self, return -1;);
 		ASSERT(self->lap != NULL, return -1;);
 		ASSERT(self->lap->lsaps != NULL, return -1;);
-		
-		hashbin_insert(self->lap->lsaps, (irda_queue_t *) self, (int) self, 
+
+		hashbin_insert(self->lap->lsaps, (irda_queue_t *) self, (int) self,
 			       NULL);
 
-		irlmp_send_lcf_pdu(self->lap, self->dlsap_sel, 
+		irlmp_send_lcf_pdu(self->lap, self->dlsap_sel,
 				   self->slsap_sel, CONNECT_CNF, skb);
 
 		del_timer(&self->watchdog_timer);
@@ -611,7 +611,7 @@
 		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
+			dev_kfree_skb(skb);
 		break;
 	}
 	return ret;
@@ -624,7 +624,7 @@
  *
  */
 static int irlmp_state_connect_pend(struct lsap_cb *self, IRLMP_EVENT event,
-				    struct sk_buff *skb) 
+				    struct sk_buff *skb)
 {
 	int ret = 0;
 
@@ -665,16 +665,16 @@
 		/* Go back to disconnected mode, keep the socket waiting */
 		self->dlsap_sel = LSAP_ANY;
 		if(self->conn_skb)
- 			dev_kfree_skb(self->conn_skb);
+			dev_kfree_skb(self->conn_skb);
 		self->conn_skb = NULL;
 		irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "Unknown event %s\n", 
+		IRDA_DEBUG(0, __FUNCTION__ "Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
-		break;	
+			dev_kfree_skb(skb);
+		break;
 	}
 	return ret;
 }
@@ -685,13 +685,13 @@
  *    DATA_TRANSFER_READY
  *
  */
-static int irlmp_state_dtr(struct lsap_cb *self, IRLMP_EVENT event, 
-			   struct sk_buff *skb) 
+static int irlmp_state_dtr(struct lsap_cb *self, IRLMP_EVENT event,
+			   struct sk_buff *skb)
 {
 	LM_REASON reason;
 	int ret = 0;
 
- 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
@@ -699,19 +699,19 @@
 
 	switch (event) {
 	case LM_DATA_REQUEST: /* Optimize for the common case */
-		irlmp_send_data_pdu(self->lap, self->dlsap_sel, 
+		irlmp_send_data_pdu(self->lap, self->dlsap_sel,
 				    self->slsap_sel, FALSE, skb);
 		break;
 	case LM_DATA_INDICATION: /* Optimize for the common case */
-		irlmp_data_indication(self, skb); 
+		irlmp_data_indication(self, skb);
 		break;
 	case LM_UDATA_REQUEST:
 		ASSERT(skb != NULL, return -1;);
-		irlmp_send_data_pdu(self->lap, self->dlsap_sel, 
+		irlmp_send_data_pdu(self->lap, self->dlsap_sel,
 				    self->slsap_sel, TRUE, skb);
 		break;
 	case LM_UDATA_INDICATION:
-		irlmp_udata_indication(self, skb); 
+		irlmp_udata_indication(self, skb);
 		break;
 	case LM_CONNECT_REQUEST:
 		IRDA_DEBUG(0, __FUNCTION__ "(), LM_CONNECT_REQUEST, "
@@ -719,7 +719,7 @@
 		/* Keep state */
 		break;
 	case LM_CONNECT_RESPONSE:
-		IRDA_DEBUG(0, __FUNCTION__ "(), LM_CONNECT_RESPONSE, " 
+		IRDA_DEBUG(0, __FUNCTION__ "(), LM_CONNECT_RESPONSE, "
 			   "error, LSAP allready connected\n");
 		/* Keep state */
 		break;
@@ -727,12 +727,12 @@
 		irlmp_send_lcf_pdu(self->lap, self->dlsap_sel, self->slsap_sel,
 				   DISCONNECT, skb);
 		irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
-		
+
 		/* Try to close the LAP connection if its still there */
 		if (self->lap) {
 			IRDA_DEBUG(4, __FUNCTION__ "(), trying to close IrLAP\n");
-			irlmp_do_lap_event(self->lap, 
-					   LM_LAP_DISCONNECT_REQUEST, 
+			irlmp_do_lap_event(self->lap,
+					   LM_LAP_DISCONNECT_REQUEST,
 					   NULL);
 		}
 		break;
@@ -745,10 +745,10 @@
 		break;
 	case LM_DISCONNECT_INDICATION:
 		irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
-			
+
 		ASSERT(self->lap != NULL, return -1;);
 		ASSERT(self->lap->magic == LMP_LAP_MAGIC, return -1;);
-	
+
 		ASSERT(skb != NULL, return -1;);
 		ASSERT(skb->len > 3, return -1;);
 		reason = skb->data[3];
@@ -760,11 +760,11 @@
 		irlmp_disconnect_indication(self, reason, skb);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
-		break;	
+			dev_kfree_skb(skb);
+		break;
 	}
 	return ret;
 }
@@ -776,8 +776,8 @@
  *    An LSAP connection request has been transmitted to the peer
  *    LSAP-Connection Control FSM and we are awaiting reply.
  */
-static int irlmp_state_setup(struct lsap_cb *self, IRLMP_EVENT event, 
-			     struct sk_buff *skb) 
+static int irlmp_state_setup(struct lsap_cb *self, IRLMP_EVENT event,
+			     struct sk_buff *skb)
 {
 	LM_REASON reason;
 	int ret = 0;
@@ -792,15 +792,15 @@
 		irlmp_next_lsap_state(self, LSAP_DATA_TRANSFER_READY);
 
 		del_timer(&self->watchdog_timer);
-		
+
 		irlmp_connect_confirm(self, skb);
 		break;
 	case LM_DISCONNECT_INDICATION:
 		irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
-			
+
 		ASSERT(self->lap != NULL, return -1;);
 		ASSERT(self->lap->magic == LMP_LAP_MAGIC, return -1;);
-	
+
 		ASSERT(skb != NULL, return -1;);
 		ASSERT(skb->len > 3, return -1;);
 		reason = skb->data[3];
@@ -818,26 +818,26 @@
 
 		ASSERT(self->lap != NULL, return -1;);
 		ASSERT(self->lap->magic == LMP_LAP_MAGIC, return -1;);
-		
+
 		reason = irlmp_convert_lap_reason(self->lap->reason);
 
 		irlmp_disconnect_indication(self, reason, skb);
 		break;
 	case LM_WATCHDOG_TIMEOUT:
 		IRDA_DEBUG(0, __FUNCTION__ "() WATCHDOG_TIMEOUT!\n");
-		
+
 		ASSERT(self->lap != NULL, return -1;);
 		irlmp_do_lap_event(self->lap, LM_LAP_DISCONNECT_REQUEST, NULL);
 		irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
-		
+
 		irlmp_disconnect_indication(self, LM_CONNECT_FAILURE, NULL);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
-		break;	
+			dev_kfree_skb(skb);
+		break;
 	}
 	return ret;
 }
@@ -850,13 +850,13 @@
  *    LAP FSM to set up the underlying IrLAP connection, and we
  *    are awaiting confirm.
  */
-static int irlmp_state_setup_pend(struct lsap_cb *self, IRLMP_EVENT event, 
-				  struct sk_buff *skb) 
+static int irlmp_state_setup_pend(struct lsap_cb *self, IRLMP_EVENT event,
+				  struct sk_buff *skb)
 {
 	LM_REASON reason;
 	int ret = 0;
 
-	IRDA_DEBUG(4, __FUNCTION__ "()\n"); 
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(irlmp != NULL, return -1;);
@@ -868,7 +868,7 @@
 		skb = self->conn_skb;
 		self->conn_skb = NULL;
 
-		irlmp_send_lcf_pdu(self->lap, self->dlsap_sel, 
+		irlmp_send_lcf_pdu(self->lap, self->dlsap_sel,
 				   self->slsap_sel, CONNECT_CMD, skb);
 
 		irlmp_next_lsap_state(self, LSAP_SETUP);
@@ -886,17 +886,17 @@
 		del_timer( &self->watchdog_timer);
 
 		irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
-		
+
 		reason = irlmp_convert_lap_reason(self->lap->reason);
-		
+
 		irlmp_disconnect_indication(self, reason, NULL);
 		break;
 	default:
-		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n", 
+		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n",
 			   irlmp_event[event]);
 		if (skb)
- 			dev_kfree_skb(skb);
-		break;	
+			dev_kfree_skb(skb);
+		break;
 	}
 	return ret;
 }
#45 lore raw

PATCH 1/1 2.5.21 kill warnings 18/19

In reply to Linus Torvalds

Slowly we get there...

net/irda/parameters.c +69 -82
diff -urN linux-2.5.21/net/irda/parameters.c linux/net/irda/parameters.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      parameters.c
  * Version:       1.0
  * Description:   A more general way to handle (pi,pl,pv) parameters
@@ -8,24 +8,24 @@
  * Created at:    Mon Jun  7 10:25:11 1999
  * Modified at:   Sun Jan 30 14:08:39 2000
  * Modified by:   Dag Brattli <[email protected]>
- * 
+ *
  *     Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved.
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
- * 
+ *
  *     This program is distributed in the hope that it will be useful,
  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  *     GNU General Public License for more details.
- * 
- *     You should have received a copy of the GNU General Public License 
- *     along with this program; if not, write to the Free Software 
- *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  *     MA 02111-1307 USA
- *     
+ *
  ********************************************************************/
 
 #include <linux/types.h>
@@ -35,18 +35,18 @@
 #include <net/irda/irda.h>
 #include <net/irda/parameters.h>
 
-static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
 				PV_TYPE type, PI_HANDLER func);
-static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
 			       PV_TYPE type, PI_HANDLER func);
-static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
 			       PV_TYPE type, PI_HANDLER func);
-static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi,
 				 PV_TYPE type, PI_HANDLER func);
 
-static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
 			       PV_TYPE type, PI_HANDLER func);
-static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi,
 				PV_TYPE type, PI_HANDLER func);
 
 /* Parameter value call table. Must match PV_TYPE */
@@ -72,11 +72,8 @@
 
 /*
  * Function irda_insert_no_value (self, buf, len, pi, type, func)
- *
- *    
- *
  */
-static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi,
 				PV_TYPE type, PI_HANDLER func)
 {
 	irda_param_t p;
@@ -93,7 +90,7 @@
 
 	if (ret < 0)
 		return ret;
-	 
+
 	return 2; /* Inserted pl+2 bytes */
 }
 
@@ -103,7 +100,7 @@
  *    Extracts a parameter without a pv field (pl=0)
  *
  */
-static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi,
 				 PV_TYPE type, PI_HANDLER func)
 {
 	irda_param_t p;
@@ -117,17 +114,14 @@
 
 	if (ret < 0)
 		return ret;
-	 
+
 	return 2; /* Extracted pl+2 bytes */
 }
 
 /*
  * Function irda_insert_integer (self, buf, len, pi, type, func)
- *
- *    
- *
  */
-static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
 			       PV_TYPE type, PI_HANDLER func)
 {
 	irda_param_t p;
@@ -141,10 +135,10 @@
 	/* Call handler for this parameter */
 	err = (*func)(self, &p, PV_GET);
 	if (err < 0)
-		return err; 
+		return err;
 
-	/* 
-	 * If parameter lenght is still 0, then (1) this is an any length 
+	/*
+	 * If parameter lenght is still 0, then (1) this is an any length
 	 * integer, and (2) the handler function does not care which length
 	 * we choose to use, so we pick the one the gives the fewest bytes.
 	 */
@@ -162,7 +156,7 @@
 	}
 	/* Check if buffer is long enough for insertion */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for insertion!\n");
+		WARNING("%s: buffer to short for insertion!\n", __FUNCTION__);
 		return -1;
 	}
 	IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d, pi=%d\n", p.pi, p.pl, p.pv.i);
@@ -186,8 +180,8 @@
 
 		break;
 	default:
-		WARNING(__FUNCTION__ "() length %d not supported\n", p.pl);
-		/* Skip parameter */ 
+		WARNING("%s: length %d not supported\n", __FUNCTION__, p.pl);
+		/* Skip parameter */
 		return -1;
 	}
 
@@ -197,10 +191,10 @@
 /*
  * Function irda_extract integer (self, buf, len, pi, type, func)
  *
- *    Extract a possibly variable length integer from buffer, and call 
+ *    Extract a possibly variable length integer from buffer, and call
  *    handler for processing of the parameter
  */
-static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
 				PV_TYPE type, PI_HANDLER func)
 {
 	irda_param_t p;
@@ -213,20 +207,21 @@
 
 	/* Check if buffer is long enough for parsing */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for parsing! "
-			"Need %d bytes, but len is only %d\n", p.pl, len);
+		WARNING("%s: buffer to short for parsing! "
+			"Need %d bytes, but len is only %d\n",
+			__FUNCTION__, p.pl, len);
 		return -1;
 	}
 
-	/* 
+	/*
 	 * Check that the integer length is what we expect it to be. If the
 	 * handler want a 16 bits integer then a 32 bits is not good enough
 	 */
 	if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) {
-		ERROR(__FUNCTION__ "(), invalid parameter length! "
+		ERROR("%s: invalid parameter length! "
 		      "Expected %d bytes, but value had %d bytes!\n",
-		      type & PV_MASK, p.pl);
-		
+		      __FUNCTION__, type & PV_MASK, p.pl);
+
 		/* Skip parameter */
 		return p.pl+2;
 	}
@@ -251,9 +246,9 @@
 			le32_to_cpus(&p.pv.i);
 		break;
 	default:
-		WARNING(__FUNCTION__ "() length %d not supported\n", p.pl);
+		WARNING("%s: length %d not supported\n", __FUNCTION__, p.pl);
 
-		/* Skip parameter */ 
+		/* Skip parameter */
 		return p.pl+2;
 	}
 
@@ -261,18 +256,15 @@
 	/* Call handler for this parameter */
 	err = (*func)(self, &p, PV_PUT);
 	if (err < 0)
-		return err; 
+		return err;
 
 	return p.pl+2; /* Extracted pl+2 bytes */
 }
 
 /*
  * Function irda_extract_string (self, buf, len, type, func)
- *
- *    
- *
  */
-static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, 
+static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
 			       PV_TYPE type, PI_HANDLER func)
 {
 	char str[33];
@@ -288,18 +280,19 @@
 
 	/* Check if buffer is long enough for parsing */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for parsing! "
-			"Need %d bytes, but len is only %d\n", p.pl, len);
+		WARNING("%s: buffer to short for parsing! "
+			"Need %d bytes, but len is only %d\n",
+			__FUNCTION__, p.pl, len);
 		return -1;
 	}
 
-	/* Should be safe to copy string like this since we have already 
+	/* Should be safe to copy string like this since we have already
 	 * checked that the buffer is long enough */
 	strncpy(str, buf+2, p.pl);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), str=0x%02x 0x%02x\n", (__u8) str[0], 
+	IRDA_DEBUG(2, __FUNCTION__ "(), str=0x%02x 0x%02x\n", (__u8) str[0],
 	      (__u8) str[1]);
-	
+
 	/* Null terminate string */
 	str[p.pl+1] = '\0';
 
@@ -308,16 +301,13 @@
 	/* Call handler for this parameter */
 	err = (*func)(self, &p, PV_PUT);
 	if (err < 0)
-		return err; 
+		return err;
 
 	return p.pl+2; /* Extracted pl+2 bytes */
 }
 
 /*
  * Function irda_extract_octseq (self, buf, len, type, func)
- *
- *    
- *
  */
 static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
 			       PV_TYPE type, PI_HANDLER func)
@@ -329,13 +319,14 @@
 
 	/* Check if buffer is long enough for parsing */
 	if (len < (2+p.pl)) {
-		WARNING(__FUNCTION__ "(), buffer to short for parsing! "
-			"Need %d bytes, but len is only %d\n", p.pl, len);
+		WARNING("%s: buffer to short for parsing! "
+			"Need %d bytes, but len is only %d\n",
+			__FUNCTION__, p.pl, len);
 		return -1;
 	}
 
 	IRDA_DEBUG(0, __FUNCTION__ "(), not impl\n");
-	
+
 	return p.pl+2; /* Extracted pl+2 bytes */
 }
 
@@ -353,7 +344,7 @@
 	va_list args;
 	char *p;
 	int n = 0;
-	
+
 	va_start(args, fmt);
 
 	for (p = fmt; *p != '\0'; p++) {
@@ -380,7 +371,6 @@
 			va_end(args);
 			return -1;
 		}
-		
 	}
 	va_end(args);
 
@@ -389,9 +379,6 @@
 
 /*
  * Function irda_param_unpack (skb, fmt, ...)
- *
- *    
- *
  */
 int irda_param_unpack(__u8 *buf, char *fmt, ...)
 {
@@ -427,7 +414,7 @@
 			va_end(args);
 			return -1;
 		}
-		
+
 	}
 	va_end(args);
 
@@ -440,7 +427,7 @@
  *    Insert the specified parameter (pi) into buffer. Returns number of
  *    bytes inserted
  */
-int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, 
+int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len,
 		      pi_param_info_t *info)
 {
 	pi_minor_info_t *pi_minor_info;
@@ -457,16 +444,16 @@
 	pi_major = pi >> info->pi_major_offset;
 
 	/* Check if the identifier value (pi) is valid */
-	if ((pi_major > info->len-1) || 
+	if ((pi_major > info->len-1) ||
 	    (pi_minor > info->tables[pi_major].len-1))
 	{
-		IRDA_DEBUG(0, __FUNCTION__ 
+		IRDA_DEBUG(0, __FUNCTION__
 		      "(), no handler for parameter=0x%02x\n", pi);
-		
+
 		/* Skip this parameter */
 		return -1;
 	}
-	
+
 	/* Lookup the info on how to parse this parameter */
 	pi_minor_info = &info->tables[pi_major].pi_minor_call_table[pi_minor];
 
@@ -475,13 +462,13 @@
 
 	/*  Check if handler has been implemented */
 	if (!pi_minor_info->func) {
-		MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", pi);
+		MESSAGE("%s: no handler for pi=%#x\n", __FUNCTION__, pi);
 		/* Skip this parameter */
 		return -1;
 	}
-	
+
 	/* Insert parameter value */
-	ret = (*pv_insert_table[type & PV_MASK])(self, buf+n, len, pi, type, 
+	ret = (*pv_insert_table[type & PV_MASK])(self, buf+n, len, pi, type,
 						 pi_minor_info->func);
 	return ret;
 }
@@ -507,14 +494,14 @@
 
 	pi_minor = buf[n] & info->pi_mask;
 	pi_major = buf[n] >> info->pi_major_offset;
-	
+
 	/* Check if the identifier value (pi) is valid */
-	if ((pi_major > info->len-1) || 
+	if ((pi_major > info->len-1) ||
 	    (pi_minor > info->tables[pi_major].len-1))
 	{
 		IRDA_DEBUG(0, __FUNCTION__ "(), no handler for parameter=0x%02x\n",
 		      buf[0]);
-		
+
 		/* Skip this parameter */
 		return 2 + buf[n + 1];  /* Continue */
 	}
@@ -524,13 +511,13 @@
 
 	/* Find expected data type for this parameter identifier (pi)*/
 	type = pi_minor_info->type;
-	
+
 	IRDA_DEBUG(3, __FUNCTION__ "(), pi=[%d,%d], type=%d\n",
 	      pi_major, pi_minor, type);
-	
+
 	/*  Check if handler has been implemented */
 	if (!pi_minor_info->func) {
-		MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", buf[n]);
+		MESSAGE("%s: no handler for pi=%#x\n", __FUNCTION__, buf[n]);
 		/* Skip this parameter */
 		return 2 + buf[n + 1]; /* Continue */
 	}
#46 lore raw

PATCH 1/1 2.5.21 kill warnings 19/19

In reply to Linus Torvalds

and now the final irda offender :-).

net/irda/wrapper.c +54 -56
diff -urN linux-2.5.21/net/irda/wrapper.c linux/net/irda/wrapper.c
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      wrapper.c
  * Version:       1.2
  * Description:   IrDA SIR async wrapper layer
@@ -10,17 +10,17 @@
  * Modified by:   Dag Brattli <[email protected]>
  * Modified at:   Fri May 28  3:11 CST 1999
  * Modified by:   Horst von Brand <[email protected]>
- * 
- *     Copyright (c) 1998-2000 Dag Brattli <[email protected]>, 
+ *
+ *     Copyright (c) 1998-2000 Dag Brattli <[email protected]>,
  *     All Rights Reserved.
- *     
- *     This program is free software; you can redistribute it and/or 
- *     modify it under the terms of the GNU General Public License as 
- *     published by the Free Software Foundation; either version 2 of 
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of
  *     the License, or (at your option) any later version.
  *
  *     Neither Dag Brattli nor University of Troms� admit liability nor
- *     provide warranty for any of this software. This material is 
+ *     provide warranty for any of this software. This material is
  *     provided "AS-IS" and at no charge.
  *
  ********************************************************************/
@@ -39,22 +39,22 @@
 
 static inline int stuff_byte(__u8 byte, __u8 *buf);
 
-static void state_outside_frame(struct net_device *dev, 
-				struct net_device_stats *stats, 
+static void state_outside_frame(struct net_device *dev,
+				struct net_device_stats *stats,
 				iobuff_t *rx_buff, __u8 byte);
-static void state_begin_frame(struct net_device *dev, 
-			      struct net_device_stats *stats, 
+static void state_begin_frame(struct net_device *dev,
+			      struct net_device_stats *stats,
 			      iobuff_t *rx_buff, __u8 byte);
-static void state_link_escape(struct net_device *dev, 
-			      struct net_device_stats *stats, 
+static void state_link_escape(struct net_device *dev,
+			      struct net_device_stats *stats,
 			      iobuff_t *rx_buff, __u8 byte);
-static void state_inside_frame(struct net_device *dev, 
-			       struct net_device_stats *stats, 
+static void state_inside_frame(struct net_device *dev,
+			       struct net_device_stats *stats,
 			       iobuff_t *rx_buff, __u8 byte);
 
-static void (*state[])(struct net_device *dev, struct net_device_stats *stats, 
-		       iobuff_t *rx_buff, __u8 byte) = 
-{ 
+static void (*state[])(struct net_device *dev, struct net_device_stats *stats,
+		       iobuff_t *rx_buff, __u8 byte) =
+{
 	state_outside_frame,
 	state_begin_frame,
 	state_link_escape,
@@ -64,14 +64,14 @@
 /*
  * Function async_wrap (skb, *tx_buff, buffsize)
  *
- *    Makes a new buffer with wrapping and stuffing, should check that 
+ *    Makes a new buffer with wrapping and stuffing, should check that
  *    we don't get tx buffer overflow.
  */
 int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize)
 {
 	struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb;
 	int xbofs;
- 	int i;
+	int i;
 	int n;
 	union {
 		__u16 value;
@@ -86,11 +86,11 @@
 	 *  Send  XBOF's for required min. turn time and for the negotiated
 	 *  additional XBOFS
 	 */
-	
+
 	if (cb->magic != LAP_MAGIC) {
-		/* 
+		/*
 		 * This will happen for all frames sent from user-space.
-		 * Nothing to worry about, but we set the default number of 
+		 * Nothing to worry about, but we set the default number of
 		 * BOF's
 		 */
 		IRDA_DEBUG(1, __FUNCTION__ "(), wrong magic in skb!\n");
@@ -116,7 +116,7 @@
 	for (i=0; i < skb->len; i++) {
 		/*
 		 *  Check for the possibility of tx buffer overflow. We use
-		 *  bufsize-5 since the maximum number of bytes that can be 
+		 *  bufsize-5 since the maximum number of bytes that can be
 		 *  transmitted after this point is 5.
 		 */
 		ASSERT(n < (buffsize-5), return n;);
@@ -124,7 +124,7 @@
 		n += stuff_byte(skb->data[i], tx_buff+n);
 		fcs.value = irda_fcs(fcs.value, skb->data[i]);
 	}
-	
+
 	/* Insert CRC in little endian format (LSB first) */
 	fcs.value = ~fcs.value;
 #ifdef __LITTLE_ENDIAN
@@ -144,9 +144,9 @@
  *
  *    Byte stuff one single byte and put the result in buffer pointed to by
  *    buf. The buffer must at all times be able to have two bytes inserted.
- * 
+ *
  */
-static inline int stuff_byte(__u8 byte, __u8 *buf) 
+static inline int stuff_byte(__u8 byte, __u8 *buf)
 {
 	switch (byte) {
 	case BOF: /* FALLTHROUGH */
@@ -174,7 +174,7 @@
 inline void async_bump(struct net_device *dev, struct net_device_stats *stats,
 		       __u8 *buf, int len)
 {
-       	struct sk_buff *skb;
+	struct sk_buff *skb;
 
 	skb = dev_alloc_skb(len+1);
 	if (!skb)  {
@@ -184,10 +184,10 @@
 
 	/* Align IP header to 20 bytes */
 	skb_reserve(skb, 1);
-	
+
         /* Copy data without CRC */
-	memcpy(skb_put(skb, len-2), buf, len-2); 
-	
+	memcpy(skb_put(skb, len-2), buf, len-2);
+
 	/* Feed it to IrLAP layer */
 	skb->dev = dev;
 	skb->mac.raw  = skb->data;
@@ -196,7 +196,7 @@
 	netif_rx(skb);
 
 	stats->rx_packets++;
-	stats->rx_bytes += len;	
+	stats->rx_bytes += len;
 }
 
 /*
@@ -205,21 +205,21 @@
  *    Parse and de-stuff frame received from the IrDA-port
  *
  */
-inline void async_unwrap_char(struct net_device *dev, 
-			      struct net_device_stats *stats, 
+inline void async_unwrap_char(struct net_device *dev,
+			      struct net_device_stats *stats,
 			      iobuff_t *rx_buff, __u8 byte)
 {
 	(*state[rx_buff->state])(dev, stats, rx_buff, byte);
 }
-	 
+
 /*
  * Function state_outside_frame (dev, rx_buff, byte)
  *
  *    Not receiving any frame (or just bogus data)
  *
  */
-static void state_outside_frame(struct net_device *dev, 
-				struct net_device_stats *stats, 
+static void state_outside_frame(struct net_device *dev,
+				struct net_device_stats *stats,
 				iobuff_t *rx_buff, __u8 byte)
 {
 	switch (byte) {
@@ -245,8 +245,8 @@
  *    Begin of frame detected
  *
  */
-static void state_begin_frame(struct net_device *dev, 
-			      struct net_device_stats *stats, 
+static void state_begin_frame(struct net_device *dev,
+			      struct net_device_stats *stats,
 			      iobuff_t *rx_buff, __u8 byte)
 {
 	/* Time to initialize receive buffer */
@@ -283,27 +283,27 @@
  *    Found link escape character
  *
  */
-static void state_link_escape(struct net_device *dev, 
-			      struct net_device_stats *stats, 
+static void state_link_escape(struct net_device *dev,
+			      struct net_device_stats *stats,
 			      iobuff_t *rx_buff, __u8 byte)
 {
 	switch (byte) {
 	case BOF: /* New frame? */
-		IRDA_DEBUG(1, __FUNCTION__ 
+		IRDA_DEBUG(1, __FUNCTION__
 			   "(), Discarding incomplete frame\n");
 		rx_buff->state = BEGIN_FRAME;
 		irda_device_set_media_busy(dev, TRUE);
 		break;
 	case CE:
-		WARNING(__FUNCTION__ "(), state not defined\n");
+		WARNING("%s: state not defined\n", __FUNCTION__);
 		break;
 	case EOF: /* Abort frame */
 		rx_buff->state = OUTSIDE_FRAME;
 		break;
 	default:
-		/* 
-		 *  Stuffed char, complement bit 5 of byte 
-		 *  following CE, IrLAP p.114 
+		/*
+		 *  Stuffed char, complement bit 5 of byte
+		 *  following CE, IrLAP p.114
 		 */
 		byte ^= IRDA_TRANS;
 		if (rx_buff->len < rx_buff->truesize)  {
@@ -324,15 +324,15 @@
  *    Handle bytes received within a frame
  *
  */
-static void state_inside_frame(struct net_device *dev, 
+static void state_inside_frame(struct net_device *dev,
 			       struct net_device_stats *stats,
 			       iobuff_t *rx_buff, __u8 byte)
 {
-	int ret = 0; 
+	int ret = 0;
 
 	switch (byte) {
 	case BOF: /* New frame? */
-		IRDA_DEBUG(1, __FUNCTION__ 
+		IRDA_DEBUG(1, __FUNCTION__
 			   "(), Discarding incomplete frame\n");
 		rx_buff->state = BEGIN_FRAME;
 		irda_device_set_media_busy(dev, TRUE);
@@ -343,7 +343,7 @@
 	case EOF: /* End of frame */
 		rx_buff->state = OUTSIDE_FRAME;
 		rx_buff->in_frame = FALSE;
-		
+
 		/* Test FCS and signal success if the frame is good */
 		if (rx_buff->fcs == GOOD_FCS) {
 			/* Deliver frame */
@@ -352,24 +352,22 @@
 			break;
 		} else {
 			/* Wrong CRC, discard frame!  */
-			irda_device_set_media_busy(dev, TRUE); 
+			irda_device_set_media_busy(dev, TRUE);
 
 			IRDA_DEBUG(1, __FUNCTION__ "(), crc error\n");
 			stats->rx_errors++;
 			stats->rx_crc_errors++;
-		}			
+		}
 		break;
 	default: /* Must be the next byte of the frame */
 		if (rx_buff->len < rx_buff->truesize)  {
 			rx_buff->data[rx_buff->len++] = byte;
 			rx_buff->fcs = irda_fcs(rx_buff->fcs, byte);
 		} else {
-			IRDA_DEBUG(1, __FUNCTION__ 
+			IRDA_DEBUG(1, __FUNCTION__
 			      "(), Rx buffer overflow, aborting\n");
 			rx_buff->state = OUTSIDE_FRAME;
 		}
 		break;
 	}
 }
-
-
#47 lore raw

PATCH 1/1 2.5.21 kill warnings 17/19

In reply to Linus Torvalds

irttp.c was infected too.

net/irda/irttp.c +186 -186
diff -urN linux-2.5.21/net/irda/irttp.c linux/net/irda/irttp.c
@@ -89,15 +89,15 @@
 			return -ENOMEM;
 	}
 	memset(irttp, 0, sizeof(struct irttp_cb));
-	
+
 	irttp->magic = TTP_MAGIC;
 
 	irttp->tsaps = hashbin_new(HB_LOCAL);
 	if (!irttp->tsaps) {
-		ERROR(__FUNCTION__ "(), can't allocate IrTTP hashbin!\n");
+		ERROR("%s: can't allocate IrTTP hashbin!\n", __FUNCTION__);
 		return -ENOMEM;
 	}
-	
+
 	return 0;
 }
 
@@ -108,19 +108,19 @@
  *
  */
 #ifdef MODULE
-void irttp_cleanup(void) 
+void irttp_cleanup(void)
 {
 	/* Check for main structure */
 	ASSERT(irttp != NULL, return;);
 	ASSERT(irttp->magic == TTP_MAGIC, return;);
-	
+
 	/*
 	 *  Delete hashbin and close all TSAP instances in it
 	 */
 	hashbin_delete(irttp->tsaps, (FREE_FUNC) __irttp_close_tsap);
 
 	irttp->magic = 0;
-	
+
 	/* De-allocate main structure */
 	kfree(irttp);
 
@@ -133,7 +133,7 @@
 /*
  * Function irttp_start_todo_timer (self, timeout)
  *
- *    Start todo timer. 
+ *    Start todo timer.
  *
  * Made it more effient and unsensitive to race conditions - Jean II
  */
@@ -164,7 +164,7 @@
 	/* Check that we still exist */
 	if (!self || self->magic != TTP_TSAP_MAGIC)
 		return;
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self);
 
 	/* Try to make some progress, especially on Tx side - Jean II */
@@ -185,12 +185,12 @@
 		} else {
 			/* Try again later */
 			irttp_start_todo_timer(self, HZ/10);
-			
+
 			/* No reason to try and close now */
 			return;
 		}
 	}
-	
+
 	/* Check if it's closing time */
 	if (self->close_pend)
 		/* Finish cleanup */
@@ -205,20 +205,20 @@
 void irttp_flush_queues(struct tsap_cb *self)
 {
 	struct sk_buff* skb;
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
-	
+
 	/* Deallocate frames waiting to be sent */
 	while ((skb = skb_dequeue(&self->tx_queue)) != NULL)
 		dev_kfree_skb(skb);
-	
+
 	/* Deallocate received frames */
 	while ((skb = skb_dequeue(&self->rx_queue)) != NULL)
 		dev_kfree_skb(skb);
-	
+
 	/* Deallocate received fragments */
 	while ((skb = skb_dequeue(&self->rx_fragments)) != NULL)
 		dev_kfree_skb(skb);
@@ -235,19 +235,19 @@
 {
 	struct sk_buff *skb, *frag;
 	int n = 0;  /* Fragment index */
-	
-      	ASSERT(self != NULL, return NULL;);
+
+	ASSERT(self != NULL, return NULL;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return NULL;);
 
-	IRDA_DEBUG(2, __FUNCTION__ "(), self->rx_sdu_size=%d\n", 
+	IRDA_DEBUG(2, __FUNCTION__ "(), self->rx_sdu_size=%d\n",
 		   self->rx_sdu_size);
 
 	skb = dev_alloc_skb(TTP_HEADER + self->rx_sdu_size);
 	if (!skb)
 		return NULL;
 
-	/* 
-	 * Need to reserve space for TTP header in case this skb needs to 
+	/*
+	 * Need to reserve space for TTP header in case this skb needs to
 	 * be requeued in case delivery failes
 	 */
 	skb_reserve(skb, TTP_HEADER);
@@ -259,7 +259,7 @@
 	while ((frag = skb_dequeue(&self->rx_fragments)) != NULL) {
 		memcpy(skb->data+n, frag->data, frag->len);
 		n += frag->len;
-		
+
 		dev_kfree_skb(frag);
 	}
 	IRDA_DEBUG(2, __FUNCTION__ "(), frame len=%d\n", n);
@@ -307,13 +307,13 @@
 		skb_reserve(frag, self->max_header_size);
 
 		/* Copy data from the original skb into this fragment. */
-		memcpy(skb_put(frag, self->max_seg_size), skb->data, 
+		memcpy(skb_put(frag, self->max_seg_size), skb->data,
 		       self->max_seg_size);
 
 		/* Insert TTP header, with the more bit set */
 		frame = skb_push(frag, TTP_HEADER);
 		frame[0] = TTP_MORE;
-		
+
 		/* Hide the copied data from the original skb */
 		skb_pull(skb, self->max_seg_size);
 
@@ -322,7 +322,7 @@
 	}
 	/* Queue what is left of the original skb */
 	IRDA_DEBUG(2, __FUNCTION__  "(), queuing last segment\n");
-	
+
 	frame = skb_push(skb, TTP_HEADER);
 	frame[0] = 0x00; /* Clear more bit */
 
@@ -337,7 +337,7 @@
  *    will be called both when this parameter needs to be inserted into, and
  *    extracted from the connect frames
  */
-static int irttp_param_max_sdu_size(void *instance, irda_param_t *param, 
+static int irttp_param_max_sdu_size(void *instance, irda_param_t *param,
 				    int get)
 {
 	struct tsap_cb *self;
@@ -353,7 +353,7 @@
 		self->tx_max_sdu_size = param->pv.i;
 
 	IRDA_DEBUG(1, __FUNCTION__ "(), MaxSduSize=%d\n", param->pv.i);
-	
+
 	return 0;
 }
 
@@ -366,7 +366,7 @@
  *
  *    Create TSAP connection endpoint,
  */
-struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify) 
+struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify)
 {
 	struct tsap_cb *self;
 	struct lsap_cb *lsap;
@@ -421,10 +421,10 @@
 	 */
 	lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0);
 	if (lsap == NULL) {
-		WARNING(__FUNCTION__ "(), unable to allocate LSAP!!\n");
+		WARNING("%s: unable to allocate LSAP!!\n", __FUNCTION__);
 		return NULL;
 	}
-	
+
 	/*
 	 *  If user specified LSAP_ANY as source TSAP selector, then IrLMP
 	 *  will replace it with whatever source selector which is free, so
@@ -443,7 +443,7 @@
 	else
 		self->initial_credit = credit;
 
-	return self;	
+	return self;
 }
 
 /*
@@ -497,7 +497,7 @@
 	if (self->connected) {
 		/* Check if disconnect is not pending */
 		if (!test_bit(0, &self->disconnect_pend)) {
-			WARNING(__FUNCTION__ "(), TSAP still connected!\n");
+			WARNING("%s: TSAP still connected!\n", __FUNCTION__);
 			irttp_disconnect_request(self, NULL, P_NORMAL);
 		}
 		self->close_pend = TRUE;
@@ -505,7 +505,7 @@
 
 		return 0; /* Will be back! */
 	}
-	
+
 	tsap = hashbin_remove(irttp->tsaps, (int) self, NULL);
 
 	ASSERT(tsap == self, return -1;);
@@ -527,7 +527,7 @@
  *    Send unreliable data on this TSAP
  *
  */
-int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) 
+int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)
 {
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
@@ -540,12 +540,12 @@
 		IRDA_DEBUG(1, __FUNCTION__ "(), No data, or not connected\n");
 		return -1;
 	}
-	
+
 	if (skb->len > self->max_seg_size) {
 		IRDA_DEBUG(1, __FUNCTION__ "(), UData is to large for IrLAP!\n");
 		return -1;
 	}
-		    
+
 	irlmp_udata_request(self->lsap, skb);
 	self->stats.tx_packets++;
 
@@ -555,10 +555,10 @@
 /*
  * Function irttp_data_request (handle, skb)
  *
- *    Queue frame for transmission. If SAR is enabled, fragement the frame 
+ *    Queue frame for transmission. If SAR is enabled, fragement the frame
  *    and queue the fragments for transmission
  */
-int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) 
+int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
 {
 	__u8 *frame;
 
@@ -571,33 +571,33 @@
 
 	/* Check that nothing bad happens */
 	if ((skb->len == 0) || (!self->connected)) {
-		WARNING(__FUNCTION__ "(), No data, or not connected\n");
+		WARNING("%s: No data, or not connected\n", __FUNCTION__);
 		return -ENOTCONN;
 	}
 
-	/*  
+	/*
 	 *  Check if SAR is disabled, and the frame is larger than what fits
 	 *  inside an IrLAP frame
 	 */
 	if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) {
-		ERROR(__FUNCTION__ 
-		      "(), SAR disabled, and data is to large for IrLAP!\n");
+		ERROR("%s: SAR disabled, and data is to large for IrLAP!\n",
+				__FUNCTION__);
 		return -EMSGSIZE;
 	}
 
-	/* 
-	 *  Check if SAR is enabled, and the frame is larger than the 
-	 *  TxMaxSduSize 
+	/*
+	 *  Check if SAR is enabled, and the frame is larger than the
+	 *  TxMaxSduSize
 	 */
-	if ((self->tx_max_sdu_size != 0) && 
-	    (self->tx_max_sdu_size != TTP_SAR_UNBOUND) && 
+	if ((self->tx_max_sdu_size != 0) &&
+	    (self->tx_max_sdu_size != TTP_SAR_UNBOUND) &&
 	    (skb->len > self->tx_max_sdu_size))
 	{
-		ERROR(__FUNCTION__ "(), SAR enabled, "
-		      "but data is larger than TxMaxSduSize!\n");
+		ERROR("%s: SAR enabled, but data is larger than TxMaxSduSize!\n",
+		      __FUNCTION__);
 		return -EMSGSIZE;
 	}
-	/* 
+	/*
 	 *  Check if transmit queue is full
 	 */
 	if (skb_queue_len(&self->tx_queue) >= TTP_TX_MAX_QUEUE) {
@@ -610,14 +610,14 @@
 		 * to requeue the packet in the client code - Jean II */
 		return -ENOBUFS;
 	}
-       
+
 	/* Queue frame, or queue frame segments */
 	if ((self->tx_max_sdu_size == 0) || (skb->len < self->max_seg_size)) {
 		/* Queue frame */
 		ASSERT(skb_headroom(skb) >= TTP_HEADER, return -1;);
 		frame = skb_push(skb, TTP_HEADER);
 		frame[0] = 0x00; /* Clear more bit */
-		
+
 		skb_queue_tail(&self->tx_queue, skb);
 	} else {
 		/*
@@ -630,11 +630,11 @@
 	}
 
 	/* Check if we can accept more data from client */
-	if ((!self->tx_sdu_busy) && 
+	if ((!self->tx_sdu_busy) &&
 	    (skb_queue_len(&self->tx_queue) > TTP_TX_HIGH_THRESHOLD)) {
 		/* Tx queue filling up, so stop client. */
 		if (self->notify.flow_indication) {
- 			self->notify.flow_indication(self->notify.instance, 
+			self->notify.flow_indication(self->notify.instance,
 						     self, FLOW_STOP);
 		}
 		/* self->tx_sdu_busy is the state of the client.
@@ -646,7 +646,7 @@
 		 * Jean II */
 		self->tx_sdu_busy = TRUE;
 	}
-	
+
 	/* Try to make some progress */
 	irttp_run_tx_queue(self);
 
@@ -659,7 +659,7 @@
  *    Transmit packets queued for transmission (if possible)
  *
  */
-static void irttp_run_tx_queue(struct tsap_cb *self) 
+static void irttp_run_tx_queue(struct tsap_cb *self)
 {
 	struct sk_buff *skb;
 	unsigned long flags;
@@ -680,7 +680,7 @@
 	       (skb = skb_dequeue(&self->tx_queue)))
 	{
 		/*
-		 *  Since we can transmit and receive frames concurrently, 
+		 *  Since we can transmit and receive frames concurrently,
 		 *  the code below is a critical region and we must assure that
 		 *  nobody messes with the credits while we update them.
 		 */
@@ -688,7 +688,7 @@
 
 		n = self->avail_credit;
 		self->avail_credit = 0;
-		
+
 		/* Only room for 127 credits in frame */
 		if (n > 127) {
 			self->avail_credit = n-127;
@@ -699,19 +699,19 @@
 
 		spin_unlock_irqrestore(&self->lock, flags);
 
-		/* 
-		 *  More bit must be set by the data_request() or fragment() 
+		/*
+		 *  More bit must be set by the data_request() or fragment()
 		 *  functions
 		 */
 		skb->data[0] |= (n & 0x7f);
-		
+
 		/* Detach from socket.
 		 * The current skb has a reference to the socket that sent
 		 * it (skb->sk). When we pass it to IrLMP, the skb will be
 		 * stored in in IrLAP (self->wx_list). When we are within
 		 * IrLAP, we loose the notion of socket, so we should not
 		 * have a reference to a socket. So, we drop it here.
-		 * 
+		 *
 		 * Why does it matter ?
 		 * When the skb is freed (kfree_skb), if it is associated
 		 * with a socket, it release buffer space on the socket
@@ -740,7 +740,7 @@
 	 * to client. That's ok, this test will be true not too often
 	 * (max once per LAP window) and we are called from places
 	 * where we can spend a bit of time doing stuff. - Jean II */
-	if ((self->tx_sdu_busy) && 
+	if ((self->tx_sdu_busy) &&
 	    (skb_queue_len(&self->tx_queue) < TTP_TX_LOW_THRESHOLD) &&
 	    (!self->close_pend))
 	{
@@ -764,16 +764,16 @@
  *    Send a dataless flowdata TTP-PDU and give available credit to peer
  *    TSAP
  */
-static inline void irttp_give_credit(struct tsap_cb *self) 
+static inline void irttp_give_credit(struct tsap_cb *self)
 {
 	struct sk_buff *tx_skb = NULL;
 	unsigned long flags;
 	int n;
 
 	ASSERT(self != NULL, return;);
-	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);	
+	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
 
-	IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", 
+	IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n",
 		   self->send_credit, self->avail_credit, self->remote_credit);
 
 	/* Give credit to peer */
@@ -785,7 +785,7 @@
 	skb_reserve(tx_skb, self->max_header_size);
 
 	/*
-	 *  Since we can transmit and receive frames concurrently, 
+	 *  Since we can transmit and receive frames concurrently,
 	 *  the code below is a critical region and we must assure that
 	 *  nobody messes with the credits while we update them.
 	 */
@@ -793,7 +793,7 @@
 
 	n = self->avail_credit;
 	self->avail_credit = 0;
-	
+
 	/* Only space for 127 credits in frame */
 	if (n > 127) {
 		self->avail_credit = n - 127;
@@ -805,7 +805,7 @@
 
 	skb_put(tx_skb, 1);
 	tx_skb->data[0] = (__u8) (n & 0x7f);
-	
+
 	irlmp_data_request(self->lsap, tx_skb);
 	self->stats.tx_packets++;
 }
@@ -816,8 +816,8 @@
  *    Received some unit-data (unreliable)
  *
  */
-static int irttp_udata_indication(void *instance, void *sap, 
-				  struct sk_buff *skb) 
+static int irttp_udata_indication(void *instance, void *sap,
+				  struct sk_buff *skb)
 {
 	struct tsap_cb *self;
 
@@ -843,10 +843,10 @@
 /*
  * Function irttp_data_indication (instance, sap, skb)
  *
- *    Receive segment from IrLMP. 
+ *    Receive segment from IrLMP.
  *
  */
-static int irttp_data_indication(void *instance, void *sap, 
+static int irttp_data_indication(void *instance, void *sap,
 				 struct sk_buff *skb)
 {
 	struct tsap_cb *self;
@@ -860,7 +860,7 @@
 	self->stats.rx_packets++;
 
 	/*  Deal with inbound credit
-	 *  Since we can transmit and receive frames concurrently, 
+	 *  Since we can transmit and receive frames concurrently,
 	 *  the code below is a critical region and we must assure that
 	 *  nobody messes with the credits while we update them.
 	 */
@@ -870,12 +870,12 @@
 		self->remote_credit--;
 	spin_unlock_irqrestore(&self->lock, flags);
 
-	/* 
-	 *  Data or dataless packet? Dataless frames contains only the 
-	 *  TTP_HEADER. 
+	/*
+	 *  Data or dataless packet? Dataless frames contains only the
+	 *  TTP_HEADER.
 	 */
 	if (skb->len > 1) {
-		/* 
+		/*
 		 *  We don't remove the TTP header, since we must preserve the
 		 *  more bit, so the defragment routing knows what to do
 		 */
@@ -904,7 +904,7 @@
 	 * to miss the next Tx window. The todo timer may take
 	 * a while before it's run... - Jean II */
 
-	/* 
+	/*
 	 * If the peer device has given us some credits and we didn't have
          * anyone from before, then we need to shedule the tx queue.
 	 * We need to do that because our Tx have stopped (so we may not
@@ -936,15 +936,15 @@
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	self = (struct tsap_cb *) instance;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
-	
+
 	/*
 	 *  Inform service user if he has requested it
 	 */
 	if (self->notify.status_indication != NULL)
-		self->notify.status_indication(self->notify.instance, 
+		self->notify.status_indication(self->notify.instance,
 					       link, lock);
 	else
 		IRDA_DEBUG(2, __FUNCTION__ "(), no handler\n");
@@ -961,10 +961,10 @@
 	struct tsap_cb *self;
 
 	self = (struct tsap_cb *) instance;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self);
 
 	/* We are "polled" directly from LAP, and the LAP want to fill
@@ -998,7 +998,7 @@
  * Function irttp_flow_request (self, command)
  *
  *    This funtion could be used by the upper layers to tell IrTTP to stop
- *    delivering frames if the receive queues are starting to get full, or 
+ *    delivering frames if the receive queues are starting to get full, or
  *    to tell IrTTP to start delivering frames again.
  */
 void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow)
@@ -1016,7 +1016,7 @@
 	case FLOW_START:
 		IRDA_DEBUG(1, __FUNCTION__ "(), flow start\n");
 		self->rx_sdu_busy = FALSE;
-		
+
 		/* Client say he can accept more data, try to free our
 		 * queues ASAP - Jean II */
 		irttp_run_rx_queue(self);
@@ -1026,42 +1026,42 @@
 		IRDA_DEBUG(1, __FUNCTION__ "(), Unknown flow command!\n");
 	}
 }
-	
+
 /*
  * Function irttp_connect_request (self, dtsap_sel, daddr, qos)
  *
  *    Try to connect to remote destination TSAP selector
  *
  */
-int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, 
+int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel,
 			  __u32 saddr, __u32 daddr,
-			  struct qos_info *qos, __u32 max_sdu_size, 
-			  struct sk_buff *userdata) 
+			  struct qos_info *qos, __u32 max_sdu_size,
+			  struct sk_buff *userdata)
 {
 	struct sk_buff *skb;
 	__u8 *frame;
 	__u8 n;
-	
-	IRDA_DEBUG(4, __FUNCTION__ "(), max_sdu_size=%d\n", max_sdu_size); 
-	
+
+	IRDA_DEBUG(4, __FUNCTION__ "(), max_sdu_size=%d\n", max_sdu_size);
+
 	ASSERT(self != NULL, return -EBADR;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -EBADR;);
 
 	if (self->connected)
 		return -EISCONN;
-	
+
 	/* Any userdata supplied? */
 	if (userdata == NULL) {
 		skb = dev_alloc_skb(64);
-		if (!skb) 
+		if (!skb)
 			return -ENOMEM;
-		
+
 		/* Reserve space for MUX_CONTROL and LAP header */
 		skb_reserve(skb, TTP_MAX_HEADER);
 	} else {
 		skb = userdata;
-		/*  
-		 *  Check that the client has reserved enough space for 
+		/*
+		 *  Check that the client has reserved enough space for
 		 *  headers
 		 */
 		ASSERT(skb_headroom(userdata) >= TTP_MAX_HEADER, return -1;);
@@ -1079,7 +1079,7 @@
 
 	self->remote_credit = 0;
 	self->send_credit = 0;
-	
+
 	/*
 	 *  Give away max 127 credits for now
 	 */
@@ -1092,41 +1092,41 @@
 
 	/* SAR enabled? */
 	if (max_sdu_size > 0) {
-		ASSERT(skb_headroom(skb) >= (TTP_MAX_HEADER + TTP_SAR_HEADER), 
+		ASSERT(skb_headroom(skb) >= (TTP_MAX_HEADER + TTP_SAR_HEADER),
 		       return -1;);
 
 		/* Insert SAR parameters */
 		frame = skb_push(skb, TTP_HEADER+TTP_SAR_HEADER);
-		
-		frame[0] = TTP_PARAMETERS | n; 
+
+		frame[0] = TTP_PARAMETERS | n;
 		frame[1] = 0x04; /* Length */
 		frame[2] = 0x01; /* MaxSduSize */
 		frame[3] = 0x02; /* Value length */
 
-		put_unaligned(cpu_to_be16((__u16) max_sdu_size), 
+		put_unaligned(cpu_to_be16((__u16) max_sdu_size),
 			      (__u16 *)(frame+4));
 	} else {
 		/* Insert plain TTP header */
 		frame = skb_push(skb, TTP_HEADER);
-		
+
 		/* Insert initial credit in frame */
 		frame[0] = n & 0x7f;
 	}
 
 	/* Connect with IrLMP. No QoS parameters for now */
-	return irlmp_connect_request(self->lsap, dtsap_sel, saddr, daddr, qos, 
+	return irlmp_connect_request(self->lsap, dtsap_sel, saddr, daddr, qos,
 				     skb);
 }
 
 /*
  * Function irttp_connect_confirm (handle, qos, skb)
  *
- *    Sevice user confirms TSAP connection with peer. 
+ *    Sevice user confirms TSAP connection with peer.
  *
  */
-static void irttp_connect_confirm(void *instance, void *sap, 
+static void irttp_connect_confirm(void *instance, void *sap,
 				  struct qos_info *qos, __u32 max_seg_size,
-				  __u8 max_header_size, struct sk_buff *skb) 
+				  __u8 max_header_size, struct sk_buff *skb)
 {
 	struct tsap_cb *self;
 	int parameters;
@@ -1135,7 +1135,7 @@
 	__u8 n;
 
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
-	
+
 	self = (struct tsap_cb *) instance;
 
 	ASSERT(self != NULL, return;);
@@ -1150,21 +1150,21 @@
 	 *  negotiated QoS for the link.
 	 */
 	if (qos) {
-		IRDA_DEBUG(4, "IrTTP, Negotiated BAUD_RATE: %02x\n", 
-		       qos->baud_rate.bits);			
-		IRDA_DEBUG(4, "IrTTP, Negotiated BAUD_RATE: %d bps.\n", 
+		IRDA_DEBUG(4, "IrTTP, Negotiated BAUD_RATE: %02x\n",
+		       qos->baud_rate.bits);
+		IRDA_DEBUG(4, "IrTTP, Negotiated BAUD_RATE: %d bps.\n",
 		       qos->baud_rate.value);
 	}
 
 	n = skb->data[0] & 0x7f;
-	
+
 	IRDA_DEBUG(4, __FUNCTION__ "(), Initial send_credit=%d\n", n);
-	
+
 	self->send_credit = n;
 	self->tx_max_sdu_size = 0;
 	self->connected = TRUE;
 
-	parameters = skb->data[0] & 0x80;	
+	parameters = skb->data[0] & 0x80;
 
 	ASSERT(skb->len >= TTP_HEADER, return;);
 	skb_pull(skb, TTP_HEADER);
@@ -1173,13 +1173,13 @@
 		plen = skb->data[0];
 
 		ret = irda_param_extract_all(self, skb->data+1,
-					     IRDA_MIN(skb->len-1, plen), 
+					     IRDA_MIN(skb->len-1, plen),
 					     &param_info);
 
 		/* Any errors in the parameter list? */
 		if (ret < 0) {
-			WARNING(__FUNCTION__ 
-				"(), error extracting parameters\n");
+			WARNING("%s: error extracting parameters\n",
+					__FUNCTION__);
 			dev_kfree_skb(skb);
 
 			/* Do not accept this connection attempt */
@@ -1188,8 +1188,8 @@
 		/* Remove parameters */
 		skb_pull(skb, IRDA_MIN(skb->len, plen+1));
 	}
-	
-	IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", 
+
+	IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n",
 	      self->send_credit, self->avail_credit, self->remote_credit);
 
 	IRDA_DEBUG(2, __FUNCTION__ "(), MaxSduSize=%d\n", self->tx_max_sdu_size);
@@ -1208,8 +1208,8 @@
  *
  */
 void irttp_connect_indication(void *instance, void *sap, struct qos_info *qos,
-			      __u32 max_seg_size, __u8 max_header_size, 
-			      struct sk_buff *skb) 
+			      __u32 max_seg_size, __u8 max_header_size,
+			      struct sk_buff *skb)
 {
 	struct tsap_cb *self;
 	struct lsap_cb *lsap;
@@ -1222,7 +1222,7 @@
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
- 	ASSERT(skb != NULL, return;);
+	ASSERT(skb != NULL, return;);
 
 	lsap = (struct lsap_cb *) sap;
 
@@ -1238,7 +1238,7 @@
 
 	self->send_credit = n;
 	self->tx_max_sdu_size = 0;
-	
+
 	parameters = skb->data[0] & 0x80;
 
 	ASSERT(skb->len >= TTP_HEADER, return;);
@@ -1246,17 +1246,17 @@
 
 	if (parameters) {
 		plen = skb->data[0];
-		
+
 		ret = irda_param_extract_all(self, skb->data+1,
-					     IRDA_MIN(skb->len-1, plen), 
+					     IRDA_MIN(skb->len-1, plen),
 					     &param_info);
 
 		/* Any errors in the parameter list? */
 		if (ret < 0) {
-			WARNING(__FUNCTION__ 
-				"(), error extracting parameters\n");
+			WARNING("%s: error extracting parameters\n",
+					__FUNCTION__);
 			dev_kfree_skb(skb);
-			
+
 			/* Do not accept this connection attempt */
 			return;
 		}
@@ -1266,8 +1266,8 @@
 	}
 
 	if (self->notify.connect_indication) {
-		self->notify.connect_indication(self->notify.instance, self, 
-						qos, self->tx_max_sdu_size, 
+		self->notify.connect_indication(self->notify.instance, self,
+						qos, self->tx_max_sdu_size,
 						self->max_header_size, skb);
 	} else
 		dev_kfree_skb(skb);
@@ -1278,9 +1278,9 @@
  *
  *    Service user is accepting the connection, just pass it down to
  *    IrLMP!
- * 
+ *
  */
-int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, 
+int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size,
 			   struct sk_buff *userdata)
 {
 	struct sk_buff *skb;
@@ -1291,9 +1291,9 @@
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
 
-	IRDA_DEBUG(4, __FUNCTION__ "(), Source TSAP selector=%02x\n", 
+	IRDA_DEBUG(4, __FUNCTION__ "(), Source TSAP selector=%02x\n",
 		   self->stsap_sel);
-	
+
 	/* Any userdata supplied? */
 	if (userdata == NULL) {
 		skb = dev_alloc_skb(64);
@@ -1304,13 +1304,13 @@
 		skb_reserve(skb, TTP_MAX_HEADER);
 	} else {
 		skb = userdata;
-		/*  
-		 *  Check that the client has reserved enough space for 
+		/*
+		 *  Check that the client has reserved enough space for
 		 *  headers
 		 */
 		ASSERT(skb_headroom(skb) >= TTP_MAX_HEADER, return -1;);
 	}
-	
+
 	self->avail_credit = 0;
 	self->remote_credit = 0;
 	self->rx_max_sdu_size = max_sdu_size;
@@ -1330,30 +1330,30 @@
 
 	/* SAR enabled? */
 	if (max_sdu_size > 0) {
-		ASSERT(skb_headroom(skb) >= (TTP_MAX_HEADER+TTP_SAR_HEADER), 
+		ASSERT(skb_headroom(skb) >= (TTP_MAX_HEADER+TTP_SAR_HEADER),
 		       return -1;);
-		
+
 		/* Insert TTP header with SAR parameters */
 		frame = skb_push(skb, TTP_HEADER+TTP_SAR_HEADER);
-		
+
 		frame[0] = TTP_PARAMETERS | n;
 		frame[1] = 0x04; /* Length */
 
 		/* irda_param_insert(self, IRTTP_MAX_SDU_SIZE, frame+1,  */
-/* 				  TTP_SAR_HEADER, &param_info) */
-		
+/*				  TTP_SAR_HEADER, &param_info) */
+
 		frame[2] = 0x01; /* MaxSduSize */
 		frame[3] = 0x02; /* Value length */
 
-		put_unaligned(cpu_to_be16((__u16) max_sdu_size), 
+		put_unaligned(cpu_to_be16((__u16) max_sdu_size),
 			      (__u16 *)(frame+4));
 	} else {
 		/* Insert TTP header */
 		frame = skb_push(skb, TTP_HEADER);
-		
+
 		frame[0] = n & 0x7f;
 	}
-	 
+
 	ret = irlmp_connect_response(self->lsap, skb);
 
 	return ret;
@@ -1365,7 +1365,7 @@
  *    Duplicate TSAP, can be used by servers to confirm a connection on a
  *    new TSAP so it can keep listening on the old one.
  */
-struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance) 
+struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance)
 {
 	struct tsap_cb *new;
 
@@ -1400,11 +1400,11 @@
 /*
  * Function irttp_disconnect_request (self)
  *
- *    Close this connection please! If priority is high, the queued data 
+ *    Close this connection please! If priority is high, the queued data
  *    segments, if any, will be deallocated first
  *
  */
-int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *userdata, 
+int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *userdata,
 			     int priority)
 {
 	struct sk_buff *skb;
@@ -1441,15 +1441,15 @@
 	 */
 	if (skb_queue_len(&self->tx_queue) > 0) {
 		if (priority == P_HIGH) {
-			/* 
-			 *  No need to send the queued data, if we are 
+			/*
+			 *  No need to send the queued data, if we are
 			 *  disconnecting right now since the data will
 			 *  not have any usable connection to be sent on
 			 */
 			IRDA_DEBUG(1, __FUNCTION__  "High priority!!()\n" );
 			irttp_flush_queues(self);
 		} else if (priority == P_NORMAL) {
-			/* 
+			/*
 			 *  Must delay disconnect until after all data segments
 			 *  have been sent and the tx_queue is empty
 			 */
@@ -1474,12 +1474,12 @@
 		skb = dev_alloc_skb(64);
 		if (!skb)
 			return -ENOMEM;
-		
-		/* 
-		 *  Reserve space for MUX and LAP header 
+
+		/*
+		 *  Reserve space for MUX and LAP header
 		 */
 		skb_reserve(skb, TTP_MAX_HEADER);
-		
+
 		userdata = skb;
 	}
 	ret = irlmp_disconnect_request(self->lsap, userdata);
@@ -1496,21 +1496,21 @@
  *    Disconnect indication, TSAP disconnected by peer?
  *
  */
-void irttp_disconnect_indication(void *instance, void *sap, LM_REASON reason, 
-				 struct sk_buff *skb) 
+void irttp_disconnect_indication(void *instance, void *sap, LM_REASON reason,
+				 struct sk_buff *skb)
 {
 	struct tsap_cb *self;
 
 	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	self = (struct tsap_cb *) instance;
-	
+
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
-	
+
 	/* Prevent higher layer to send more data */
 	self->connected = FALSE;
-	
+
 	/* Check if client has already tried to close the TSAP */
 	if (self->close_pend) {
 		/* In this case, the higher layer is probably gone. Don't
@@ -1558,18 +1558,18 @@
 	/* Usually the layer above will notify that it's input queue is
 	 * starting to get filled by using the flow request, but this may
 	 * be difficult, so it can instead just refuse to eat it and just
-	 * give an error back 
+	 * give an error back
 	 */
 	if (err == -ENOMEM) {
 		IRDA_DEBUG(0, __FUNCTION__ "() requeueing skb!\n");
 
 		/* Make sure we take a break */
 		self->rx_sdu_busy = TRUE;
-		
+
 		/* Need to push the header in again */
 		skb_push(skb, TTP_HEADER);
 		skb->data[0] = 0x00; /* Make sure MORE bit is cleared */
-		
+
 		/* Put skb back on queue */
 		skb_queue_head(&self->rx_queue, skb);
 	}
@@ -1581,18 +1581,18 @@
  *     Check if we have any frames to be transmitted, or if we have any
  *     available credit to give away.
  */
-void irttp_run_rx_queue(struct tsap_cb *self) 
+void irttp_run_rx_queue(struct tsap_cb *self)
 {
 	struct sk_buff *skb;
 	int more = 0;
 
-	IRDA_DEBUG(2, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", 
+	IRDA_DEBUG(2, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n",
 		   self->send_credit, self->avail_credit, self->remote_credit);
 
 	/* Get exclusive access to the rx queue, otherwise don't touch it */
 	if (irda_lock(&self->rx_queue_lock) == FALSE)
 		return;
-	
+
 	/*
 	 *  Reassemble all frames in receive queue and deliver them
 	 */
@@ -1606,7 +1606,7 @@
 		/* Add the length of the remaining data */
 		self->rx_sdu_size += skb->len;
 
-		/*  
+		/*
 		 * If SAR is disabled, or user has requested no reassembly
 		 * of received fragments then we just deliver them
 		 * immediately. This can be requested by clients that
@@ -1621,8 +1621,8 @@
 
 		/* Check if this is a fragment, and not the last fragment */
 		if (more) {
-			/*  
-			 *  Queue the fragment if we still are within the 
+			/*
+			 *  Queue the fragment if we still are within the
 			 *  limits of the maximum size of the rx_sdu
 			 */
 			if (self->rx_sdu_size <= self->rx_max_sdu_size) {
@@ -1638,32 +1638,32 @@
 		 *  This is the last fragment, so time to reassemble!
 		 */
 		if ((self->rx_sdu_size <= self->rx_max_sdu_size) ||
-		    (self->rx_max_sdu_size == TTP_SAR_UNBOUND)) 
+		    (self->rx_max_sdu_size == TTP_SAR_UNBOUND))
 		{
-			/* 
+			/*
 			 * A little optimizing. Only queue the fragment if
 			 * there are other fragments. Since if this is the
 			 * last and only fragment, there is no need to
-			 * reassemble :-) 
+			 * reassemble :-)
 			 */
 			if (!skb_queue_empty(&self->rx_fragments)) {
-				skb_queue_tail(&self->rx_fragments, 
+				skb_queue_tail(&self->rx_fragments,
 					       skb);
-				
+
 				skb = irttp_reassemble_skb(self);
 			}
-			
+
 			/* Now we can deliver the reassembled skb */
 			irttp_do_data_indication(self, skb);
 		} else {
 			IRDA_DEBUG(1, __FUNCTION__ "(), Truncated frame\n");
-			
+
 			/* Free the part of the SDU that is too big */
 			dev_kfree_skb(skb);
 
 			/* Deliver only the valid but truncated part of SDU */
 			skb = irttp_reassemble_skb(self);
-			
+
 			irttp_do_data_indication(self, skb);
 		}
 		self->rx_sdu_size = 0;
@@ -1671,7 +1671,7 @@
 
 	/*
 	 * It's not trivial to keep track of how many credits are available
-	 * by incrementing at each packet, because delivery may fail 
+	 * by incrementing at each packet, because delivery may fail
 	 * (irttp_do_data_indication() may requeue the frame) and because
 	 * we need to take care of fragmentation.
 	 * We want the other side to send up to initial_credit packets.
@@ -1721,11 +1721,11 @@
 	struct tsap_cb *self;
 	unsigned long flags;
 	int i = 0;
-	
+
 	ASSERT(irttp != NULL, return 0;);
-	
+
 	len = 0;
-	
+
 	save_flags(flags);
 	cli();
 
@@ -1735,9 +1735,9 @@
 			break;
 
 		len += sprintf(buf+len, "TSAP %d, ", i++);
-		len += sprintf(buf+len, "stsap_sel: %02x, ", 
+		len += sprintf(buf+len, "stsap_sel: %02x, ",
 			       self->stsap_sel);
-		len += sprintf(buf+len, "dtsap_sel: %02x\n", 
+		len += sprintf(buf+len, "dtsap_sel: %02x\n",
 			       self->dtsap_sel);
 		len += sprintf(buf+len, "  connected: %s, ",
 			       self->connected? "TRUE":"FALSE");
@@ -1751,9 +1751,9 @@
 			       self->stats.tx_packets);
 		len += sprintf(buf+len, "rx packets: %ld, ",
 			       self->stats.rx_packets);
-		len += sprintf(buf+len, "tx_queue len: %d ", 
+		len += sprintf(buf+len, "tx_queue len: %d ",
 			       skb_queue_len(&self->tx_queue));
-		len += sprintf(buf+len, "rx_queue len: %d\n", 
+		len += sprintf(buf+len, "rx_queue len: %d\n",
 			       skb_queue_len(&self->rx_queue));
 		len += sprintf(buf+len, "  tx_sdu_busy: %s, ",
 			       self->tx_sdu_busy? "TRUE":"FALSE");
@@ -1766,11 +1766,11 @@
 		len += sprintf(buf+len, "rx_max_sdu_size: %d\n",
 			       self->rx_max_sdu_size);
 
-		len += sprintf(buf+len, "  Used by (%s)\n", 
+		len += sprintf(buf+len, "  Used by (%s)\n",
 				self->notify.name);
 
 		len += sprintf(buf+len, "\n");
-		
+
 		self = (struct tsap_cb *) hashbin_get_next(irttp->tsaps);
 	}
 	restore_flags(flags);
#48 lore raw

Re: [PATCH] 2.5.21 "I can't get no compilation"

In reply to Linus Torvalds
Quoted 8 lines · Anton Altaparmakov
Quoted 4 lines · Martin Dalecki

The subject says it all...

Contrary to other proposed patches I realized that there is no such thing as vmalloc_dma.

Quoted 9 lines

Perhaps you ought to look in mm/vmalloc.c which contains:

void * vmalloc_dma (unsigned long size)

{
        return __vmalloc(size, GFP_KERNEL|GFP_DMA, PAGE_KERNEL);
}

Or are you going to tell me that is a figment of my imagination?

Oh I have missed the chunk which delets it there apparently, since *nobody* is using this. The only place where a special __vmalloc setup code is used in nfs which GFP_NOFS flag added, but not the above. so providing vmalloc_nofs would make more sense then vmalloc_dma.

#49 lore raw

Re: [PATCH] 2.5.21 "I can't get no compilation"

Quoted 15 lines · Martin Dalecki
Quoted 7 lines · Anton Altaparmakov
Quoted 4 lines · Martin Dalecki

The subject says it all...

Contrary to other proposed patches I realized that there is no such thing as vmalloc_dma.

Quoted 6 lines

Perhaps you ought to look in mm/vmalloc.c which contains:
void * vmalloc_dma (unsigned long size)

{
        return __vmalloc(size, GFP_KERNEL|GFP_DMA, PAGE_KERNEL);
}

Or are you going to tell me that is a figment of my imagination?

Quoted 2 lines

Oh I have missed the chunk which delets it there apparently, since *nobody* is using this.

It could be used by out of kernel tree code. (Note I don't know any code that does...)

Quoted 4 lines

The only place where a special
__vmalloc setup code is used in nfs which GFP_NOFS flag added, but not the above. so providing vmalloc_nofs would make more sense then vmalloc_dma.

NTFS defines its own vmalloc_nofs (fs/ntfs/malloc.h) so if you intend to add a generic vmalloc_nofs, please remove the ntfs one (or ntfs will break)...

btw. the ntfs definition is:

static inline void *vmalloc_nofs(unsigned long size)

{
        if (likely(size >> PAGE_SHIFT < num_physpages)
                return __vmalloc(size, GFP_NOFS | __GFP_HIGHMEM, PAGE_KERNEL);
        return NULL;
}

Best regards,

Anton

Signature · 5 lines
  "I've not lost my mind. It's backed up on tape somewhere." - Unknown
-- 
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
#50 lore raw

[REVERT] 2.5.21 s390/block/xpram.c

In reply to Linus Torvalds

During the course of the patch-2.5.21 I noticed the following attached chunk, which resurrect hardsects array in the affected code. This is of course entierly bogous. Please revert this chunk, since it's most propably just a merge error on behalf of the Big Blue.

Oh well oh well...

drivers/s390/block/xpram.c +16 -1
diff -Nru a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
@@ -158,6 +158,7 @@
 /* The following items are obtained through kmalloc() in init_module() */
 
 Xpram_Dev *xpram_devices = NULL;
+int *xpram_hardsects = NULL;
 int *xpram_offsets = NULL;   /* partition offsets */
 
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
@@ -938,7 +939,6 @@
 
 	q = BLK_DEFAULT_QUEUE(major);
 	blk_init_queue (q, xpram_request);
-	blk_queue_hardsect_size(q, xpram_hardsect);
 
 	/* we want to have XPRAM_UNUSED blocks security buffer between devices */
 	mem_usable=xpram_mem_avail-(XPRAM_UNUSED*(xpram_devs-1));
@@ -978,6 +978,16 @@
 		PRINT_DEBUG(" device(%d) offset = %d kB, size = %d kB\n",i, xpram_offsets[i], xpram_sizes[i]);
 #endif
 
+	xpram_hardsects = kmalloc(xpram_devs * sizeof(int), GFP_KERNEL);
+	if (!xpram_hardsects) {
+		PRINT_ERR("Not enough memory for xpram_hardsects\n");
+                PRINT_ERR("Giving up xpram\n");
+		goto fail_malloc_hardsects;
+	}
+	for (i=0; i < xpram_devs; i++) /* all the same hardsect */
+		xpram_hardsects[i] = xpram_hardsect;
+	hardsect_size[major]=xpram_hardsects;
+   
 	/* 
 	 * allocate the devices -- we can't have them static, as the number
 	 * can be specified at load time
@@ -1030,6 +1040,7 @@
 		  goto fail_devfs_register;
 		}
 #endif  /* WHY? */
+				 
 	}
 
 	return 0; /* succeed */
@@ -1042,7 +1053,10 @@
 	}
 	kfree(xpram_devices);
 	kfree (xpram_offsets);
+ fail_malloc_hardsects:
  fail_malloc_devices:
+	kfree(xpram_hardsects);
+	hardsect_size[major] = NULL;
  fail_malloc:
 	/* ???	unregister_chrdev(major, "xpram"); */
 	unregister_blkdev(major, "xpram");
@@ -1072,6 +1086,7 @@
 	int i;
 
 	/* first of all, reset all the data structures */
+	kfree(hardsect_size[major]);
 	kfree(xpram_offsets);
 	blk_clear(major);
 
#51 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds

Maksim (Max) Krasnyanskiy wrote:-

Quoted 4 lines

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed.

No, it doesn't, it warns that string concatenation with __FUNCTION__ is deprecated and will be removed (I wrote the code).

__FUNCTION__ itself will stay forever.

Neil.

#52 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

Quoted 2 lines

__FUNCTION__ itself will stay forever.

Ok. Then it's not an issue. We should just fix macros that do concatenation.

Thanks
Max

#53 lore raw

Re: [PATCH] 2.5.21 kill warnings 5/19

In reply to Linus Torvalds
Quoted 2 lines · Martin Dalecki

Fix improper __FUNCTION__ usage in st680 driver code, cdc-ether.c. Fix namespace clash in cdc-ether.h

Would you mind sending these as original posts and not as replies to Linus' announcement?

Thanks,
Bill

#54 lore raw

Re: [PATCH] 2.5.21 kill warnings 5/19

In reply to Linus Torvalds
Quoted 6 lines · William Lee Irwin III
Quoted 2 lines · Martin Dalecki

Fix improper __FUNCTION__ usage in st680 driver code, cdc-ether.c. Fix namespace clash in cdc-ether.h

Would you mind sending these as original posts and not as replies to Linus' announcement?

I'm sure the "reply" button is the only button some mail clients have. Don't blame the people - blame the mail clients. 8)

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#55 lore raw

Re: [PATCH] 2.5.21 kill warnings 5/19

In reply to Linus Torvalds
Quoted 2 lines · Martin Dalecki

Fix improper __FUNCTION__ usage in st680 driver code, cdc-ether.c. Fix namespace clash in cdc-ether.h

What namespace clash? It builds just find for me.

And don't try to clean up the __FUNCTION__ mess in the USB drivers right now, I'll do them all at once when we have to move up to a newer version of gcc for some other reason.

thanks,

greg k-h

#56 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 1 line · Martin Dalecki

Fix improper usage of __FUNCTION__ in usb code.

It's not improper. Well it wasn't when it was written, but the gcc authors decided to change their minds... :(

As stated before, I'll clean up all of the USB drivers later all at once, and the pci hotplug drivers as well. The USB drivers could use with some good debugging macro cleanup in general...

Martin, any reason you are doing all of this "cleanup" without sending the patches to the relevant maintainers?

thanks,

greg k-h

#57 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 8 lines · Maksim (Max) Krasnyanskiy

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed. Here is how I did it in Bluetooth code:

        #define BT_DBG(fmt, arg...)  printk(KERN_INFO "%s: " fmt "\n" , 

__func__ , ## arg)
no more warnings from gcc.

GCC doesn't warn that __FUNCTION__ is obsolete.
The usage of __FUNCTION__ as string literal is what is offending it. __func__ is a GNU "extension".

#58 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 8 lines · Greg KH
Quoted 1 line · Martin Dalecki

Fix improper usage of __FUNCTION__ in usb code.

It's not improper. Well it wasn't when it was written, but the gcc authors decided to change their minds... :(

Quoted 6 lines

As stated before, I'll clean up all of the USB drivers later all at once, and the pci hotplug drivers as well. The USB drivers could use with some good debugging macro cleanup in general...

Martin, any reason you are doing all of this "cleanup" without sending the patches to the relevant maintainers?

1. I know you read lkml.

2. The patches are trival.

3. Having them helps using GCC 3.1, which turns out to be a big winner contrary to 3.0.xx.

4. I use GCC 3.1 becouse I hate having different compilers on the system and becouse I do some C++ too.

5. We have to do it anyway - so what?

6. In esp. ARM seems to be much better off with GCC 3.1 then anything else.

7. Separating __FUNCTION__ out from string const concatenation allows the compiler to coalesce the storage used for this string in to one constant!

#59 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 9 lines · Martin Dalecki
Quoted 8 lines · Greg KH
Quoted 1 line · Martin Dalecki

Fix improper usage of __FUNCTION__ in usb code.

It's not improper. Well it wasn't when it was written, but the gcc authors decided to change their minds... :(

Quoted 8 lines
Quoted 6 lines

As stated before, I'll clean up all of the USB drivers later all at once, and the pci hotplug drivers as well. The USB drivers could use with some good debugging macro cleanup in general...

Martin, any reason you are doing all of this "cleanup" without sending the patches to the relevant maintainers?

1. I know you read lkml.

Yeah, but not all the other maintainers do, it's still good form to at least CC: them on things like this.

And remember, other maintainers aren't as nice as I am :)

greg k-h

#60 lore raw

PATCH 1/1 2.5.21 IDE 87

In reply to Linus Torvalds

Sun Jun 9 15:31:56 CEST 2002 ide-clean-87

- Sync with 2.5.21

- Don't call put_device inside idedisk_cleanup(). This is apparently triggering some bug inside the handling of device trees. Or we don't register the device properly within the tree. Check this later.

- Further work on the channel register file access locking. Push the locking out from __ide_end_request to ide_end_request. Rename those functions to respective __ata_end_request() and ata_end_request().

- Move ide_wait_status to device.c rename it to ata_status_poll().

- Further work on locking scope issues.

- devfs showed us once again that it changed the policy from agnostic numbers to unpleasant string names. What a piece of crap!

drivers/ide/device.c +74 -1
diff -urN linux-2.5.21/drivers/ide/device.c linux/drivers/ide/device.c
@@ -80,7 +80,29 @@
 }
 
 /*
+ * Spin until the drive is no longer busy.
+ *
+ * Not exported, since it's not used within any modules.
+ */
+int ata_busy_poll(struct ata_device *drive, unsigned long timeout)
+{
+	/* spec allows drive 400ns to assert "BUSY" */
+	udelay(1);
+	if (!ata_status(drive, 0, BUSY_STAT)) {
+		timeout += jiffies;
+		while (!ata_status(drive, 0, BUSY_STAT)) {
+			if (time_after(jiffies, timeout))
+				return 1;
+		}
+	}
+
+	return 0;
+}
+
+/*
  * Check the state of the status register.
+ *
+ * FIXME: Channel lock should be held.
  */
 int ata_status(struct ata_device *drive, u8 good, u8 bad)
 {
@@ -94,6 +116,57 @@
 EXPORT_SYMBOL(ata_status);
 
 /*
+ * Busy-wait for the drive status to be not "busy".  Check then the status for
+ * all of the "good" bits and none of the "bad" bits, and if all is okay it
+ * returns 0.  All other cases return 1 after invoking error handler -- caller
+ * should just return.
+ *
+ * This routine should get fixed to not hog the cpu during extra long waits..
+ * That could be done by busy-waiting for the first jiffy or two, and then
+ * setting a timer to wake up at half second intervals thereafter, until
+ * timeout is achieved, before timing out.
+ *
+ * FIXME: Channel lock should be held.
+ */
+
+int ata_status_poll(struct ata_device *drive, u8 good, u8 bad,
+		unsigned long timeout,
+		struct request *rq, ide_startstop_t *startstop)
+{
+	int i;
+
+	/* bail early if we've exceeded max_failures */
+	if (drive->max_failures && (drive->failures > drive->max_failures)) {
+		*startstop = ide_stopped;
+
+		return 1;
+	}
+
+	if (ata_busy_poll(drive, timeout)) {
+		*startstop = ata_error(drive, rq, "status timeout");
+
+		return 1;
+	}
+
+	/*
+	 * Allow status to settle, then read it again.  A few rare drives
+	 * vastly violate the 400ns spec here, so we'll wait up to 10usec for a
+	 * "good" status rather than expensively fail things immediately.  This
+	 * fix courtesy of Matthew Faupel & Niccolo Rigacci.
+	 */
+	for (i = 0; i < 10; i++) {
+		udelay(1);
+		if (ata_status(drive, good, bad))
+			return 0;
+	}
+	*startstop = ata_error(drive, rq, "status error");
+
+	return 1;
+}
+
+EXPORT_SYMBOL(ata_status_poll);
+
+/*
  * Handle the nIEN - negated Interrupt ENable of the drive.
  * This is controlling whatever the drive will acnowlenge commands
  * with interrupts or not.
@@ -160,7 +233,7 @@
 }
 
 /*
- * Output a complete register file.
+ * Input a complete register file.
  */
 void ata_in_regfile(struct ata_device *drive, struct hd_drive_task_hdr *rf)
 {
drivers/ide/ide.c +148 -192

508 lines not on this page · raw message

drivers/ide/ide-cd.c +20 -5
diff -urN linux-2.5.21/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
@@ -556,7 +556,7 @@
 	if ((rq->flags & REQ_CMD) && !rq->current_nr_sectors)
 		uptodate = 1;
 
-	ide_end_request(drive, rq, uptodate);
+	ata_end_request(drive, rq, uptodate);
 }
 
 
@@ -734,7 +734,7 @@
 	struct cdrom_info *info = drive->driver_data;
 
 	/* Wait for the controller to be idle. */
-	if (ide_wait_stat(&startstop, drive, rq, 0, BUSY_STAT, WAIT_READY))
+	if (ata_status_poll(drive, 0, BUSY_STAT, WAIT_READY, rq, &startstop))
 		return startstop;
 
 	spin_lock_irqsave(ch->lock, flags);
@@ -798,7 +798,8 @@
 			return startstop;
 	} else {
 		/* Otherwise, we must wait for DRQ to get set. */
-		if (ide_wait_stat(&startstop, drive, rq, DRQ_STAT, BUSY_STAT, WAIT_READY))
+		if (ata_status_poll(drive, DRQ_STAT, BUSY_STAT,
+					WAIT_READY, rq, &startstop))
 			return startstop;
 	}
 
@@ -926,7 +927,14 @@
 
 	if (dma) {
 		if (!dma_error) {
-			__ide_end_request(drive, rq, 1, rq->nr_sectors);
+			/* FIXME: this locking should encompass the above register
+			 * file access too.
+			 */
+
+			spin_lock_irqsave(ch->lock, flags);
+			__ata_end_request(drive, rq, 1, rq->nr_sectors);
+			spin_unlock_irqrestore(ch->lock, flags);
+
 			return ide_stopped;
 		} else
 			return ata_error(drive, rq, "dma error");
@@ -1518,7 +1526,14 @@
 		if (dma_error)
 			return ata_error(drive, rq, "dma error");
 
-		__ide_end_request(drive, rq, 1, rq->nr_sectors);
+		/* FIXME: this locking should encompass the above register
+		 * file access too.
+		 */
+
+		spin_lock_irqsave(ch->lock, flags);
+		__ata_end_request(drive, rq, 1, rq->nr_sectors);
+		spin_unlock_irqrestore(ch->lock, flags);
+
 		return ide_stopped;
 	}
 
drivers/ide/ide-disk.c +191 -183

547 lines not on this page · raw message

drivers/ide/ide-floppy.c +36 -29

116 lines not on this page · raw message

drivers/ide/ide-tape.c +12 -9
diff -urN linux-2.5.21/drivers/ide/ide-tape.c linux/drivers/ide/ide-tape.c
@@ -2196,9 +2196,12 @@
 	idetape_ireason_reg_t ireason;
 	int retries = 100;
 	ide_startstop_t startstop;
+	int ret;
 
-	if (ide_wait_stat(&startstop, drive, rq, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
+	if (ata_status_poll(drive, DRQ_STAT, BUSY_STAT,
+				WAIT_READY, rq, &startstop)) {
 		printk (KERN_ERR "ide-tape: Strange, packet command initiated yet DRQ isn't asserted\n");
+
 		return startstop;
 	}
 
@@ -2220,16 +2223,16 @@
 	}
 	if (!ireason.b.cod || ireason.b.io) {
 		printk (KERN_ERR "ide-tape: (IO,CoD) != (0,1) while issuing a packet command\n");
-		spin_unlock_irqrestore(ch->lock, flags);
-
-		return ide_stopped;
+		ret = ide_stopped;
+	} else {
+		tape->cmd_start_time = jiffies;
+		ata_set_handler(drive, idetape_pc_intr, IDETAPE_WAIT_CMD, NULL);	/* Set the interrupt routine */
+		atapi_write(drive,pc->c,12);	/* Send the actual packet */
+		ret = ide_started;
 	}
-	tape->cmd_start_time = jiffies;
-	ata_set_handler(drive, idetape_pc_intr, IDETAPE_WAIT_CMD, NULL);	/* Set the interrupt routine */
-	atapi_write(drive,pc->c,12);	/* Send the actual packet */
 	spin_unlock_irqrestore(ch->lock, flags);
 
-	return ide_started;
+	return ret;
 }
 
 static ide_startstop_t idetape_issue_packet_command(struct ata_device *drive,
@@ -2618,7 +2621,7 @@
 		 *	We do not support buffer cache originated requests.
 		 */
 		printk (KERN_NOTICE "ide-tape: %s: Unsupported command in request queue (%ld)\n", drive->name, rq->flags);
-		ide_end_request(drive, rq, 0);			/* Let the common code handle it */
+		ata_end_request(drive, rq, 0);			/* Let the common code handle it */
 		return ide_stopped;
 	}
 
drivers/ide/ide-taskfile.c +2 -1
diff -urN linux-2.5.21/drivers/ide/ide-taskfile.c linux/drivers/ide/ide-taskfile.c
@@ -233,7 +233,8 @@
 		    ar->cmd == WIN_MULTWRITE_EXT) {
 			ide_startstop_t startstop;
 
-			if (ide_wait_stat(&startstop, drive, rq, DATA_READY, drive->bad_wstat, WAIT_DRQ)) {
+			if (ata_status_poll(drive, DATA_READY, drive->bad_wstat,
+						WAIT_DRQ, rq, &startstop)) {
 				printk(KERN_ERR "%s: no DRQ after issuing %s\n",
 						drive->name, drive->mult_count ? "MULTWRITE" : "WRITE");
 				return startstop;
drivers/ide/main.c +5 -5
diff -urN linux-2.5.21/drivers/ide/main.c linux/drivers/ide/main.c
@@ -430,7 +430,7 @@
 		struct ata_device *drive = &ch->drives[i];
 
 		if (drive->de) {
-			devfs_unregister (drive->de);
+			devfs_unregister(drive->de);
 			drive->de = NULL;
 		}
 		if (!drive->present)
@@ -1246,7 +1246,7 @@
 			return NOTIFY_DONE;
 	}
 
-	printk("flushing ide devices: ");
+	printk(KERN_INFO "flushing ATA/ATAPI devices: ");
 
 	for (i = 0; i < MAX_HWIFS; i++) {
 		int unit;
@@ -1264,9 +1264,10 @@
 			/* set the drive to standby */
 			printk("%s ", drive->name);
 			if (ata_ops(drive)) {
-				if (event != SYS_RESTART)
+				if (event != SYS_RESTART) {
 					if (ata_ops(drive)->standby && ata_ops(drive)->standby(drive))
 						continue;
+				}
 
 				if (ata_ops(drive)->cleanup)
 					ata_ops(drive)->cleanup(drive);
@@ -1290,8 +1291,7 @@
 {
 	printk(KERN_INFO "ATA/ATAPI device driver v" VERSION "\n");
 
-	ide_devfs_handle = devfs_mk_dir(NULL, "ata", NULL);
-	devfs_mk_symlink(NULL, "ide", DEVFS_FL_DEFAULT, "ata", NULL, NULL);
+	ide_devfs_handle = devfs_mk_dir(NULL, "ide", NULL);
 
 	/*
 	 * Because most of the ATA adapters represent the timings in unit of
drivers/ide/pcidma.c +11 -1
diff -urN linux-2.5.21/drivers/ide/pcidma.c linux/drivers/ide/pcidma.c
@@ -44,7 +44,17 @@
 
 	if (ata_status(drive, DRIVE_READY, drive->bad_wstat | DRQ_STAT)) {
 		if (!dma_stat) {
-			__ide_end_request(drive, rq, 1, rq->nr_sectors);
+			unsigned long flags;
+			struct ata_channel *ch = drive->channel;
+
+			/* FIXME: this locking should encompass the above register
+			 * file access too.
+			 */
+
+			spin_lock_irqsave(ch->lock, flags);
+			__ata_end_request(drive, rq, 1, rq->nr_sectors);
+			spin_unlock_irqrestore(ch->lock, flags);
+
 			return ide_stopped;
 		}
 		printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n",
drivers/ide/pdc4030.c +17 -9
diff -urN linux-2.5.21/drivers/ide/pdc4030.c linux/drivers/ide/pdc4030.c
@@ -247,7 +247,8 @@
 	if (pdc4030_cmd(drive, PROMISE_GET_CONFIG)) {
 		return 0;
 	}
-	if (ide_wait_stat(&startstop, drive, NULL, DATA_READY,BAD_W_STAT,WAIT_DRQ)) {
+	if (ata_status_poll(drive, DATA_READY, BAD_W_STAT,
+				WAIT_DRQ, NULL, &startstop)) {
 		printk(KERN_INFO
 			"%s: Failed Promise read config!\n",hwif->name);
 		return 0;
@@ -407,7 +408,8 @@
 	rq->nr_sectors -= nsect;
 	total_remaining = rq->nr_sectors;
 	if ((rq->current_nr_sectors -= nsect) <= 0) {
-		ide_end_request(drive, rq, 1);
+		/* FIXME: no queue locking above! */
+		ata_end_request(drive, rq, 1);
 	}
 
 	/*
@@ -461,13 +463,11 @@
  */
 static ide_startstop_t promise_complete_pollfunc(struct ata_device *drive, struct request *rq)
 {
+	unsigned long flags;
 	struct ata_channel *ch = drive->channel;
 
 	if (!ata_status(drive, 0, BUSY_STAT)) {
 		if (time_before(jiffies, ch->poll_timeout)) {
-			unsigned long flags;
-			struct ata_channel *ch = drive->channel;
-
 			/* FIXME: this locking should encompass the above
 			 * register file access too.
 			 */
@@ -488,7 +488,13 @@
 #ifdef DEBUG_WRITE
 	printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name);
 #endif
-	__ide_end_request(drive, rq, 1, rq->nr_sectors);
+	/* FIXME: this locking should encompass the above
+	 * register file access too.
+	 */
+
+	spin_lock_irqsave(ch->lock, flags);
+	__ata_end_request(drive, rq, 1, rq->nr_sectors);
+	spin_unlock_irqrestore(ch->lock, flags);
 
 	return ide_stopped;
 }
@@ -653,7 +659,7 @@
 	/* Check that it's a regular command. If not, bomb out early. */
 	if (!(rq->flags & REQ_CMD)) {
 		blk_dump_rq_flags(rq, "pdc4030 bad flags");
-		ide_end_request(drive, rq, 0);
+		ata_end_request(drive, rq, 0);
 
 		return ide_stopped;
 	}
@@ -721,7 +727,8 @@
  *	call the promise_write function to deal with writing the data out
  * NOTE: No interrupts are generated on writes. Write completion must be polled
  */
-		if (ide_wait_stat(&startstop, drive, rq, DATA_READY, drive->bad_wstat, WAIT_DRQ)) {
+		if (ata_status_poll(drive, DATA_READY, drive->bad_wstat,
+					WAIT_DRQ, rq, &startstop )) {
 			printk(KERN_ERR "%s: no DRQ after issuing "
 			       "PROMISE_WRITE\n", drive->name);
 			return startstop;
@@ -733,7 +740,8 @@
 
 	default:
 		printk(KERN_ERR "pdc4030: command not READ or WRITE! Huh?\n");
-		ide_end_request(drive, rq, 0);
+		/* FIXME: This should already run under the lock. */
+		ata_end_request(drive, rq, 0);
 		return ide_stopped;
 	}
 }
drivers/ide/probe.c +4 -28
diff -urN linux-2.5.21/drivers/ide/probe.c linux/drivers/ide/probe.c
@@ -307,16 +307,7 @@
 		(drive->id->hw_config & 0x6000)) ? 1 : 0);
 }
 
-/*
- * Similar to ide_wait_stat(), except it never calls ata_error internally.
- * This is a kludge to handle the new ide_config_drive_speed() function,
- * and should not otherwise be used anywhere.  Eventually, the tuneproc's
- * should be updated to return ide_startstop_t, in which case we can get
- * rid of this abomination again.  :)   -ml
- *
- * It is gone..........
- *
- * const char *msg == consider adding for verbose errors.
+/* FIXME: Channel lock should be held.
  */
 int ide_config_drive_speed(struct ata_device *drive, byte speed)
 {
@@ -329,12 +320,10 @@
 	outb(inb(ch->dma_base + 2) & ~(1 << (5 + unit)), ch->dma_base + 2);
 #endif
 
-	/*
-	 * Don't use ide_wait_cmd here - it will attempt to set_geometry and
+	/* Don't use ide_wait_cmd here - it will attempt to set_geometry and
 	 * recalibrate, but for some reason these don't work at this point
 	 * (lost interrupt).
-	 */
-        /*
+         *
          * Select the drive, and issue the SETFEATURES command
          */
 	disable_irq(ch->irq);	/* disable_irq_nosync ?? */
@@ -350,20 +339,7 @@
 		ata_irq_enable(drive, 1);
 	udelay(1);
 
-	/*
-	 * Wait for drive to become non-BUSY
-	 */
-	if (!ata_status(drive, 0, BUSY_STAT)) {
-		unsigned long flags, timeout;
-		__save_flags(flags);	/* local CPU only */
-		ide__sti();		/* local CPU only -- for jiffies */
-		timeout = jiffies + WAIT_CMD;
-		while (!ata_status(drive, 0, BUSY_STAT)) {
-			if (time_after(jiffies, timeout))
-				break;
-		}
-		__restore_flags(flags); /* local CPU only */
-	}
+	ata_busy_poll(drive, WAIT_CMD);
 
 	/*
 	 * Allow status to settle, then read it again.
drivers/ide/tcq.c +10 -1
diff -urN linux-2.5.21/drivers/ide/tcq.c linux/drivers/ide/tcq.c
@@ -327,6 +327,8 @@
 
 static ide_startstop_t dmaq_complete(struct ata_device *drive, struct request *rq)
 {
+	unsigned long flags;
+	struct ata_channel *ch = drive->channel;
 	u8 dma_stat;
 
 	/*
@@ -348,7 +350,14 @@
 		printk("%s: bad DMA status (dma_stat=%x)\n", drive->name, dma_stat);
 
 	TCQ_PRINTK("%s: ending %p, tag %d\n", __FUNCTION__, rq, rq->tag);
-	__ide_end_request(drive, rq, !dma_stat, rq->nr_sectors);
+
+	/* FIXME: this locking should encompass the above register
+	 * file access too.
+	 */
+
+	spin_lock_irqsave(ch->lock, flags);
+	__ata_end_request(drive, rq, !dma_stat, rq->nr_sectors);
+	spin_unlock_irqrestore(ch->lock, flags);
 
 	/*
 	 * we completed this command, check if we can service a new command
drivers/scsi/ide-scsi.c +16 -12
diff -urN linux-2.5.21/drivers/scsi/ide-scsi.c linux/drivers/scsi/ide-scsi.c
@@ -244,7 +244,7 @@
 	unsigned long flags;
 
 	if (!(rq->flags & REQ_PC)) {
-		ide_end_request(drive, rq, uptodate);
+		ata_end_request(drive, rq, uptodate);
 		return 0;
 	}
 
@@ -399,29 +399,33 @@
 	struct Scsi_Host *host = drive->driver_data;
 	idescsi_scsi_t *scsi = idescsi_private(host);
 	struct atapi_packet_command *pc = scsi->pc;
-	byte ireason;
+	u8 ireason;
 	ide_startstop_t startstop;
+	int ret;
 
-	if (ide_wait_stat(&startstop, drive, rq, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
+	if (ata_status_poll(drive, DRQ_STAT, BUSY_STAT,
+				WAIT_READY, rq, &startstop)) {
 		printk (KERN_ERR "ide-scsi: Strange, packet command initiated yet DRQ isn't asserted\n");
 		return startstop;
 	}
-	ireason = IN_BYTE (IDE_IREASON_REG);
-	if ((ireason & (IDESCSI_IREASON_IO | IDESCSI_IREASON_COD)) != IDESCSI_IREASON_COD) {
-		printk (KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while issuing a packet command\n");
-		return ide_stopped;
-	}
 
 	/* FIXME: this locking should encompass the above register
 	 * file access too.
 	 */
-
 	spin_lock_irqsave(ch->lock, flags);
-	ata_set_handler(drive, idescsi_pc_intr, get_timeout(pc), NULL);	/* Set the interrupt routine */
+	ireason = IN_BYTE(IDE_IREASON_REG);
+
+	if ((ireason & (IDESCSI_IREASON_IO | IDESCSI_IREASON_COD)) != IDESCSI_IREASON_COD) {
+		printk (KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while issuing a packet command\n");
+		ret = ide_stopped;
+	} else {
+		ata_set_handler(drive, idescsi_pc_intr, get_timeout(pc), NULL);
+		atapi_write(drive, scsi->pc->c, 12);
+		ret = ide_started;
+	}
 	spin_unlock_irqrestore(ch->lock, flags);
 
-	atapi_write(drive, scsi->pc->c, 12);			/* Send the actual packet */
-	return ide_started;
+	return ret;
 }
 
 /*
include/linux/ide.h +7 -7
diff -urN linux-2.5.21/include/linux/ide.h linux/include/linux/ide.h
@@ -601,8 +601,9 @@
 #define LOCAL_END_REQUEST	/* Don't generate end_request in blk.h */
 #include <linux/blk.h>
 
-extern int __ide_end_request(struct ata_device *, struct request *, int, unsigned int);
-extern int ide_end_request(struct ata_device *drive, struct request *, int);
+/* Not locking and locking variant: */
+extern int __ata_end_request(struct ata_device *, struct request *, int, unsigned int);
+extern int ata_end_request(struct ata_device *drive, struct request *, int);
 
 extern void ata_set_handler(struct ata_device *drive, ata_handler_t handler,
 		unsigned long timeout, ata_expiry_t expiry);
@@ -611,11 +612,6 @@
 extern ide_startstop_t ata_error(struct ata_device *, struct request *rq, const char *);
 
 extern void ide_fixstring(char *s, const int bytecount, const int byteswap);
-
-extern int ide_wait_stat(ide_startstop_t *,
-		struct ata_device *, struct request *rq,
-		byte, byte, unsigned long);
-
 extern int ide_wait_noerr(struct ata_device *, byte, byte, unsigned long);
 
 /*
@@ -831,7 +827,11 @@
 
 extern void ata_select(struct ata_device *, unsigned long);
 extern void ata_mask(struct ata_device *);
+extern int ata_busy_poll(struct ata_device *, unsigned long);
 extern int ata_status(struct ata_device *, u8, u8);
+extern int ata_status_poll( struct ata_device *, u8, u8,
+		unsigned long, struct request *rq, ide_startstop_t *);
+
 extern int ata_irq_enable(struct ata_device *, int);
 extern void ata_reset(struct ata_channel *);
 extern void ata_out_regfile(struct ata_device *, struct hd_drive_task_hdr *);
#61 lore raw

Re: [PATCH] 2.5.21 kill warinigs 14/19

In reply to Linus Torvalds
Quoted 1 line · Martin Dalecki

irlap_frame this time. Let me guess they used emacs?!

The better way to solve this is to include:

/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-indent-level: 8
* c-brace-imaginary-offset: 0
* c-brace-offset: -8
* c-argdecl-indent: 8
* c-label-offset: -8
* c-continued-statement-offset: 8
* c-continued-brace-offset: 0
* End:
*/

at the end of each file these people who cannot use their editor touch.

That's how I solved it with my own team mates ;-)

Regards

Ingo Oeser

Signature · 1 line
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth
#62 lore raw

Re: [PATCH] 2.5.21 kill warinigs 14/19

In reply to Linus Torvalds
Quoted 24 lines · Użytkownik Ingo Oeser
Quoted 1 line · Martin Dalecki

irlap_frame this time. Let me guess they used emacs?!

The better way to solve this is to include:

/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-indent-level: 8
* c-brace-imaginary-offset: 0
* c-brace-offset: -8
* c-argdecl-indent: 8
* c-label-offset: -8
* c-continued-statement-offset: 8
* c-continued-brace-offset: 0
* End:
*/

Quoted 3 lines

at the end of each file these people who cannot use their editor touch.

That's how I solved it with my own team mates ;-)

And it's the best way to annoy everybody who know how to use a proper programmers editor, aka gvim, too... This is becouse it doesn't show how to hightlight trailing white space garbage. (Hint GVIM handles it beautifully :-)

#63 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 1 line · Martin Dalecki

6. In esp. ARM seems to be much better off with GCC 3.1 then anything else.

Not yet proven. Only a minority of people are using gcc 3.1 compared to gcc 2.95.x to build ARM kernels currently.

We've already found a few things that need changing in 2.5 (which haven't been updated in 2.4 yet) that are needed for gcc 3.1 to build the kernel properly.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#64 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 6 lines · Użytkownik Russell King
Quoted 1 line · Martin Dalecki

6. In esp. ARM seems to be much better off with GCC 3.1 then anything else.

Not yet proven. Only a minority of people are using gcc 3.1 compared

Few +1. However this was the first "official" release which was "working out of the box". Well at least for me.

#65 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 10 lines · Martin Dalecki

U¿ytkownik Russell King napisa³:

Quoted 6 lines · Martin Dalecki
Quoted 2 lines

6. In esp. ARM seems to be much better off with GCC 3.1 then anything else.

Not yet proven. Only a minority of people are using gcc 3.1 compared

Few +1. However this was the first "official" release which was "working out of the box". Well at least for me.

GCC 2.95.3, +4 both work with a patch from Phil Blundell, as detailed in the build instructions for these versions.

GCC 3.x introduces the dodgy practice of removing the frame pointer from every function despite telling the compiler not to with -fno-omit-frame-pointer. It's also contary to the GCC documentation when it interferes with debugging.

Overall, using gcc 3.1 causes the following problems in _any_ kernel:

1. crashes when things like knfsd and other kernel daemons exit.
2. you can't get a call trace from the kernel.

For anyone, I'd recommend using gcc 2.95.[34] for building a kernel that should be stable and can be trusted. gcc 3.x is still very experimental afaiac. We're still finding its quirks.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#66 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 4 lines · Użytkownik Russell King

GCC 3.x introduces the dodgy practice of removing the frame pointer from every function despite telling the compiler not to with -fno-omit-frame-pointer. It's also contary to the GCC documentation when it interferes with debugging.

This can not be true - since otherwise task switching wouldn't work at all!

#67 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 8 lines · Martin Dalecki

U¿ytkownik Russell King napisa³:

Quoted 4 lines

GCC 3.x introduces the dodgy practice of removing the frame pointer from every function despite telling the compiler not to with -fno-omit-frame-pointer. It's also contary to the GCC documentation when it interferes with debugging.

This can not be true - since otherwise task switching wouldn't work at all!

It is indeed true. From your comment, it looks like you don't understand the ARM architecture/what a frame pointer is.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#68 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 9 lines · Użytkownik Russell King
Quoted 7 lines · Martin Dalecki
Quoted 4 lines · Użytkownik Russell King

GCC 3.x introduces the dodgy practice of removing the frame pointer from every function despite telling the compiler not to with -fno-omit-frame-pointer. It's also contary to the GCC documentation when it interferes with debugging.

Quoted 6 lines
Quoted 2 lines

This can not be true - since otherwise task switching wouldn't work at all!

It is indeed true. From your comment, it looks like you don't understand the ARM architecture/what a frame pointer is.

Well I surely understand what a pointer to the local variable set is. I know pascal and gdb well enough :-). However what I may have missed is that ARM is using some other task switch mechanism. I would be courious to see what it is?

#69 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 4 lines · Martin Dalecki

Well I surely understand what a pointer to the local variable set is. I know pascal and gdb well enough :-). However what I may have missed is that ARM is using some other task switch mechanism. I would be courious to see what it is?

Frame pointer - used to reference the function return state, and function arguments. Optional.

Stack pointer - used to reference the function local variables. In the absence of the frame pointer, this is also used to reference the function return state and the function arguments.

As you can see, it has nothing to do with task switch mechanisms.

I suggest you revise your "pascal and gdb" and "task switch mechanism" knowledge. I don't believe ARM is special in doing the above. In fact, the above is probably very common indeed.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#70 lore raw

Re: [PATCH] 2.5.21 kill warinigs 14/19

In reply to Linus Torvalds
Quoted 5 lines · Ingo Oeser

The better way to solve this is to include:

<snip lots of emacsisms>

That's how I solved it with my own team mates ;-)

Without trying to degrade this into an editor troll, those emacsisms solve 1 thing only. They allow other emacs users to see the code as it should be.

Unfortunatly, they do bugger all in other editors, or in tools such as diff, which leads to some wierd looking patches at times.

sidenote: I've lost count how many times I've found trivial bugs just by changing the indentation[*] and spotting misplaced brackets.

Dave.

[*] To that that matches CodingStyle.

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
#71 lore raw

Re: [PATCH] 2.5.21 IDE 87

In reply to Linus Torvalds
Quoted 15 lines · Martin Dalecki

Sun Jun 9 15:31:56 CEST 2002 ide-clean-87

- Sync with 2.5.21

- Don't call put_device inside idedisk_cleanup(). This is apparently triggering
some bug inside the handling of device trees. Or we don't register the
device
properly within the tree. Check this later.

- Further work on the channel register file access locking. Push the locking
out from __ide_end_request to ide_end_request. Rename those functions to respective __ata_end_request() and ata_end_request().

Quoted 7 lines

- Move ide_wait_status to device.c rename it to ata_status_poll().

- Further work on locking scope issues.

- devfs showed us once again that it changed the policy from agnostic numbers
to unpleasant string names. What a piece of crap!

FYI, this latest cleanup fixes the oops I reported earlier... not that anyone cared :).

flushing ide devices: hda <1> Unable to handle kernel NULL pointer at address 00000004 *pde = 000000

Oops: 0002
CPU: 0

EIP: 0010:[<c01a692c>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010202
eax: c03077d0 ebx: c03077b8 ecx: 00000000 edx: 00000000
esi: c258e000 edi: c029ef40 ebp: c030766c esp: c258fe40
ds: 0018 es: 0018 ss: 0018

Stack: c030766c c03077b8 c0307540 00000001 c01a6d24 c03077b8 c0295788 c030766c
       c01eaf9e c03077b8 c0307540 c0307540 c01e271f c030766c c0307670 
c029e9cc
       00000000 00000003 bffffcd8 c0122fdd c029e9cc 00000003 00000000 
4321fedc
Call Trace: [<c01a6d24>] [<c01eaf9d>] [<c01e271f>] [<c0122fdd>] [<c0123576>]
            [<c011331e>] [<c0121413>] [<c01217fe>] [<c0122438>] 
[<c01512e0>] [<c013e01a>]
            [<c013c373>] [<c013c422>] [<c010740f>]
Code: 89 4a 04 89 11 89 40 04 89 43 18 ff 4e 10 8b 46 08 83 e0 08

-o) J o h n W e b e r
/\\ [email protected]
_\/v http://www.linuxhq.com/people/weber/

#72 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds

Hi!!

Quoted 7 lines
(quoted diff) +2 -2
 						printk("i2c-core.o: while "
 						       "unregistering driver "
 						       "%s' could not
-						       be detached; driver
-						       not unloaded!",
+						       "address %02x of "
+						       "adapter 
#73 lore raw

Re: [PATCH] 2.5.21 IDE 87

In reply to Linus Torvalds
Quoted 22 lines · Użytkownik John Weber
Quoted 20 lines · Martin Dalecki

Sun Jun 9 15:31:56 CEST 2002 ide-clean-87

- Sync with 2.5.21

- Don't call put_device inside idedisk_cleanup(). This is apparently triggering
some bug inside the handling of device trees. Or we don't register
the device
properly within the tree. Check this later.

- Further work on the channel register file access locking. Push the locking
out from __ide_end_request to ide_end_request. Rename those
functions to
respective __ata_end_request() and ata_end_request().

- Move ide_wait_status to device.c rename it to ata_status_poll().

- Further work on locking scope issues.

Quoted 7 lines
Quoted 3 lines

- devfs showed us once again that it changed the policy from agnostic numbers
to unpleasant string names. What a piece of crap!

FYI, this latest cleanup fixes the oops I reported earlier... not that anyone cared :).

Please just don't expect an e-mail reply on every single error report. Me beeing silent means sometimes that I'm just busy fixing it...

#74 lore raw

PATCH 1/1 2.5.21 inline abuse...

In reply to Linus Torvalds

The attached patch is trying to address the most obvious abuses or inadequacies in the usage of the inline attribute to functions. Many of the remaining usages should be removed as well since apparently GCC got really good at figuring out on its own whatever it makes sense to inline a function or not.

Since the patch isn't very big I didn't bother to split it up in to a series of "micropatches". However if you "insist" I could provide this.

And well here are the "before/after" diet images:

wto cze 11 10:56:03 CEST 2002

Size before:

[root@kozaczek linux]# size vmlinux
text data bss dec hex filename
1482859 249992 255852 1988703 1e585f vmlinux

text data bss dec hex filename
1476379 249992 255852 1982223 1e3f0f vmlinux

No question it's worth it. The above numbers should be higher with older GCC version, which where not that eager to inline functions on they own.

drivers/block/elevator.c +29 -12
diff -urN linux-2.5.21/drivers/block/elevator.c linux/drivers/block/elevator.c
@@ -378,18 +378,36 @@
 		e->elevator_merge_req_fn(rq, next);
 }
 
-/*
- * add_request and next_request are required to be supported, naturally
- */
-void __elv_add_request(request_queue_t *q, struct request *rq,
-			  struct list_head *insert_here)
+struct request *elv_next_request(request_queue_t *q)
 {
-	q->elevator.elevator_add_req_fn(q, rq, insert_here);
-}
+	struct request *rq;
 
-struct request *__elv_next_request(request_queue_t *q)
-{
-	return q->elevator.elevator_next_req_fn(q);
+	while ((rq = q->elevator.elevator_next_req_fn(q))) {
+		rq->flags |= REQ_STARTED;
+
+		if (&rq->queuelist == q->last_merge)
+			q->last_merge = NULL;
+
+		if ((rq->flags & REQ_DONTPREP) || !q->prep_rq_fn)
+			break;
+
+		/*
+		 * all ok, break and return it
+		 */
+		if (!q->prep_rq_fn(q, rq))
+			break;
+
+		/*
+		 * prep said no-go, kill it
+		 */
+		blkdev_dequeue_request(rq);
+		if (end_that_request_first(rq, 0, rq->nr_sectors))
+			BUG();
+
+		end_that_request_last(rq);
+	}
+
+	return rq;
 }
 
 void elv_remove_request(request_queue_t *q, struct request *rq)
@@ -421,6 +439,5 @@
 EXPORT_SYMBOL(elevator_linus);
 EXPORT_SYMBOL(elevator_noop);
 
-EXPORT_SYMBOL(__elv_add_request);
-EXPORT_SYMBOL(__elv_next_request);
+EXPORT_SYMBOL(elv_next_request);
 EXPORT_SYMBOL(elv_remove_request);
drivers/block/ll_rw_blk.c +8 -9
diff -urN linux-2.5.21/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
@@ -1110,7 +1110,7 @@
  * Get a free request. queue lock must be held and interrupts
  * disabled on the way in.
  */
-static inline struct request *get_request(request_queue_t *q, int rw)
+static struct request *get_request(request_queue_t *q, int rw)
 {
 	struct request *rq = NULL;
 	struct request_list *rl = q->rq + rw;
@@ -1233,16 +1233,15 @@
  * queue lock is held and interrupts disabled, as we muck with the
  * request queue list.
  */
-static inline void add_request(request_queue_t * q, struct request * req,
+static inline void add_request(request_queue_t * q, struct request * rq,
 			       struct list_head *insert_here)
 {
-	drive_stat_acct(req, req->nr_sectors, 1);
+	drive_stat_acct(rq, rq->nr_sectors, 1);
 
-	/*
-	 * elevator indicated where it wants this request to be
-	 * inserted at elevator_merge time
+	/* Elevator indicated where it wants this request to be
+	 * inserted at elevator_merge time.
 	 */
-	__elv_add_request(q, req, insert_here);
+	q->elevator.elevator_add_req_fn(q, rq, insert_here);
 }
 
 /*
@@ -1816,7 +1815,7 @@
 extern int stram_device_init (void);
 #endif
 
-inline void blk_recalc_rq_segments(struct request *rq)
+void blk_recalc_rq_segments(struct request *rq)
 {
 	struct bio *bio;
 	int nr_phys_segs, nr_hw_segs;
@@ -1836,7 +1835,7 @@
 	rq->nr_hw_segments = nr_hw_segs;
 }
 
-inline void blk_recalc_rq_sectors(struct request *rq, int nsect)
+void blk_recalc_rq_sectors(struct request *rq, int nsect)
 {
 	if (rq->flags & REQ_CMD) {
 		rq->hard_sector += nsect;
fs/binfmt_elf.c +8 -10
diff -urN linux-2.5.21/fs/binfmt_elf.c linux/fs/binfmt_elf.c
@@ -44,8 +44,8 @@
 
 static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
 static int load_elf_library(struct file*);
-static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
-extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
+static unsigned long elf_map(struct file *, unsigned long, struct elf_phdr *, int, int);
+extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
 extern void dump_thread(struct pt_regs *, struct user *);
 
 #ifndef elf_addr_t
@@ -241,9 +241,8 @@
 }
 
 #ifndef elf_map
-
-static inline unsigned long
-elf_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type)
+static unsigned long
+elf_map(struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type)
 {
 	unsigned long map_addr;
 
@@ -254,8 +253,7 @@
 	up_write(&current->mm->mmap_sem);
 	return(map_addr);
 }
-
-#endif /* !elf_map */
+#endif
 
 /* This is much more generalized than the library routine read function,
    so we keep this separate.  Technically the library read function
@@ -319,11 +317,11 @@
 	    if (eppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
 	    vaddr = eppnt->p_vaddr;
 	    if (interp_elf_ex->e_type == ET_EXEC || load_addr_set)
-	    	elf_type |= MAP_FIXED;
+		elf_type |= MAP_FIXED;
 
 	    map_addr = elf_map(interpreter, load_addr + vaddr, eppnt, elf_prot, elf_type);
 	    if (BAD_ADDR(map_addr))
-	    	goto out_close;
+		goto out_close;
 
 	    if (!load_addr_set && interp_elf_ex->e_type == ET_DYN) {
 		load_addr = map_addr - ELF_PAGESTART(vaddr);
@@ -917,7 +915,7 @@
  *
  * I think we should skip something. But I am not sure how. H.J.
  */
-static inline int maydump(struct vm_area_struct *vma)
+static int maydump(struct vm_area_struct *vma)
 {
 	/*
 	 * If we may not read the contents, don't allow us to dump
fs/block_dev.c +1 -1
diff -urN linux-2.5.21/fs/block_dev.c linux/fs/block_dev.c
@@ -347,7 +347,7 @@
 	return bdev;
 }
 
-static inline void __bd_forget(struct inode *inode)
+static void __bd_forget(struct inode *inode)
 {
 	list_del_init(&inode->i_devices);
 	inode->i_bdev = NULL;
fs/dcache.c +6 -6
diff -urN linux-2.5.21/fs/dcache.c linux/fs/dcache.c
@@ -54,7 +54,7 @@
 struct dentry_stat_t dentry_stat = {0, 0, 45, 0,};
 
 /* no dcache_lock, please */
-static inline void d_free(struct dentry *dentry)
+static void d_free(struct dentry *dentry)
 {
 	if (dentry->d_op && dentry->d_op->d_release)
 		dentry->d_op->d_release(dentry);
@@ -69,7 +69,7 @@
  * d_iput() operation if defined.
  * Called with dcache_lock held, drops it.
  */
-static inline void dentry_iput(struct dentry * dentry)
+static void dentry_iput(struct dentry * dentry)
 {
 	struct inode *inode = dentry->d_inode;
 	if (inode) {
@@ -213,7 +213,7 @@
 
 /* This should be called _only_ with dcache_lock held */
 
-static inline struct dentry * __dget_locked(struct dentry *dentry)
+static struct dentry * __dget_locked(struct dentry *dentry)
 {
 	atomic_inc(&dentry->d_count);
 	if (atomic_read(&dentry->d_count) == 1) {
@@ -298,7 +298,7 @@
  * removed.
  * Called with dcache_lock, drops it and then regains.
  */
-static inline void prune_one_dentry(struct dentry * dentry)
+static void prune_one_dentry(struct dentry * dentry)
 {
 	struct dentry * parent;
 
@@ -717,7 +717,7 @@
 	return res;
 }
 
-static inline struct list_head * d_hash(struct dentry * parent, unsigned long hash)
+static struct list_head * d_hash(struct dentry * parent, unsigned long hash)
 {
 	hash += (unsigned long) parent / L1_CACHE_BYTES;
 	hash = hash ^ (hash >> D_HASHBITS);
@@ -1006,7 +1006,7 @@
  * then no longer matches the actual (corrupted) string of the target.
  * The hash value has to match the hash queue that the dentry is on..
  */
-static inline void switch_names(struct dentry * dentry, struct dentry * target)
+static void switch_names(struct dentry * dentry, struct dentry * target)
 {
 	const unsigned char *old_name, *new_name;
 
fs/locks.c +2 -2
diff -urN linux-2.5.21/fs/locks.c linux/fs/locks.c
@@ -153,7 +153,7 @@
 }
 
 /* Free a lock which is not in use. */
-static inline void locks_free_lock(struct file_lock *fl)
+static void locks_free_lock(struct file_lock *fl)
 {
 	if (fl == NULL) {
 		BUG();
@@ -501,7 +501,7 @@
  * notify the FS that the lock has been cleared and
  * finally free the lock.
  */
-static inline void _delete_lock(struct file_lock *fl)
+static void _delete_lock(struct file_lock *fl)
 {
 	fasync_helper(0, fl->fl_file, 0, &fl->fl_fasync);
 	if (fl->fl_fasync != NULL){
fs/namei.c +68 -32

212 lines not on this page · raw message

fs/open.c +2 -2
diff -urN linux-2.5.21/fs/open.c linux/fs/open.c
@@ -90,7 +90,7 @@
 	return err;
 }
 
-static inline long do_sys_truncate(const char * path, loff_t length)
+static long do_sys_truncate(const char * path, loff_t length)
 {
 	struct nameidata nd;
 	struct inode * inode;
@@ -156,7 +156,7 @@
 	return do_sys_truncate(path, (long)length);
 }
 
-static inline long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
+static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
 {
 	struct inode * inode;
 	struct dentry *dentry;
fs/seq_file.c +12 -0
diff -urN linux-2.5.21/fs/seq_file.c linux/fs/seq_file.c
@@ -276,6 +276,18 @@
         return 0;
 }
 
+int seq_puts(struct seq_file *m, const char *s)
+{
+	int len = strlen(s);
+	if (m->count + len < m->size) {
+		memcpy(m->buf + m->count, s, len);
+		m->count += len;
+		return 0;
+	}
+	m->count = m->size;
+	return -1;
+}
+
 int seq_printf(struct seq_file *m, const char *f, ...)
 {
 	va_list args;
include/linux/blk.h +1 -33
diff -urN linux-2.5.21/include/linux/blk.h linux/include/linux/blk.h
@@ -49,38 +49,6 @@
 		elv_remove_request(req->q, req);
 }
 
-extern inline struct request *elv_next_request(request_queue_t *q)
-{
-	struct request *rq;
-
-	while ((rq = __elv_next_request(q))) {
-		rq->flags |= REQ_STARTED;
-
-		if (&rq->queuelist == q->last_merge)
-			q->last_merge = NULL;
-
-		if ((rq->flags & REQ_DONTPREP) || !q->prep_rq_fn)
-			break;
-
-		/*
-		 * all ok, break and return it
-		 */
-		if (!q->prep_rq_fn(q, rq))
-			break;
-
-		/*
-		 * prep said no-go, kill it
-		 */
-		blkdev_dequeue_request(rq);
-		if (end_that_request_first(rq, 0, rq->nr_sectors))
-			BUG();
-
-		end_that_request_last(rq);
-	}
-
-	return rq;
-}
-
 #define _elv_add_request_core(q, rq, where, plug)			\
 	do {								\
 		if ((plug))						\
@@ -96,7 +64,7 @@
 } while (0)
 
 #define elv_add_request(q, rq, back) _elv_add_request((q), (rq), (back), 1)
-	
+
 #if defined(MAJOR_NR) || defined(IDE_DRIVER)
 
 /*
include/linux/elevator.h +1 -3
diff -urN linux-2.5.21/include/linux/elevator.h linux/include/linux/elevator.h
@@ -38,9 +38,7 @@
 /*
  * block elevator interface
  */
-extern void __elv_add_request(request_queue_t *, struct request *,
-			      struct list_head *);
-extern struct request *__elv_next_request(request_queue_t *);
+extern struct request *elv_next_request(request_queue_t *);
 extern void elv_merge_cleanup(request_queue_t *, struct request *, int);
 extern int elv_merge(request_queue_t *, struct request **, struct bio *);
 extern void elv_merge_requests(request_queue_t *, struct request *,
include/linux/fs_struct.h +2 -50

58 lines not on this page · raw message

include/linux/quotaops.h +6 -6
diff -urN linux-2.5.21/include/linux/quotaops.h linux/include/linux/quotaops.h
@@ -190,7 +190,7 @@
 #define DQUOT_SYNC(sb)				do { } while(0)
 #define DQUOT_OFF(sb)				do { } while(0)
 #define DQUOT_TRANSFER(inode, iattr)		(0)
-extern __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
+static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
 {
 	lock_kernel();
 	inode_add_bytes(inode, nr);
@@ -198,14 +198,14 @@
 	return 0;
 }
 
-extern __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
+static inline int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
 {
 	DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr);
 	mark_inode_dirty(inode);
 	return 0;
 }
 
-extern __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
+static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
 {
 	lock_kernel();
 	inode_add_bytes(inode, nr);
@@ -213,21 +213,21 @@
 	return 0;
 }
 
-extern __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
+static inline int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
 {
 	DQUOT_ALLOC_SPACE_NODIRTY(inode, nr);
 	mark_inode_dirty(inode);
 	return 0;
 }
 
-extern __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
+static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
 {
 	lock_kernel();
 	inode_sub_bytes(inode, nr);
 	unlock_kernel();
 }
 
-extern __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
+static inline void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
 {
 	DQUOT_FREE_SPACE_NODIRTY(inode, nr);
 	mark_inode_dirty(inode);
include/linux/seq_file.h +2 -13
diff -urN linux-2.5.21/include/linux/seq_file.h linux/include/linux/seq_file.h
@@ -43,19 +43,8 @@
 	return -1;
 }
 
-static inline int seq_puts(struct seq_file *m, const char *s)
-{
-	int len = strlen(s);
-	if (m->count + len < m->size) {
-		memcpy(m->buf + m->count, s, len);
-		m->count += len;
-		return 0;
-	}
-	m->count = m->size;
-	return -1;
-}
-
-int seq_printf(struct seq_file *, const char *, ...)
+extern int seq_puts(struct seq_file *m, const char *s);
+extern int seq_printf(struct seq_file *, const char *, ...)
 	__attribute__ ((format (printf,2,3)));
 
 int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
kernel/exit.c +9 -36

104 lines not on this page · raw message

kernel/fork.c +3 -8
diff -urN linux-2.5.21/kernel/fork.c linux/kernel/fork.c
@@ -293,7 +293,7 @@
  * is dropped: either by a lazy thread or by
  * mmput. Free the page directory and the mm.
  */
-inline void __mmdrop(struct mm_struct *mm)
+void __mmdrop(struct mm_struct *mm)
 {
 	if (mm == &init_mm) BUG();
 	pgd_free(mm->pgd);
@@ -408,7 +408,7 @@
 	return retval;
 }
 
-static inline struct fs_struct *__copy_fs_struct(struct fs_struct *old)
+struct fs_struct *copy_fs_struct(struct fs_struct *old)
 {
 	struct fs_struct *fs = kmem_cache_alloc(fs_cachep, GFP_KERNEL);
 	/* We don't need to lock fs - think why ;-) */
@@ -433,18 +433,13 @@
 	return fs;
 }
 
-struct fs_struct *copy_fs_struct(struct fs_struct *old)
-{
-	return __copy_fs_struct(old);
-}
-
 static inline int copy_fs(unsigned long clone_flags, struct task_struct * tsk)
 {
 	if (clone_flags & CLONE_FS) {
 		atomic_inc(&current->fs->count);
 		return 0;
 	}
-	tsk->fs = __copy_fs_struct(current->fs);
+	tsk->fs = copy_fs_struct(current->fs);
 	if (!tsk->fs)
 		return -1;
 	return 0;
kernel/ksyms.c +1 -0
diff -urN linux-2.5.21/kernel/ksyms.c linux/kernel/ksyms.c
@@ -519,6 +519,7 @@
 EXPORT_SYMBOL(daemonize);
 EXPORT_SYMBOL(csum_partial); /* for networking and md */
 EXPORT_SYMBOL(seq_escape);
+EXPORT_SYMBOL(seq_puts);
 EXPORT_SYMBOL(seq_printf);
 EXPORT_SYMBOL(seq_open);
 EXPORT_SYMBOL(seq_release);
kernel/module.c +1 -1
diff -urN linux-2.5.21/kernel/module.c linux/kernel/module.c
@@ -256,7 +256,7 @@
  * Copy the name of a module from user space.
  */
 
-static inline long
+static long
 get_mod_name(const char *user_name, char **buf)
 {
 	unsigned long page;
kernel/timer.c +2 -2
diff -urN linux-2.5.21/kernel/timer.c linux/kernel/timer.c
@@ -127,7 +127,7 @@
 
 static unsigned long timer_jiffies;
 
-static inline void internal_add_timer(struct timer_list *timer)
+static void internal_add_timer(struct timer_list *timer)
 {
 	/*
 	 * must be cli-ed when calling this
@@ -197,7 +197,7 @@
 			__builtin_return_address(0));
 }
 
-static inline int detach_timer (struct timer_list *timer)
+static inline int detach_timer(struct timer_list *timer)
 {
 	if (!timer_pending(timer))
 		return 0;
lib/rwsem.c +2 -2
diff -urN linux-2.5.21/lib/rwsem.c linux/lib/rwsem.c
@@ -35,7 +35,7 @@
  * - the spinlock must be held by the caller
  * - woken process blocks are discarded from the list after having flags zeroised
  */
-static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem)
+static struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem)
 {
 	struct rwsem_waiter *waiter;
 	struct list_head *next;
@@ -110,7 +110,7 @@
 /*
  * wait for a lock to be granted
  */
-static inline struct rw_semaphore *rwsem_down_failed_common(struct rw_semaphore *sem,
+static struct rw_semaphore *rwsem_down_failed_common(struct rw_semaphore *sem,
 								 struct rwsem_waiter *waiter,
 								 signed long adjustment)
 {
mm/filemap.c +1 -1
diff -urN linux-2.5.21/mm/filemap.c linux/mm/filemap.c
@@ -1631,7 +1631,7 @@
 	return 0;
 }
 
-static inline void setup_read_behavior(struct vm_area_struct * vma,
+static void setup_read_behavior(struct vm_area_struct * vma,
 	int behavior)
 {
 	VM_ClearReadHint(vma);
mm/highmem.c +1 -1
diff -urN linux-2.5.21/mm/highmem.c linux/mm/highmem.c
@@ -290,7 +290,7 @@
 	}
 }
 
-static inline void bounce_end_io(struct bio *bio, mempool_t *pool)
+static void bounce_end_io(struct bio *bio, mempool_t *pool)
 {
 	struct bio *bio_orig = bio->bi_private;
 	struct bio_vec *bvec, *org_vec;
mm/slab.c +14 -18
diff -urN linux-2.5.21/mm/slab.c linux/mm/slab.c
@@ -533,7 +533,7 @@
 }
 
 /* Interface to system's page release. */
-static inline void kmem_freepages (kmem_cache_t *cachep, void *addr)
+static void kmem_freepages(kmem_cache_t *cachep, void *addr)
 {
 	unsigned long i = (1<<cachep->gfporder);
 	struct page *page = virt_to_page(addr);
@@ -551,7 +551,7 @@
 }
 
 #if DEBUG
-static inline void kmem_poison_obj (kmem_cache_t *cachep, void *addr)
+static void kmem_poison_obj(kmem_cache_t *cachep, void *addr)
 {
 	int size = cachep->objsize;
 	if (cachep->flags & SLAB_RED_ZONE) {
@@ -562,7 +562,7 @@
 	*(unsigned char *)(addr+size-1) = POISON_END;
 }
 
-static inline int kmem_check_poison_obj (kmem_cache_t *cachep, void *addr)
+static int kmem_check_poison_obj(kmem_cache_t *cachep, void *addr)
 {
 	int size = cachep->objsize;
 	void *end;
@@ -1363,7 +1363,16 @@
 }
 #endif
 
-static inline void * __kmem_cache_alloc (kmem_cache_t *cachep, int flags)
+
+/**
+ * kmem_cache_alloc - Allocate an object
+ * @cachep: The cache to allocate from.
+ * @flags: See kmalloc().
+ *
+ * Allocate an object from this cache.  The flags are only relevant
+ * if the cache has no available objects.
+ */
+void * kmem_cache_alloc(kmem_cache_t *cachep, int flags)
 {
 	unsigned long save_flags;
 	void* objp;
@@ -1548,19 +1557,6 @@
 }
 
 /**
- * kmem_cache_alloc - Allocate an object
- * @cachep: The cache to allocate from.
- * @flags: See kmalloc().
- *
- * Allocate an object from this cache.  The flags are only relevant
- * if the cache has no available objects.
- */
-void * kmem_cache_alloc (kmem_cache_t *cachep, int flags)
-{
-	return __kmem_cache_alloc(cachep, flags);
-}
-
-/**
  * kmalloc - allocate memory
  * @size: how many bytes of memory are required.
  * @flags: the type of memory to allocate.
@@ -1588,7 +1584,7 @@
 	for (; csizep->cs_size; csizep++) {
 		if (size > csizep->cs_size)
 			continue;
-		return __kmem_cache_alloc(flags & GFP_DMA ?
+		return kmem_cache_alloc(flags & GFP_DMA ?
 			 csizep->cs_dmacachep : csizep->cs_cachep, flags);
 	}
 	return NULL;
#75 lore raw

Re: [PATCH] 2.5.21 IDE 87

In reply to Linus Torvalds

Review

Quoted 9 lines · Martin Dalecki
(quoted diff) +6 -3
-		char *buffer;
-		int nsect = rq->current_nr_sectors;
-		unsigned long flags;
+			/*
+			 * Ok, we're all setup for the interrupt re-entering us on the
+			 * last transfer.
+			 */
+			ata_write(drive, buf, nsect * SECTOR_WORDS);
+			bio_kunmap_irq(buffer, &flags);

The above is an excerpt from the diff on ide_disk.c: task_mulout_intr()

The first and last line conflict. You remove 'char *buffer' then try to pass it to bio_kunmap_irq(). I think it should be passing 'char *buf' instead.

BK patch below.

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================

[email protected], 2002-06-12 10:25:57-07:00, [email protected]
The IDE 87 patch removed char *buffer from task_mulout_intr() then added a line which passes it as an argument to bio_kunmap_irq(). It should be passing char *buf instead. Fixed.

 ide-disk.c |    2 +-
 1 files changed, 1 insertion, 1 deletion
drivers/ide/ide-disk.c +1 -1
diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
@@ -327,7 +327,7 @@
 			 * last transfer.
 			 */
 			ata_write(drive, buf, nsect * SECTOR_WORDS);
-			bio_kunmap_irq(buffer, &flags);
+			bio_kunmap_irq(buf, &flags);
 		} while (mcount);
 
 		rq->errors = 0;

===================================================================

This BitKeeper patch contains the following changesets:
1.457
## Wrapped with gzip_uu ##

begin 664 bkpatch2009 M'XL(`*>$!ST``[64;6_3,!#'7\>?XJ1):.2^)+8Z8**!MN"22FP5Y73NPV M5O-0;*?;I'QXW$Y:T1B,QSS(T>GR]__N?O(>7%IEBJ"LE6Y*,W1D#][UUA7! M2MRL1!-5?>M#%WWO0_%@3=STE6AB:ZJXT=UP'281(S[C7+BJAK4RM@@P2N\B M[F:EBN#B].WEAU<7A$RG<%R+;J$^*0?3*7&]68M&VB/AZJ;O(F=$9UOEQ&;C M\2YU3"A-_,TP3RGC(W*:Y6.%$E%DJ"1-L@G/R%T51SOW]T4X)LC8)$M&AICF MY`[email protected](DICS$!I$7""I:'-"\HA8<TX1E"2,EK^+?VCTD%GVL%9R>G,,EA MM6V@46V_5A*J6AAX6@[SN3(P-]Z$$W8Y:X>F']Q,=\[L'X"K50="2B6]E``_ M(057M?8R*V&MLJ="O")YG%T*K.^1*@U/UL.72M6,VT^;)_$,&9UOW0R.A M5%YI\[/N%CL/H#OKE)1O-'72D;D/3":(I+SW7A)^)L7(510\O*1IDJC-Y3% M6JK-&TIMEU'U38<SBGRD>'B8C8>LFF=YRE*>TJ3DY8/#_*GBAI8\811'_\7X M%N"'\Q^G^6^<$RD:52WUD5IKJ_LN7/O9#4;97Z@D6?<*W-D>;KEG4_NXT[Q M,=SQO^"^Q><[,$?,<T&JMNF?X307&T?#\GY#_K_![B=I"D%)&>W2Q$]WQX CT)_#DWDC%O;@Q>Z0JVH_"3NTTXF<5+G.?D*SOV$*T8%````
`
end

#76 lore raw

Re: [PATCH] 2.5.21 IDE 87

In reply to Linus Torvalds
Quoted 30 lines · Martin Dalecki

U¿ytkownik John Weber napisa³:

Quoted 28 lines
Quoted 23 lines · Martin Dalecki

Sun Jun 9 15:31:56 CEST 2002 ide-clean-87

- Sync with 2.5.21

- Don't call put_device inside idedisk_cleanup(). This is apparently triggering
some bug inside the handling of device trees. Or we don't register
the device
properly within the tree. Check this later.

- Further work on the channel register file access locking. Push the locking
out from __ide_end_request to ide_end_request. Rename those
functions to
respective __ata_end_request() and ata_end_request().

- Move ide_wait_status to device.c rename it to ata_status_poll().

- Further work on locking scope issues.

- devfs showed us once again that it changed the policy from agnostic numbers
to unpleasant string names. What a piece of crap!

Quoted 8 lines
Quoted 2 lines

FYI, this latest cleanup fixes the oops I reported earlier... not that anyone cared :).

Please just don't expect an e-mail reply on every single error report. Me beeing silent means sometimes that I'm just busy fixing it...

I was mostly joking about the fact that no one else on the list seemed to run into the error. I think you did more than your part when you released IDE 87... I posted to the list as a way of "cancelling" the bug report.

I apologize for the ill-planned joke... <TOTAL JOKE>I realize that touchy bitch syndrome seems to be running rampant on LKML this season</TOTAL JOKE>.

-o) J o h n W e b e r
/\\ [email protected]
_\/v http://www.linuxhq.com/people/weber/

#77 lore raw

PATCH 1/1 2.5.21 IDE 88

In reply to Linus Torvalds

Tue Jun 11 02:30:03 CEST 2002 ide-clean-88

- Bunch of cleanups by Bartlomiej (accounts for over a half of the patch):

cmd64x.c:
- kill SPLIT_BYTE() macro
- kill wrappers for cmd64x_config_drive_for_dma()
- misc cleanups

cy82c693.c:
- kill obsolete comments
- clean cy82c693_tune_drive() and calc_clk()
- misc cleanups

hpt34x.c:
- kill obsolete comment
- kill SPLIT_BYTE()
- kill hpt34x_clear_chipset()
- simplify hpt34x_tune_drive()

hpt366.c:
- kill hpt_min_rev()
- kill redundant hpt368_tune_chipset() and hpt374_tune_chipset()
- fix badlists checking in config_chipset_for_dma()
- misc cleanups

pdc202xx.c:
- clean registers decoding
- clean pdc202xx_tune_chipset()
- kill pdc202xx_udma_irq_status(), use generic udma_pci_irq_status()
- rationalize pdc202xx_reset()
- kill UDMA_SPEED_FLAG() and PDC_CLOCK() macros,
do it right by defining constants PDC_UDMA and PDC_CLK
- kill init_high_16() inline, no need to hide internals
- clean pdc202xx_init_chipset()
- split ata66_pdc202xx() and pdc202xx_init_chipset()
- clean config_chipset_for_dma()
- misc cleanups

- Fix plug in of CF cards. The previously used sub device driver attach method lookup was entirely hosed.

- Enforce indentation style on ide-cs.c. Enable debugging there. (Makes the patch quite big...)

#78 lore raw

Re: [PATCH] 2.5.21 kill warnings 4/19

In reply to Linus Torvalds
Quoted 8 lines · Użytkownik Maksim (Max) Krasnyanskiy

Hi Martin,

How about replacing __FUNCTION__ with __func__ ?
GCC 3.x warns that __FUNCTION__ is obsolete and will be removed. Here is how I did it in Bluetooth code:

        #define BT_DBG(fmt, arg...)  printk(KERN_INFO "%s: " fmt "\n" , 

__func__ , ## arg)
no more warnings from gcc.

At the paces where there are wrapper macros this would make sense indeed. Otherwise - well not worth the trouble.

#79 lore raw

Re: [PATCH] 2.5.21 inline abuse...

In reply to Linus Torvalds
Quoted 5 lines · Martin Dalecki

The attached patch is trying to address the most obvious abuses or inadequacies in the usage of the inline attribute to functions. Many of the remaining usages should be removed as well since apparently GCC got really good at figuring out on its own whatever it makes sense to inline a function or not.

do you compile your kernels with -O3 or -finline-functions? Otherwise gcc should not inline anything at all without the explicit inline keyword.

Richard

#80 lore raw

PATCH 1/1 2.5.21 IDE 89

In reply to Linus Torvalds

Thu Jun 13 11:49:15 CEST 2002 ide-clean-89

- fix lock initialization for device tree handling. Well I would be lucky if it would be just a device tree like in Solaris. But after studying the code which goes in right now it appears to develop quite fast in to a "just in case" and "ad-hoc" inferface mess we have already in /proc. Shit!

Look for example at the initialization of a device struct. First we have a name to the directory encompassing the device and the immediately we fill in the georgeous name field - which is enterly unnecessary.

- Pull locking out from the device type drivers do_request handlers. This allowed us to remove the draddy unlocking on entry to start_request.

Much more of host controller rigister acces on crutial code paths is now covered by the queue access lock.

drivers/ide/ide.c +41 -40
diff -urN linux-2.5.21/drivers/ide/ide.c linux/drivers/ide/ide.c
@@ -635,15 +635,16 @@
  */
 static ide_startstop_t start_request(struct ata_device *drive, struct request *rq)
 {
+	struct ata_channel *ch = drive->channel;
 	sector_t block;
 	unsigned int minor = minor(rq->rq_dev);
 	unsigned int unit = minor >> PARTN_BITS;
-	struct ata_channel *ch = drive->channel;
+	ide_startstop_t ret;
 
 	BUG_ON(!(rq->flags & REQ_STARTED));
 
 #ifdef DEBUG
-	printk("%s: start_request: current=0x%08lx\n", ch->name, (unsigned long) rq);
+	printk("%s: %s: current=0x%08lx\n", ch->name, __FUNCTION__, (unsigned long) rq);
 #endif
 
 	/* bail early if we've exceeded max_failures */
@@ -663,55 +664,63 @@
 		if (drive->type == ATA_DISK || drive->type == ATA_FLOPPY)
 			block += drive->sect0;
 
-
 	/* Yecch - this will shift the entire interval, possibly killing some
 	 * innocent following sector.
 	 */
 	if (block == 0 && drive->remap_0_to_1 == 1)
 		block = 1;  /* redirect MBR access to EZ-Drive partn table */
-	{
-		ide_startstop_t res;
 
-		ata_select(drive, 0);
-		if (ata_status_poll(drive, drive->ready_stat, BUSY_STAT | DRQ_STAT,
-					WAIT_READY, rq, &res)) {
-			printk(KERN_WARNING "%s: drive not ready for command\n", drive->name);
+	ata_select(drive, 0);
+	spin_unlock_irq(ch->lock);
+	if (ata_status_poll(drive, drive->ready_stat, BUSY_STAT | DRQ_STAT,
+				WAIT_READY, rq, &ret)) {
+		printk(KERN_WARNING "%s: drive not ready for command\n", drive->name);
+		spin_lock_irq(ch->lock);
 
-			return res;
-		}
+		return ret;
 	}
+	spin_lock_irq(ch->lock);
 
 	/* This issues a special drive command.
+	 *
+	 * FIXME: move this down to idedisk_do_request().
 	 */
 	if (rq->flags & REQ_SPECIAL)
-		if (drive->type == ATA_DISK)
-			return ata_taskfile(drive, rq->special, NULL);
+		if (drive->type == ATA_DISK) {
+			spin_unlock_irq(ch->lock);
+			ret = ata_taskfile(drive, rq->special, NULL);
+			spin_lock_irq(ch->lock);
 
-	/* The normal way of execution is to pass and execute the request
-	 * handler down to the device type driver.
-	 */
-	if (ata_ops(drive)) {
-		if (ata_ops(drive)->do_request)
-			return ata_ops(drive)->do_request(drive, rq, block);
-		else {
-			ata_end_request(drive, rq, 0);
-
-			return ide_stopped;
+			return ret;
 		}
+
+	if (!ata_ops(drive)) {
+		printk(KERN_WARNING "%s: device type %d not supported\n",
+				drive->name, drive->type);
+		goto kill_rq;
 	}
 
-	/*
-	 * Error handling:
+	/* The normal way of execution is to pass and execute the request
+	 * handler down to the device type driver.
 	 */
 
-	printk(KERN_WARNING "%s: device type %d not supported\n",
-			drive->name, drive->type);
+	if (ata_ops(drive)->XXX_do_request) {
+		ret = ata_ops(drive)->XXX_do_request(drive, rq, block);
+	} else {
+		__ata_end_request(drive, rq, 0, 0);
+		ret = ide_stopped;
+	}
+	return ret;
 
 kill_rq:
-	if (ata_ops(drive) && ata_ops(drive)->end_request)
-		ata_ops(drive)->end_request(drive, rq, 0);
-	else
-		ata_end_request(drive, rq, 0);
+	if (ata_ops(drive)) {
+		if (ata_ops(drive)->end_request) {
+			spin_unlock_irq(ch->lock);
+			ata_ops(drive)->end_request(drive, rq, 0);
+			spin_lock_irq(ch->lock);
+		}
+	} else
+		__ata_end_request(drive, rq, 0, 0);
 
 	return ide_stopped;
 }
@@ -726,13 +735,8 @@
 
 	ch->handler = NULL;
 	del_timer(&ch->timer);
-
-	spin_unlock_irqrestore(ch->lock, flags);
-
-	/* FIXME make start_request do the unlock itself and
-	 * push this locking further down. */
-
 	ret = start_request(drive, drive->rq);
+	spin_unlock_irqrestore(ch->lock, flags);
 
 	return ret;
 }
@@ -902,11 +906,8 @@
 
 		drive->rq = rq;
 
-		/* FIXME: push this locaing further down */
-		spin_unlock(drive->channel->lock);
 		ide__sti();	/* allow other IRQs while we start this request */
 		startstop = start_request(drive, rq);
-		spin_lock_irq(drive->channel->lock);
 
 		/* command started, we are busy */
 		if (startstop == ide_started)
drivers/ide/ide-cd.c +30 -9
diff -urN linux-2.5.21/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
@@ -804,6 +804,7 @@
 	}
 
 	/* Arm the interrupt handler and send the command to the device. */
+	/* FIXME: make this locking go away */
 	spin_lock_irqsave(ch->lock, flags);
 	ata_set_handler(drive, handler, timeout, cdrom_timer_expiry);
 	atapi_write(drive, cmd, CDROM_PACKET_SIZE);
@@ -1648,7 +1649,8 @@
 static ide_startstop_t
 ide_cdrom_do_request(struct ata_device *drive, struct request *rq, sector_t block)
 {
-	ide_startstop_t action;
+	struct ata_channel *ch = drive->channel;
+	int ret;
 	struct cdrom_info *info = drive->driver_data;
 
 	if (rq->flags & REQ_CMD) {
@@ -1664,19 +1666,29 @@
 			}
 			CDROM_CONFIG_FLAGS(drive)->seeking = 0;
 		}
-		if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap)
-			action = cdrom_start_seek(drive, rq, block);
-		else {
+		/* FIXME: make this unlocking go away*/
+		spin_unlock_irq(ch->lock);
+		if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) {
+			ret = cdrom_start_seek(drive, rq, block);
+		} else {
 			if (rq_data_dir(rq) == READ)
-				action = cdrom_start_read(drive, rq, block);
+				ret = cdrom_start_read(drive, rq, block);
 			else
-				action = cdrom_start_write(drive, rq);
+				ret = cdrom_start_write(drive, rq);
 		}
 		info->last_block = block;
-		return action;
+		spin_lock_irq(ch->lock);
+		return ret;
 	} else if (rq->flags & (REQ_PC | REQ_SENSE)) {
-		return cdrom_do_packet_command(drive, rq);
+		/* FIXME: make this unlocking go away*/
+		spin_unlock_irq(ch->lock);
+		ret = cdrom_do_packet_command(drive, rq);
+		spin_lock_irq(ch->lock);
+
+		return ret;
 	} else if (rq->flags & REQ_SPECIAL) {
+	        /* FIXME: make this unlocking go away*/
+		spin_unlock_irq(ch->lock);
 		/*
 		 * FIXME: Kill REQ_SEPCIAL and replace it with commands queued
 		 * at the request queue instead as suggested by Linus.
@@ -1685,11 +1697,15 @@
 		 */
 
 		cdrom_end_request(drive, rq, 1);
+		spin_lock_irq(ch->lock);
+
 		return ide_stopped;
 	} else if (rq->flags & REQ_BLOCK_PC) {
 		struct packet_command pc;
 		ide_startstop_t startstop;
 
+		/* FIXME: make this unlocking go away*/
+		spin_unlock_irq(ch->lock);
 		memset(&pc, 0, sizeof(pc));
 		pc.quiet = 1;
 		pc.timeout = 60 * HZ;
@@ -1700,12 +1716,17 @@
 		startstop = cdrom_do_packet_command(drive, rq);
 		if (pc.stat)
 			++rq->errors;
+		spin_lock_irq(ch->lock);
 
 		return startstop;
 	}
 
 	blk_dump_rq_flags(rq, "ide-cd bad flags");
+	/* FIXME: make this unlocking go away*/
+	spin_unlock_irq(ch->lock);
 	cdrom_end_request(drive, rq, 0);
+	spin_lock_irq(ch->lock);
+
 	return ide_stopped;
 }
 
@@ -2969,7 +2990,7 @@
 	attach:			ide_cdrom_attach,
 	cleanup:		ide_cdrom_cleanup,
 	standby:		NULL,
-	do_request:		ide_cdrom_do_request,
+	XXX_do_request:		ide_cdrom_do_request,
 	end_request:		NULL,
 	ioctl:			ide_cdrom_ioctl,
 	open:			ide_cdrom_open,
drivers/ide/ide-disk.c +25 -48

158 lines not on this page · raw message

drivers/ide/ide-floppy.c +22 -2
diff -urN linux-2.5.21/drivers/ide/ide-floppy.c linux/drivers/ide/ide-floppy.c
@@ -1279,8 +1279,10 @@
  */
 static ide_startstop_t idefloppy_do_request(struct ata_device *drive, struct request *rq, sector_t block)
 {
+	struct ata_channel *ch = drive->channel;
 	idefloppy_floppy_t *floppy = drive->driver_data;
 	struct atapi_packet_command *pc;
+	int ret;
 
 #if IDEFLOPPY_DEBUG_LOG
 	printk (KERN_INFO "rq_status: %d, rq_dev: %u, flags: %lx, errors: %d\n",rq->rq_status,(unsigned int) rq->rq_dev,rq->flags,rq->errors);
@@ -1293,13 +1295,22 @@
 				drive->name, floppy->failed_pc->c[0], floppy->sense_key, floppy->asc, floppy->ascq);
 		else
 			printk (KERN_ERR "ide-floppy: %s: I/O error\n", drive->name);
+
+		/* FIXME: make this unlocking go away*/
+		spin_unlock_irq(ch->lock);
 		idefloppy_end_request(drive, rq, 0);
+		spin_lock_irq(ch->lock);
+
 		return ide_stopped;
 	}
 	if (rq->flags & REQ_CMD) {
 		if (rq->sector % floppy->bs_factor || rq->nr_sectors % floppy->bs_factor) {
 			printk ("%s: unsupported r/w request size\n", drive->name);
+			/* FIXME: make this unlocking go away*/
+			spin_unlock_irq(ch->lock);
 			idefloppy_end_request(drive, rq, 0);
+			spin_lock_irq(ch->lock);
+
 			return ide_stopped;
 		}
 		pc = idefloppy_next_pc_storage(drive);
@@ -1309,11 +1320,20 @@
 		pc = (struct atapi_packet_command *) rq->buffer;
 	} else {
 		blk_dump_rq_flags(rq, "ide-floppy: unsupported command in queue");
+		/* FIXME: make this unlocking go away*/
+		spin_unlock_irq(ch->lock);
 		idefloppy_end_request(drive, rq, 0);
+		spin_lock_irq(ch->lock);
+
 		return ide_stopped;
 	}
 
-	return idefloppy_issue_pc(drive, rq, pc);
+	/* FIXME: make this unlocking go away*/
+	spin_unlock_irq(ch->lock);
+	ret = idefloppy_issue_pc(drive, rq, pc);
+	spin_lock_irq(ch->lock);
+
+	return ret;
 }
 
 /*
@@ -2027,7 +2047,7 @@
 	attach:			idefloppy_attach,
 	cleanup:		idefloppy_cleanup,
 	standby:		NULL,
-	do_request:		idefloppy_do_request,
+	XXX_do_request:		idefloppy_do_request,
 	end_request:		idefloppy_end_request,
 	ioctl:			idefloppy_ioctl,
 	open:			idefloppy_open,
drivers/ide/ide-tape.c +40 -10

139 lines not on this page · raw message

drivers/ide/main.c +0 -2
diff -urN linux-2.5.21/drivers/ide/main.c linux/drivers/ide/main.c
@@ -622,8 +622,6 @@
 		struct ata_operations *tmp;
 		unsigned long flags;
 
-		struct ata_operations *sd = NULL;
-
 		spin_lock_irqsave(&ata_drivers_lock, flags);
 		for(tmp = ata_drivers; tmp; tmp = tmp->next) {
 			if (subdriver_match(ch, tmp) > 0)
drivers/ide/pdc202xx.c +5 -2
diff -urN linux-2.5.21/drivers/ide/pdc202xx.c linux/drivers/ide/pdc202xx.c
@@ -159,7 +159,10 @@
 {
 	struct pci_dev *dev = drive->channel->pci_dev;
 	u32 drive_conf;
-	u8 drive_pci, AP, BP, CP, DP, TA = 0, TB, TC = 0;
+	u8 drive_pci, AP, BP, CP, TA = 0, TB, TC = 0;
+#if PDC202XX_DECODE_REGISTER_INFO
+	u8 DP;
+#endif
 
 	if (drive->dn > 3) /* FIXME: remove this --bkz */
 		return -1;
@@ -188,7 +191,7 @@
 		case XFER_SW_DMA_2:	TB = 0x60; TC = 0x05; break;
 		case XFER_SW_DMA_1:	TB = 0x80; TC = 0x06; break;
 		case XFER_SW_DMA_0:	TB = 0xC0; TC = 0x0B; break;
-#endif /* CONFIG_BLK_DEV_IDEDMA */
+#endif
 		case XFER_PIO_4:	TA = 0x01; TB = 0x04; break;
 		case XFER_PIO_3:	TA = 0x02; TB = 0x06; break;
 		case XFER_PIO_2:	TA = 0x03; TB = 0x08; break;
drivers/ide/probe.c +4 -3
diff -urN linux-2.5.21/drivers/ide/probe.c linux/drivers/ide/probe.c
@@ -850,10 +850,11 @@
 		goto not_found;
 
 	/* Register this hardware interface within the global device tree.
+	 *
+	 * FIXME: This should be handled as a pci subdevice in a generic way.
 	 */
-	sprintf(ch->dev.bus_id, "%04lx",
-		(unsigned long) ch->io_ports[IDE_DATA_OFFSET]);
-	sprintf(ch->dev.name, "ide");
+	sprintf(ch->dev.bus_id, "ata@%02x", ch->unit);
+	strcpy(ch->dev.name, "ATA/ATAPI Host-Channel");
 	ch->dev.driver_data = ch;
 #ifdef CONFIG_PCI
 	if (ch->pci_dev)
drivers/scsi/ide-scsi.c +14 -5
diff -urN linux-2.5.21/drivers/scsi/ide-scsi.c linux/drivers/scsi/ide-scsi.c
@@ -482,6 +482,9 @@
  */
 static ide_startstop_t idescsi_do_request(struct ata_device *drive, struct request *rq, sector_t block)
 {
+	struct ata_channel *ch = drive->channel;
+	int ret;
+
 #ifdef DEBUG
 	printk(KERN_INFO "rq_status: %d, cmd: %d, errors: %d\n",
 			rq->rq_status,
@@ -494,12 +497,18 @@
 			rq->current_nr_sectors);
 #endif
 
+	/* FIXME: make this unlocking go away*/
+	spin_unlock_irq(ch->lock);
 	if (rq->flags & REQ_PC) {
-		return idescsi_issue_pc(drive, rq, (struct atapi_packet_command *) rq->special);
+		ret = idescsi_issue_pc(drive, rq, (struct atapi_packet_command *) rq->special);
+	} else {
+	    blk_dump_rq_flags(rq, "ide-scsi: unsup command");
+	    idescsi_end_request(drive, rq, 0);
+	    ret = ide_stopped;
 	}
-	blk_dump_rq_flags(rq, "ide-scsi: unsup command");
-	idescsi_end_request(drive, rq, 0);
-	return ide_stopped;
+	spin_lock_irq(ch->lock);
+
+	return ret;
 }
 
 static int idescsi_open(struct inode *inode, struct file *filp, struct ata_device *drive)
@@ -540,7 +549,7 @@
 	owner:			THIS_MODULE,
 	attach:			idescsi_attach,
 	cleanup:		idescsi_cleanup,
-	do_request:		idescsi_do_request,
+	XXX_do_request:		idescsi_do_request,
 	end_request:		idescsi_end_request,
 	open:			idescsi_open,
 	release:		idescsi_release,
include/linux/ide.h +2 -2
diff -urN linux-2.5.21/include/linux/ide.h linux/include/linux/ide.h
@@ -357,7 +357,7 @@
 	byte		queue_depth;	/* max queue depth */
 	unsigned int	failures;	/* current failure count */
 	unsigned int	max_failures;	/* maximum allowed failure count */
-	struct device	device;		/* global device tree handle */
+	struct device	dev;		/* global device tree handle */
 
 	/*
 	 * tcq statistics
@@ -545,7 +545,7 @@
 	void (*attach) (struct ata_device *);
 	int (*cleanup)(struct ata_device *);
 	int (*standby)(struct ata_device *);
-	ide_startstop_t	(*do_request)(struct ata_device *, struct request *, sector_t);
+	ide_startstop_t	(*XXX_do_request)(struct ata_device *, struct request *, sector_t);
 	int (*end_request)(struct ata_device *, struct request *, int);
 
 	int (*ioctl)(struct ata_device *, struct inode *, struct file *, unsigned int, unsigned long);