public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Removes unnecessary if statement from /drivers/block/z2ram.c
@ 2005-03-01 19:27 Telemaque Ndizihiwe
  2005-03-01 20:08 ` Adrian Bunk
  0 siblings, 1 reply; 2+ messages in thread
From: Telemaque Ndizihiwe @ 2005-03-01 19:27 UTC (permalink / raw)
  To: axboe, Ingo.Wilken; +Cc: marcelo.tosatti, torvalds, akpm, trivial, linux-kernel


This Patch removes unnecessary if statement from a function that has no 
implementation (in kernel 2.6.x and 2.4.x); the function returns 0 with 
or without the if statement:

 	static int z2_release(struct inode *inode, struct file *filp)
 	{
 		if(current_device==-1)
 			return 0;

 		return 0;
 	}


Signed-off-by: Telemaque Ndizihiwe <telendiz@eircom.net>


--- linux-2.6.10/drivers/block/z2ram.c.orig	2005-02-23 18:02:51.011967584 +0000
+++ linux-2.6.10/drivers/block/z2ram.c	2005-02-23 18:05:31.617551824 +0000
@@ -304,9 +304,6 @@ err_out:
  static int
  z2_release( struct inode *inode, struct file *filp )
  {
-    if ( current_device == -1 )
-	return 0; 
-
      /*
       * FIXME: unmap memory
       */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Removes unnecessary if statement from /drivers/block/z2ram.c
  2005-03-01 19:27 [PATCH] Removes unnecessary if statement from /drivers/block/z2ram.c Telemaque Ndizihiwe
@ 2005-03-01 20:08 ` Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2005-03-01 20:08 UTC (permalink / raw)
  To: Telemaque Ndizihiwe
  Cc: axboe, Ingo.Wilken, marcelo.tosatti, torvalds, akpm, trivial,
	linux-kernel

On Tue, Mar 01, 2005 at 07:27:27PM +0000, Telemaque Ndizihiwe wrote:
> 
> This Patch removes unnecessary if statement from a function that has no 
> implementation (in kernel 2.6.x and 2.4.x); the function returns 0 with 
> or without the if statement:
> 
> 	static int z2_release(struct inode *inode, struct file *filp)
> 	{
> 		if(current_device==-1)
> 			return 0;
> 
> 		return 0;
> 	}
> 
> 
> Signed-off-by: Telemaque Ndizihiwe <telendiz@eircom.net>
> 
> 
> --- linux-2.6.10/drivers/block/z2ram.c.orig	2005-02-23 
> 18:02:51.011967584 +0000
> +++ linux-2.6.10/drivers/block/z2ram.c	2005-02-23 18:05:31.617551824 +0000
> @@ -304,9 +304,6 @@ err_out:
>  static int
>  z2_release( struct inode *inode, struct file *filp )
>  {
> -    if ( current_device == -1 )
> -	return 0; 
> -
>      /*
>       * FIXME: unmap memory
>       */

For what gain?

The real issue is that this function isn't really implemented.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-01 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-01 19:27 [PATCH] Removes unnecessary if statement from /drivers/block/z2ram.c Telemaque Ndizihiwe
2005-03-01 20:08 ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox