jffs2 simplifications

David Woodhouse dwmw2 at infradead.org
Mon Jan 10 10:13:10 EST 2005


On Mon, 2005-01-10 at 15:51 +0100, Jörn Engel wrote:
> Exactly.  Anything other than functional code makes it hard to read
> and even harder to change.  So the chances of introducing bugs are
> much higher.  In a way, the debug code is needed because of the debug
> code itself.
> 
> Sure, it also serves a real purpose and not having any debug code
> requires programmers that don't cause bugs.  So it is a necessary
> evil.  The real art is to get by with as little debug code as
> possible, yet have enough data to easily find any problems.

I don't really see how printks make the code harder to read. You can
probably convince your editor to hide them from you automatically if
they really offend you.

I prefer to optimise for the common case -- which is the _user_ not the
developer. The level of verbosity if you enable CONFIG_JFFS2_FS_DEBUG is
high, but it means that I can take a log from a clueless end-user and
see precisely what's going on. I can look at a log from someone who's
having problems, see precisely what's happening, and provide a patch in
reply. While there are certainly some printks which can go, and even
more could be demoted to level 2 from level 1 (which is all that's ever
really useful), I wouldn't want to see it completely stripped of
debugging output. Not unless you want to take over the task of
supporting users ;)

-- 
dwmw2





More information about the linux-mtd mailing list