From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Adrian Bunk" <bunk@kernel.org>
Cc: "Ben Dooks" <ben@simtec.co.uk>,
"Vincent Sanders" <vince@simtec.co.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch] mfd/sm501.c: #if 0 unused functions
Date: Sun, 13 Apr 2008 20:55:21 +0200 [thread overview]
Message-ID: <9a8748490804131155g3df93ba7s9c2131a957391ee3@mail.gmail.com> (raw)
In-Reply-To: <20080413181531.GD2182@cs181133002.pp.htv.fi>
On 13/04/2008, Adrian Bunk <bunk@kernel.org> wrote:
> This patch #if 0's the following unused functions:
> - sm501_find_clock()
> - sm501_gpio_get()
> - sm501_gpio_set()
>
Hi Adrian,
I know we've discussed this before, but I have to comment on this once more.
Why is it that you seem to prefer adding '#if 0' around blocks of
unused code instead of removing it outright?
Last time we discussed this your argument went something along the
lines of "it'll be used again soon, so we can reinstate it then". As I
recall I commented on that but never got a reply, so I'll try again.
My position is;
A) If the code is unused and will never be used again in the future,
we should just remove it outright.
B) If the code is currently unused but will be used soon (definition
of 'soon' left as an exercise for the reader), then we should either
a) remove the code now and reinstate it later along with the code that
uses it, or b) just leave it alone so we don't have pointless churn of
two patches, one that just comments out the code and then later
another that just uncomments it.
C) If the code is currently unused and may or may not be used in the
future, do the same as in 'B'.
We currently have over two thousand instances of code inside '#if 0'
blocks in the source tree
juhl@dragon:~/kernel/linux-2.6$ pwd
/home/juhl/kernel/linux-2.6
juhl@dragon:~/kernel/linux-2.6$ egrep -R "^ *# *if +0" . | wc -l
2168
A lot of that code is years old and should never have been commented
out, it should just have been removed. We are just leaving a lot of
junk around this way that we'll never get around to cleaning out.
Janitors will be afraid to remove it since "it might be needed soon
and we can't tell" and maintainers seem reluctant to submit cleanup
patches of their own to remove it (for reasons I won't pretend to
know), so the unused code just sits there and rots.
When I removed some unused code from floppy.c a while back, one of the
blocks I removed was within '#if 0' and had been that way for years -
it should just have been removed back then instead of being commented
out.
So why exactly is it you (and others) keep doing this?
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2008-04-13 18:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-13 18:15 Adrian Bunk
2008-04-13 18:55 ` Jesper Juhl [this message]
2008-04-13 19:03 ` Adrian Bunk
2008-04-13 19:08 ` Jesper Juhl
2008-04-13 19:24 ` Adrian Bunk
2008-04-13 19:32 ` Dmitri Vorobiev
2008-04-13 19:43 ` Adrian Bunk
2008-04-13 19:34 ` Jesper Juhl
2008-04-13 19:47 ` Adrian Bunk
2008-04-13 19:53 ` Jesper Juhl
2008-05-05 18:25 Adrian Bunk
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=9a8748490804131155g3df93ba7s9c2131a957391ee3@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=ben@simtec.co.uk \
--cc=bunk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vince@simtec.co.uk \
/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
all inboxes | Powered by JetHome®