login
Header Space

 
 

[PATCH] kill empty chardev open/release methods

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jonathan Corbet <corbet@...>
Cc: Linus Torvalds <torvalds@...>, Ingo Molnar <mingo@...>, Andrew Morton <akpm@...>, Peter Zijlstra <a.p.zijlstra@...>, Thomas Gleixner <tglx@...>, Alan Cox <alan@...>, Alexander Viro <viro@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 12:03 pm

On Fri, May 16, 2008 at 11:49:22AM -0400, Christoph Hellwig wrote:

And here's a patch to do just that:  remove all empty chardev
open/release methods.  Based on the list compiled by Jonathan.

(and yeah, ip2_ipl_open is not technically empty at the source level,
 but only at the binary level :))


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/arch/cris/arch-v10/drivers/i2c.c
===================================================================
--- linux-2.6.orig/arch/cris/arch-v10/drivers/i2c.c	2008-05-16 17:58:15.000000000 +0200
+++ linux-2.6/arch/cris/arch-v10/drivers/i2c.c	2008-05-16 17:58:19.000000000 +0200
@@ -563,18 +563,6 @@ i2c_readreg(unsigned char theSlave, unsi
 	return b;
 }
 
-static int
-i2c_open(struct inode *inode, struct file *filp)
-{
-	return 0;
-}
-
-static int
-i2c_release(struct inode *inode, struct file *filp)
-{
-	return 0;
-}
-
 /* Main device API. ioctl's to write or read to/from i2c registers.
  */
 
@@ -619,8 +607,6 @@ i2c_ioctl(struct inode *inode, struct fi
 static const struct file_operations i2c_fops = {
 	.owner    = THIS_MODULE,
 	.ioctl    = i2c_ioctl,
-	.open     = i2c_open,
-	.release  = i2c_release,
 };
 
 int __init
Index: linux-2.6/arch/cris/arch-v32/drivers/i2c.c
===================================================================
--- linux-2.6.orig/arch/cris/arch-v32/drivers/i2c.c	2008-05-16 17:57:56.000000000 +0200
+++ linux-2.6/arch/cris/arch-v32/drivers/i2c.c	2008-05-16 17:58:07.000000000 +0200
@@ -633,18 +633,6 @@ i2c_readreg(unsigned char theSlave, unsi
 	return b;
 }
 
-static int
-i2c_open(struct inode *inode, struct file *filp)
-{
-	return 0;
-}
-
-static int
-i2c_release(struct inode *inode, struct file *filp)
-{
-	return 0;
-}
-
 /* Main device API. ioctl's to write or read to/from i2c registers.
  */
 
@@ -689,8 +677,6 @@ i2c_ioctl(struct inode *inode, struct fi
 static const struct file_operations i2c_fops = {
 	.owner =    THIS_MODULE,
 	.ioctl =    i2c_ioctl,
-	.open =     i2c_open,
-	.release =  i2c_release,
 };
 
 static int __init i2c_init(void)
Index: linux-2.6/drivers/char/ip2/ip2main.c
===================================================================
--- linux-2.6.orig/drivers/char/ip2/ip2main.c	2008-05-16 17:59:17.000000000 +0200
+++ linux-2.6/drivers/char/ip2/ip2main.c	2008-05-16 17:59:37.000000000 +0200
@@ -203,7 +203,6 @@ static int set_serial_info(i2ChanStrPtr,
 static ssize_t ip2_ipl_read(struct file *, char __user *, size_t, loff_t *);
 static ssize_t ip2_ipl_write(struct file *, const char __user *, size_t, loff_t *);
 static int ip2_ipl_ioctl(struct inode *, struct file *, UINT, ULONG);
-static int ip2_ipl_open(struct inode *, struct file *);
 
 static int DumpTraceBuffer(char __user *, int);
 static int DumpFifoBuffer( char __user *, int);
@@ -236,7 +235,6 @@ static const struct file_operations ip2_
 	.read		= ip2_ipl_read,
 	.write		= ip2_ipl_write,
 	.ioctl		= ip2_ipl_ioctl,
-	.open		= ip2_ipl_open,
 }; 
 
 static unsigned long irq_counter = 0;
@@ -2918,58 +2916,6 @@ ip2_ipl_ioctl ( struct inode *pInode, st
 	return rc;
 }
 
-/******************************************************************************/
-/* Function:   ip2_ipl_open()                                                 */
-/* Parameters: Pointer to device inode                                        */
-/*             Pointer to file structure                                      */
-/* Returns:    Success or failure                                             */
-/*                                                                            */
-/* Description:                                                               */
-/*                                                                            */
-/*                                                                            */
-/******************************************************************************/
-static int
-ip2_ipl_open( struct inode *pInode, struct file *pFile )
-{
-	unsigned int iplminor = iminor(pInode);
-	i2eBordStrPtr pB;
-	i2ChanStrPtr  pCh;
-
-#ifdef IP2DEBUG_IPL
-	printk (KERN_DEBUG "IP2IPL: open\n" );
-#endif
-
-	switch(iplminor) {
-	// These are the IPL devices
-	case 0:
-	case 4:
-	case 8:
-	case 12:
-		break;
-
-	// These are the status devices
-	case 1:
-	case 5:
-	case 9:
-	case 13:
-		break;
-
-	// These are the debug devices
-	case 2:
-	case 6:
-	case 10:
-	case 14:
-		pB = i2BoardPtrTable[iplminor / 4];
-		pCh = (i2ChanStrPtr) pB->i2eChannelPtr;
-		break;
-
-	// This is the trace device
-	case 3:
-		break;
-	}
-	return 0;
-}
-
 static int
 proc_ip2mem_show(struct seq_file *m, void *v)
 {
Index: linux-2.6/drivers/isdn/hardware/eicon/divasi.c
===================================================================
--- linux-2.6.orig/drivers/isdn/hardware/eicon/divasi.c	2008-05-16 17:59:59.000000000 +0200
+++ linux-2.6/drivers/isdn/hardware/eicon/divasi.c	2008-05-16 18:00:13.000000000 +0200
@@ -74,7 +74,6 @@ static ssize_t um_idi_read(struct file *
 static ssize_t um_idi_write(struct file *file, const char __user *buf,
 			    size_t count, loff_t * offset);
 static unsigned int um_idi_poll(struct file *file, poll_table * wait);
-static int um_idi_open(struct inode *inode, struct file *file);
 static int um_idi_release(struct inode *inode, struct file *file);
 static int remove_entity(void *entity);
 static void diva_um_timer_function(unsigned long data);
@@ -136,7 +135,6 @@ static const struct file_operations diva
 	.read    = um_idi_read,
 	.write   = um_idi_write,
 	.poll    = um_idi_poll,
-	.open    = um_idi_open,
 	.release = um_idi_release
 };
 
@@ -398,12 +396,6 @@ static unsigned int um_idi_poll(struct f
 	return (POLLIN | POLLRDNORM);
 }
 
-static int um_idi_open(struct inode *inode, struct file *file)
-{
-	return (0);
-}
-
-
 static int um_idi_release(struct inode *inode, struct file *file)
 {
 	diva_um_idi_os_context_t *p_os;
Index: linux-2.6/drivers/isdn/hardware/eicon/divasmain.c
===================================================================
--- linux-2.6.orig/drivers/isdn/hardware/eicon/divasmain.c	2008-05-16 18:00:26.000000000 +0200
+++ linux-2.6/drivers/isdn/hardware/eicon/divasmain.c	2008-05-16 18:00:36.000000000 +0200
@@ -578,10 +578,6 @@ xdi_copy_from_user(void *os_handle, void
 /*
  * device node operations
  */
-static int divas_open(struct inode *inode, struct file *file)
-{
-	return (0);
-}
 
 static int divas_release(struct inode *inode, struct file *file)
 {
@@ -667,7 +663,6 @@ static const struct file_operations diva
 	.read    = divas_read,
 	.write   = divas_write,
 	.poll    = divas_poll,
-	.open    = divas_open,
 	.release = divas_release
 };
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[announce] "kill the Big Kernel Lock (BKL)" tree, Ingo Molnar, (Wed May 14, 1:49 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Linus Torvalds, (Thu May 15, 1:41 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Arjan van de Ven, (Thu May 15, 4:27 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Peter Zijlstra, (Thu May 15, 4:45 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Arjan van de Ven, (Thu May 15, 5:22 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Linus Torvalds, (Wed May 14, 2:41 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Ingo Molnar, (Wed May 14, 3:41 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Frederik Deweerdt, (Wed May 14, 4:05 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Wed May 14, 2:30 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Wed May 14, 5:13 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, H. Peter Anvin, (Wed May 14, 5:16 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Linus Torvalds, (Wed May 14, 5:45 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Wed May 14, 6:03 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Thu May 15, 10:27 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Fri May 16, 6:21 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Ingo Molnar, (Thu May 15, 4:02 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree , Jonathan Corbet, (Wed May 14, 5:45 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree , Jan Engelhardt, (Thu May 15, 4:44 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Diego Calleja, (Thu May 15, 10:54 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree , Linus Torvalds, (Wed May 14, 5:56 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree , Jonathan Corbet, (Wed May 14, 6:07 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree , Linus Torvalds, (Wed May 14, 6:14 pm)
[PATCH, RFC] char dev BKL pushdown , Jonathan Corbet, (Fri May 16, 11:44 am)
Re: [PATCH, RFC] char dev BKL pushdown , Linus Torvalds, (Sat May 17, 5:58 pm)
Re: [PATCH, RFC] char dev BKL pushdown , Jonathan Corbet, (Sun May 18, 4:07 pm)
Re: [PATCH, RFC] char dev BKL pushdown , Linus Torvalds, (Fri May 16, 12:30 pm)
Re: [PATCH, RFC] char dev BKL pushdown , Jonathan Corbet, (Fri May 16, 12:43 pm)
Re: [PATCH, RFC] char dev BKL pushdown, Arnd Bergmann, (Sat May 17, 5:15 pm)
Re: [PATCH, RFC] char dev BKL pushdown , Jonathan Corbet, (Sun May 18, 4:26 pm)
Re: [PATCH, RFC] char dev BKL pushdown, Arnd Bergmann, (Mon May 19, 7:07 pm)
Re: [PATCH, RFC] char dev BKL pushdown , Jonathan Corbet, (Tue May 20, 11:13 am)
Re: [PATCH, RFC] char dev BKL pushdown, Arnd Bergmann, (Tue May 20, 1:21 pm)
Re: [PATCH, RFC] char dev BKL pushdown, Alan Cox, (Tue May 20, 2:51 pm)
[PATCH 1/3, RFC] misc char dev BKL pushdown, Arnd Bergmann, (Mon May 19, 7:26 pm)
Re: [PATCH 1/3, RFC] misc char dev BKL pushdown, Mike Frysinger, (Tue May 20, 7:01 pm)
Re: [PATCH 1/3, RFC] misc char dev BKL pushdown , Jonathan Corbet, (Tue May 20, 7:25 pm)
Re: [PATCH 1/3, RFC] misc char dev BKL pushdown, Mike Frysinger, (Wed May 21, 12:22 pm)
Re: [PATCH 1/3, RFC] misc char dev BKL pushdown, Alan Cox, (Tue May 20, 4:46 am)
Re: [PATCH 1/3, RFC] misc char dev BKL pushdown, Mike Frysinger, (Mon May 19, 8:07 pm)
Re: [PATCH 1/3, RFC] misc char dev BKL pushdown , Jonathan Corbet, (Mon May 19, 8:21 pm)
Re: [PATCH 1/3, RFC] misc char dev BKL pushdown, Mike Frysinger, (Mon May 19, 8:46 pm)
[PATCH 3/3, RFC] remove BKL from misc_open(), Arnd Bergmann, (Mon May 19, 7:34 pm)
Re: [PATCH, RFC] char dev BKL pushdown, Alan Cox, (Fri May 16, 12:22 pm)
Re: [PATCH, RFC] char dev BKL pushdown, Christoph Hellwig, (Fri May 16, 11:49 am)
[PATCH] kill empty chardev open/release methods, Christoph Hellwig, (Fri May 16, 12:03 pm)
Re: [PATCH] kill empty chardev open/release methods , Jonathan Corbet, (Sun May 18, 3:46 pm)
Re: [PATCH] kill empty chardev open/release methods, Alan Cox, (Fri May 16, 12:24 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Wed May 14, 6:11 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Linus Torvalds, (Wed May 14, 6:16 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Wed May 14, 6:21 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, John Stoffel, (Thu May 15, 11:05 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Thu May 15, 11:10 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, John Stoffel, (Thu May 15, 11:18 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Thu May 15, 11:45 am)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Kevin Winchester, (Fri May 16, 8:14 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Kevin Winchester, (Fri May 16, 8:37 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Linus Torvalds, (Wed May 14, 6:11 pm)
Re: [announce] "kill the Big Kernel Lock (BKL)" tree, Andi Kleen, (Wed May 14, 6:15 pm)
speck-geostationary