From: Andrew Morton <akpm@linux-foundation.org>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: dwmw2@infradead.org, greg@kroah.com, lethal@linux-sh.org,
linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
linux-mtd@vger.kernel.org
Subject: Re: [PATCH] 1/2 Maple: Update bus driver to allow support of VMU
Date: Thu, 20 Mar 2008 22:39:44 +0000 [thread overview]
Message-ID: <20080320153944.75b6edc1.akpm@linux-foundation.org> (raw)
In-Reply-To: <1206051797.6274.17.camel@localhost.localdomain>
On Thu, 20 Mar 2008 22:23:17 +0000
Adrian McMenamin <adrian@newgolddream.dyndns.info> wrote:
>
> > urgh, down_trylock(). And a secret, undocumented one too.
> >
> > A trylock is always an exceptional thing. How is *any* reader of this code
> > supposed to work out what the heck it's doing there? Convert it into
> > down(), run the code and decrypt the lockdep warnings, I suspect.
> >
> > <looks>
> >
> > Nope, I can't see any other lock being held when we call this function.
> >
> > The trylocks are an utter mystery to me. Please don't write mysterious
> > code.
> >
>
> OK, I am sure this is my problem but I have no idea why you are
> describing down_trylock as undocumented
I'm describing your use of it! I'm sitting here trying to work out why on
earth this code is using the highly unusual (and highly suspicious) trylock
idiom and this is far from clear.
And I assume that if I can't work out why code is doing unusual-looking
things, then other readers will not be able to do so either. Hence for
maintainability, that code of yours needs documenting. I think.
Now it's true that I am unfamilar witht he arcanery of the maple driver and
the interfaces which it calls into. But an experienced kernel developer
should be able to pick up a piece of code and have a decent shot at
understanding it. And being able to review it...
next prev parent reply other threads:[~2008-03-20 22:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 22:30 [PATCH] 0/2 Add support for maple "Visual Memory Unit" on SEGA Adrian McMenamin
2008-03-18 22:49 ` [PATCH] 1/2 Maple: Update bus driver to allow support of VMU device Adrian McMenamin
2008-03-18 22:56 ` [PATCH] 2/2 mtd: Add support for the Dreamcast VMU flash Adrian McMenamin
2008-03-20 21:10 ` Andrew Morton
2008-03-20 22:34 ` Adrian McMenamin
2008-03-20 20:56 ` [PATCH] 1/2 Maple: Update bus driver to allow support of VMU Andrew Morton
2008-03-20 22:23 ` Adrian McMenamin
2008-03-20 22:39 ` Andrew Morton [this message]
2008-03-20 22:52 ` Adrian McMenamin
2008-03-21 5:11 ` [PATCH] 1/2 Maple: Update bus driver to allow support of VMU device Paul Mundt
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=20080320153944.75b6edc1.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adrian@newgolddream.dyndns.info \
--cc=dwmw2@infradead.org \
--cc=greg@kroah.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@vger.kernel.org \
--cc=linux-sh@vger.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