473,322 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

inline usage in C linux kernel

hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_output(struct sk_buff *skb)
{
return __ip_finish_output(skb);
}

and also __ip_finish_output is written as
static __inline__ int __ip_finish_output(struct sk_buff *skb)
what are these changes in kernel? Does they are for optimization?

2)Also ip_output is calling __ip_finish_output instead ip_finish_output
why?
3) what is difference between declaring following 2 inline functions
static inline int ip_finish_output2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_output(struct sk_buff *skb)
please correct me.
regards,
rahul.

Nov 14 '05 #1
4 2679
In article <11*********************@z14g2000cwz.googlegroups. com>,
<ra*******@gmail.com> wrote:
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_output(struct sk_buff *skb)
{
return __ip_finish_output(skb);
}
You should ask that in a Linux developer's newsgroup, as it
is not a point that has to do with C itself.

3) what is difference between declaring following 2 inline functions
static inline int ip_finish_output2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_output(struct sk_buff *skb)


'inline' is not part of C89 (I don't know about C99),
so the two could be there for reasons having to do with
two different implimentations of 'inline'.
--
'ignorandus (Latin): "deserving not to be known"'
-- Journal of Self-Referentialism
Nov 14 '05 #2
ra*******@gmail.com wrote:
hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_output(struct sk_buff *skb)
{
return __ip_finish_output(skb);
}

and also __ip_finish_output is written as
static __inline__ int __ip_finish_output(struct sk_buff *skb)
what are these changes in kernel? Does they are for optimization?

7.1.3 Reserved identifiers

[...]
-- All identifiers that begin with an underscore and
either an uppercase letter or another underscore are
always reserved for any use.

__ip_finish_output is reserved for the implementation. In this case,
the implementors (the Linux kernel coders) have decided that this
roughly means "do not use for general kernel code; use it only if you
really know what you're doing." This is getting off-topic; see your
friendly Linux newsgroup for details (comp.os.linux.development*)

If you're not writing kernel or other very special purpose code, do not
ever infringe upon anything reserved for the implementation.

<snip> 3) what is difference between declaring following 2 inline functions
static inline int ip_finish_output2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_output(struct sk_buff *skb)


Once again, by its double underscore prefix, __inline__ is reserved for
the implementation. In this case it's for the compiler, and offtopic
here, so go consult your version of gcc's manual for the details.
Mark F. Haigh
mf*****@sbcglobal.net

Nov 14 '05 #3
rahul8143 wrote:
hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_output(struct sk_buff *skb)
{
return __ip_finish_output(skb);
}


Wrong newsgroup. Try comp.os.linux.development.system
Nov 14 '05 #4
In article <11*********************@z14g2000cwz.googlegroups. com>,
ra*******@gmail.com wrote:
hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_output(struct sk_buff *skb)
{
return __ip_finish_output(skb);
}

and also __ip_finish_output is written as
static __inline__ int __ip_finish_output(struct sk_buff *skb)
what are these changes in kernel? Does they are for optimization?

2)Also ip_output is calling __ip_finish_output instead ip_finish_output
why?
3) what is difference between declaring following 2 inline functions
static inline int ip_finish_output2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_output(struct sk_buff *skb)
please correct me.
regards,


I looked through my copy of the C Standard, and I just couldn't find
this "new kernel 2.4.30" thing anywhere mentioned in it. Are you sure
you are posting to the right newsgroup here?
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bouchia.nazha | last post by:
Hello I have encountered a problem using tomcat, linux and ssl. My problem seem to be a JVM memory deallocation problem on Linux. This is my configuration: OS: Redhat7.2 Tomcat: 4.0 Jdk:...
34
by: Maboroshi | last post by:
Hello My question has to do with python and linux - I was interested in finding out what it would take to reimplement the Linux Kernel in python basically just taking the source code from linux...
3
by: Steven T. Hatton | last post by:
http://netlab.ru.is/exception/LinuxCXX.shtml We have implemented a complete kernel level run-time support for C++ in the Linux kernel. In particular our run-time support enables the full use of...
4
by: PaulR | last post by:
Hi, We have a Server running SLES 8 and 3GB memory, with 1 DB2 instance and 2 active Databases. General info... DB2level = "DB2 v8.1.0.72", "s040914", "MI00086", and FixPak "7" uname -a =...
5
by: Ralf Gross | last post by:
Hi, we have a little problem with the dependencies of an application (MKS) that we want to upgrade to a new version. The application now runs on a Suse Linux 7.3 system with 2.4 kernel and...
27
by: Mike | last post by:
Open source programs in general suck pretty bad also. Here are some loose facts regarding why projects like Linux, PHP, MYSQL, and other open source programs suck: - Linux is simply a clone of...
31
by: arun | last post by:
I know it is a free compiler. But does it follow any standard? If so which standard is it? (Ansi, Ecma, etc?)
12
by: sethukr | last post by:
Hi everybody, Can anyone give me a simple program which would consumes more CPU usage (more than 50%) in windows? Thanks, Sethu
8
by: anchitgood | last post by:
Hey, I have developed a project on C++, but under windows. But we have got to run it in an open source (LINUX). Can anyone tell me what features of C++ are not supported in Linux ? Like i have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.