lkml.org 
[lkml]   [2010]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 23/24] drivers/block/floppy.c: Add function is_ready_state
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


\
 
 \ /
  Last update: 2010-01-23 18:35    [W:0.050 / U:2.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site