lkml.org 
[lkml]   [1999]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectgoto's ???

G'day all,

I was just have a bit of a look at the fs code, and noticed something a
little odd. There are alot of 'goto' statements in the code. From what I
can see they are not needed.

eg :
line 632 of /usr/src/linux/fs/open.c :

struct file *filp_open(const char * filename, int flags, int mode)
{
struct inode * inode;
struct dentry * dentry;
struct file * f;
int flag,error;

error = -ENFILE;
f = get_empty_filp();
if (!f)
goto out;
....
<SNIP>

out:
return ERR_PTR(error);
}

this seems like an extra jmp statement to me (unless the compiler
optimises it)

ie why not just do this :
struct file *filp_open(const char * filename, int flags, int mode)
{
struct inode * inode;
struct dentry * dentry;
struct file * f;
int flag,error;

error = -ENFILE;
f = get_empty_filp();
if (!f)
return ERR_PTR(error);
....
<SNIP>
}

Cheers Mof.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.080 / U:1.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site