Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1351562 > unrolled thread

[PATCH] md/bitmap: remove redundant check

Started byEric Engestrom <eric.engestrom@imgtec.com>
First post2016-03-07 13:10 +0100
Last post2016-03-07 18:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] md/bitmap: remove redundant check Eric Engestrom <eric.engestrom@imgtec.com> - 2016-03-07 13:10 +0100
    Re: [PATCH] md/bitmap: remove redundant check Shaohua Li <shli@kernel.org> - 2016-03-07 18:30 +0100

#1351562 — [PATCH] md/bitmap: remove redundant check

FromEric Engestrom <eric.engestrom@imgtec.com>
Date2016-03-07 13:10 +0100
Subject[PATCH] md/bitmap: remove redundant check
Message-ID<ra294-2Fp-11@gated-at.bofh.it>
daemon_sleep is an unsigned, so testing if it's 0 or less than 1 does
the same thing.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 drivers/md/bitmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index d80cce4..bbe7b64 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -510,8 +510,7 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
 	sb->chunksize = cpu_to_le32(chunksize);
 
 	daemon_sleep = bitmap->mddev->bitmap_info.daemon_sleep;
-	if (!daemon_sleep ||
-	    (daemon_sleep < 1) || (daemon_sleep > MAX_SCHEDULE_TIMEOUT)) {
+	if (!daemon_sleep || (daemon_sleep > MAX_SCHEDULE_TIMEOUT)) {
 		printk(KERN_INFO "Choosing daemon_sleep default (5 sec)\n");
 		daemon_sleep = 5 * HZ;
 	}
-- 
2.7.1

[toc] | [next] | [standalone]


#1351822

FromShaohua Li <shli@kernel.org>
Date2016-03-07 18:30 +0100
Message-ID<ra78L-5Qh-33@gated-at.bofh.it>
In reply to#1351562
On Mon, Mar 07, 2016 at 12:01:05PM +0000, Eric Engestrom wrote:
> daemon_sleep is an unsigned, so testing if it's 0 or less than 1 does
> the same thing.
> 
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
>  drivers/md/bitmap.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
> index d80cce4..bbe7b64 100644
> --- a/drivers/md/bitmap.c
> +++ b/drivers/md/bitmap.c
> @@ -510,8 +510,7 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
>  	sb->chunksize = cpu_to_le32(chunksize);
>  
>  	daemon_sleep = bitmap->mddev->bitmap_info.daemon_sleep;
> -	if (!daemon_sleep ||
> -	    (daemon_sleep < 1) || (daemon_sleep > MAX_SCHEDULE_TIMEOUT)) {
> +	if (!daemon_sleep || (daemon_sleep > MAX_SCHEDULE_TIMEOUT)) {
>  		printk(KERN_INFO "Choosing daemon_sleep default (5 sec)\n");
>  		daemon_sleep = 5 * HZ;
>  	}

Applied, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web