Re: [PATCH] Removes unnecessary if statement from /drivers/block/z2ram.c

From: Adrian Bunk (bunk_at_stusta.de)
Date: 03/01/05

  • Next message: Matt Mackall: "Re: [PATCH 1/8] lib/sort: Heapsort implementation of sort()"
    Date:	Tue, 1 Mar 2005 21:08:58 +0100
    To: Telemaque Ndizihiwe <telendiz@eircom.net>
    
    

    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Matt Mackall: "Re: [PATCH 1/8] lib/sort: Heapsort implementation of sort()"

    Relevant Pages

    • drivers/acpi/video.c: null pointer dereference
      ... The Coverity checker found the following null pointer dereference in ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • create_proc_entry and !CONFIG_PROC_FS
      ... static int __init br2684_init ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • drivers/acpi/scan.c: inconsequent NULL handling
      ... NULL pointer reference, or it can't, in which case the check whether ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • 2.6: fs/coda/dir.c: coda_hasmknod seems to be buggy
      ... static int coda_mknod(struct inode *dir, struct dentry *de, int mode, dev_t rdev) ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.6 patch] some XFS cleanups (fwd)
      ... > These first changes aren't really useful; they make the DMAPI ... > not-enough gain. ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)