From: Adrian Bunk <bunk@kernel.org>
To: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Cc: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>,
Heikki Orsila <shdl@zakalwe.fi>,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
trivial@kernel.org
Subject: Re: [PATCH 5/9] bfs: move function prototype to the proper header file
Date: Fri, 25 Jan 2008 12:42:17 +0200 [thread overview]
Message-ID: <20080125104217.GA6700@does.not.exist> (raw)
In-Reply-To: <Pine.LNX.4.61.0801242318560.8513@ginsburg.homenet>
On Thu, Jan 24, 2008 at 11:22:21PM +0000, Tigran Aivazian wrote:
> On Fri, 25 Jan 2008, Dmitri Vorobiev wrote:
>
>> Heikki Orsila пишет:
>>>> +extern void dump_imap(const char *, struct super_block *);
>>>> +
>>>
>>> Functions should not be externed, remove extern keyword.
>>>
>>
>> Care to explain why?
>
> because dump_imap() is just a BFS' internal helper (for debugging
> purposes only btw) to dump the inode map via printk. Why should it be
> moved into the header, i.e. where one expects to see things potentially
> visible by the rest of the kernel?
>...
fs/bfs/bfs.h is not visible to the rest of the kernel, it's the right
place for bfs-internal code.
Whether there's an "extern" written is just a syntax thing with zero
semantical implications. We tend to not write the "extern" in the
kernel, but that's nothing cast in stone.
But prototypes really belong into header files - bugs in this area are
rare, but when they occur they can cause nasty hard-to-debug bugs
(e.g. depending on the calling convention on the architecture calling
the function can turn your stack into garbage), and with the prototypes
in header files gcc can do type checks.
> Kind regards
> Tigran
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
next prev parent reply other threads:[~2008-01-25 10:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 22:31 [PATCH 0/9] bfs: assorted cleanups Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 1/9] bfs: remove a useless variable Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 2/9] bfs: coding style cleanup in fs/bfs/inode.c Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 3/9] bfs: coding style cleanup in fs/bfs/bfs.h Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 4/9] bfs: coding style cleanup in fs/bfs/dir.c Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 5/9] bfs: move function prototype to the proper header file Dmitri Vorobiev
2008-01-24 22:50 ` Heikki Orsila
2008-01-24 23:08 ` Tigran Aivazian
2008-01-24 23:17 ` Tigran Aivazian
2008-01-24 23:13 ` Dmitri Vorobiev
2008-01-24 23:22 ` Tigran Aivazian
2008-01-24 23:30 ` Dmitri Vorobiev
2008-01-25 10:42 ` Adrian Bunk [this message]
2008-01-25 11:12 ` Dmitri Vorobiev
2008-01-24 23:33 ` Heikki Orsila
2008-01-24 23:47 ` Dmitri Vorobiev
2008-01-25 1:55 ` Kyle Moffett
2008-01-24 22:32 ` [PATCH 6/9] bfs: coding style cleanup in fs/bfs/file.c Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 7/9] bfs: coding style cleanup in include/linux/bfs_fs.h Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 8/9] bfs: remove multiple assignments Dmitri Vorobiev
2008-01-24 22:32 ` [PATCH 9/9] bfs: use the proper header file for inclusion Dmitri Vorobiev
2008-01-25 10:25 ` [PATCH 0/9] bfs: assorted cleanups Dmitri Vorobiev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080125104217.GA6700@does.not.exist \
--to=bunk@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=dmitri.vorobiev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shdl@zakalwe.fi \
--cc=tigran@aivazian.fsnet.co.uk \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox