From: James Kosin <james.kosin.04@cnu.edu>
To: linux-kernel@vger.kernel.org
Cc: joe@perches.com
Subject: Re: [PATCH 23/24] drivers/block/floppy.c: Add function is_ready_state
Date: Sat, 23 Jan 2010 12:32:31 -0500 [thread overview]
Message-ID: <4B5B32AF.1010509@cox.net> (raw)
In-Reply-To: <e5jMM-25X-51@gated-at.bofh.it>
On 1/22/2010 12:00 AM, Joe Perches wrote:
> Used a couple of times, might simplify the code a bit.
>
> Signed-off-by: Joe Perches<joe@perches.com>
> ---
> drivers/block/floppy.c | 19 +++++++++++++++----
> 1 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> index 2f6ed78..fd56b26 100644
> --- a/drivers/block/floppy.c
> +++ b/drivers/block/floppy.c
> @@ -782,6 +782,12 @@ static inline int is_selected(int dor, int unit)
> return ((dor& (0x10<< unit))&& (dor& 3) == unit);
> }
>
> +static bool is_ready_state(int status)
> +{
> + int state = status& (STATUS_READY | STATUS_DIR | STATUS_DMA);
> + return state == STATUS_READY;
> +}
> +
This should probably be simplified to:
static bool is_ready_state(int status)
{
return ((state & STATUS_READY) == STATUS_READY);
}
James
next parent reply other threads:[~2010-01-23 17:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <e5jMK-25X-3@gated-at.bofh.it>
[not found] ` <e5jMM-25X-51@gated-at.bofh.it>
2010-01-23 17:32 ` James Kosin [this message]
[not found] ` <1264279618.30778.34.camel@Joe-Laptop.home>
2010-01-26 1:26 ` [PATCH 23/24] drivers/block/floppy.c: Add function is_ready_state James Kosin
2010-01-26 15:06 ` Nick Bowler
2010-01-26 1:34 ` James Kosin
2010-01-22 4:52 [PATCH 00/24] drivers/block/floppy.c cleanups Joe Perches
2010-01-22 4:52 ` [PATCH 23/24] drivers/block/floppy.c: Add function is_ready_state Joe Perches
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=4B5B32AF.1010509@cox.net \
--to=james.kosin.04@cnu.edu \
--cc=joe@perches.com \
--cc=linux-kernel@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