Untangle code in bio.c

From: Pavel Machek (pavel_at_ucw.cz)
Date: 09/15/04

  • Next message: Pavel Machek: "swsusp: speedup patch"
    Date:	Wed, 15 Sep 2004 13:18:02 +0200
    To: kernel list <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@zip.com.au>, Rusty trivial patch monkey Russell <trivial@rustcorp.com.au>
    
    

    Hi!

    bio.c uses quite ugly code with goto's, completely
    unneccessarily. Please apply,
                                                                    Pavel

    --- clean-mm/fs/bio.c 2004-09-15 12:58:10.000000000 +0200
    +++ linux-mm/fs/bio.c 2004-09-15 13:00:51.000000000 +0200
    @@ -143,7 +143,7 @@
     
             bio = mempool_alloc(bio_pool, gfp_mask);
             if (unlikely(!bio))
    - goto out;
    + return NULL;
     
             bio_init(bio);
     
    @@ -157,13 +157,11 @@
     noiovec:
                     bio->bi_io_vec = bvl;
                     bio->bi_destructor = bio_destructor;
    -out:
                     return bio;
             }
     
             mempool_free(bio, bio_pool);
    - bio = NULL;
    - goto out;
    + return NULL;
     }
     
     /**

    -- 
    People were complaining that M$ turns users into beta-testers...
    ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
    -
    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: Pavel Machek: "swsusp: speedup patch"

    Relevant Pages

    • Re: highmem handling again
      ... People were complaining that M$ turns users into beta-testers... ... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl! ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 4/8] sonypi: rework input support
      ... People were complaining that M$ turns users into beta-testers... ... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl! ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • swsusp: kill unused variable
      ... People were complaining that M$ turns users into beta-testers... ... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl! ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Fix suspend/resume problems with b44
      ... People were complaining that M$ turns users into beta-testers... ... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl! ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: bkcvs not being updated?
      ... People were complaining that M$ turns users into beta-testers... ... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl! ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)