diff mbox

[1/2] btrfs-progs: fix nanosecs in task_period_start

Message ID 1530732014-5449-2-git-send-email-stephane_btrfs@lesimple.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Stéphane Lesimple July 4, 2018, 7:20 p.m. UTC
This is a single-line fix on the preexisting task_period_start function.

Signed-off-by: Stéphane Lesimple <stephane_btrfs@lesimple.fr>
---
 task-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Su Yue July 5, 2018, 7:53 a.m. UTC | #1
On 07/05/2018 03:20 AM, Stéphane Lesimple wrote:
> This is a single-line fix on the preexisting task_period_start function.
> 
> Signed-off-by: Stéphane Lesimple <stephane_btrfs@lesimple.fr>

Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>

> ---
>   task-utils.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/task-utils.c b/task-utils.c
> index 12b0002..284cbb3 100644
> --- a/task-utils.c
> +++ b/task-utils.c
> @@ -102,7 +102,7 @@ int task_period_start(struct task_info *info, unsigned int period_ms)
>   	info->periodic.wakeups_missed = 0;
>   
>   	sec = period_ms / 1000;
> -	ns = (period_ms - (sec * 1000)) * 1000;
> +	ns = (period_ms - (sec * 1000)) * 1000 * 1000;
>   	itval.it_interval.tv_sec = sec;
>   	itval.it_interval.tv_nsec = ns;
>   	itval.it_value.tv_sec = sec;
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/task-utils.c b/task-utils.c
index 12b0002..284cbb3 100644
--- a/task-utils.c
+++ b/task-utils.c
@@ -102,7 +102,7 @@  int task_period_start(struct task_info *info, unsigned int period_ms)
 	info->periodic.wakeups_missed = 0;
 
 	sec = period_ms / 1000;
-	ns = (period_ms - (sec * 1000)) * 1000;
+	ns = (period_ms - (sec * 1000)) * 1000 * 1000;
 	itval.it_interval.tv_sec = sec;
 	itval.it_interval.tv_nsec = ns;
 	itval.it_value.tv_sec = sec;