All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uml: use DIV_ROUND_UP
@ 2008-02-19 21:49 ` Jiri Olsa
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Olsa @ 2008-02-19 21:49 UTC (permalink / raw)
  To: kernel-janitors

Hi,

I just saw similar patches in the janitor kernel's list,
and spotted place it fits.

Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
---
 arch/um/drivers/ubd_kern.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index b1a77b1..1e579e4 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1020,8 +1020,7 @@ static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
 	 * by one word.  Thanks to Lynn Kerby for the fix and James McMechan
 	 * for the original diagnosis.
 	 */
-	if(*cow_offset = ((bitmap_len + sizeof(unsigned long) - 1) /
-			   sizeof(unsigned long) - 1))
+	if(*cow_offset = (DIV_ROUND_UP(bitmap_len, sizeof(unsigned long)) - 1))
 		(*cow_offset)--;
 
 	bitmap_words[0] = bitmap[*cow_offset];


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [uml-devel] [PATCH] uml: use DIV_ROUND_UP
@ 2008-02-19 21:49 ` Jiri Olsa
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Olsa @ 2008-02-19 21:49 UTC (permalink / raw)
  To: Jeff Dike, kernel-janitors; +Cc: uml-devel

Hi,

I just saw similar patches in the janitor kernel's list,
and spotted place it fits.

Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
---
 arch/um/drivers/ubd_kern.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index b1a77b1..1e579e4 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1020,8 +1020,7 @@ static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
 	 * by one word.  Thanks to Lynn Kerby for the fix and James McMechan
 	 * for the original diagnosis.
 	 */
-	if(*cow_offset == ((bitmap_len + sizeof(unsigned long) - 1) /
-			   sizeof(unsigned long) - 1))
+	if(*cow_offset == (DIV_ROUND_UP(bitmap_len, sizeof(unsigned long)) - 1))
 		(*cow_offset)--;
 
 	bitmap_words[0] = bitmap[*cow_offset];


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] uml: use DIV_ROUND_UP
  2008-02-19 21:49 ` [uml-devel] " Jiri Olsa
@ 2008-02-20  2:44   ` WANG Cong
  -1 siblings, 0 replies; 6+ messages in thread
From: WANG Cong @ 2008-02-20  2:44 UTC (permalink / raw)
  To: kernel-janitors

From: Jiri Olsa <olsajiri@gmail.com>
Subject: [PATCH] uml: use DIV_ROUND_UP
Date: Tue, 19 Feb 2008 22:49:33 +0100
Message-ID: <47BB4EED.7020109@gmail.com>

> Hi,
> 
> I just saw similar patches in the janitor kernel's list,
> and spotted place it fits.
> 
> Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
> ---
>  arch/um/drivers/ubd_kern.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
> index b1a77b1..1e579e4 100644
> --- a/arch/um/drivers/ubd_kern.c
> +++ b/arch/um/drivers/ubd_kern.c
> @@ -1020,8 +1020,7 @@ static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
>  	 * by one word.  Thanks to Lynn Kerby for the fix and James McMechan
>  	 * for the original diagnosis.
>  	 */
> -	if(*cow_offset = ((bitmap_len + sizeof(unsigned long) - 1) /
> -			   sizeof(unsigned long) - 1))
> +	if(*cow_offset = (DIV_ROUND_UP(bitmap_len, sizeof(unsigned long)) - 1))

Looks good for me. ACK.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [uml-devel] [PATCH] uml: use DIV_ROUND_UP
@ 2008-02-20  2:44   ` WANG Cong
  0 siblings, 0 replies; 6+ messages in thread
From: WANG Cong @ 2008-02-20  2:44 UTC (permalink / raw)
  To: olsajiri; +Cc: jdike, kernel-janitors, user-mode-linux-devel

From: Jiri Olsa <olsajiri@gmail.com>
Subject: [PATCH] uml: use DIV_ROUND_UP
Date: Tue, 19 Feb 2008 22:49:33 +0100
Message-ID: <47BB4EED.7020109@gmail.com>

> Hi,
> 
> I just saw similar patches in the janitor kernel's list,
> and spotted place it fits.
> 
> Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
> ---
>  arch/um/drivers/ubd_kern.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
> index b1a77b1..1e579e4 100644
> --- a/arch/um/drivers/ubd_kern.c
> +++ b/arch/um/drivers/ubd_kern.c
> @@ -1020,8 +1020,7 @@ static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
>  	 * by one word.  Thanks to Lynn Kerby for the fix and James McMechan
>  	 * for the original diagnosis.
>  	 */
> -	if(*cow_offset == ((bitmap_len + sizeof(unsigned long) - 1) /
> -			   sizeof(unsigned long) - 1))
> +	if(*cow_offset == (DIV_ROUND_UP(bitmap_len, sizeof(unsigned long)) - 1))

Looks good for me. ACK.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [uml-devel] [PATCH] uml: use DIV_ROUND_UP
  2008-02-20  2:44   ` [uml-devel] " WANG Cong
@ 2008-02-20 16:18   ` Jeff Dike
  -1 siblings, 0 replies; 6+ messages in thread
From: Jeff Dike @ 2008-02-20 16:18 UTC (permalink / raw)
  To: kernel-janitors

On Wed, Feb 20, 2008 at 10:44:44AM +0800, WANG Cong wrote:
> Looks good for me. ACK.

Me too, I'll send it on if Andrew doesn't pick it up on his own.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [uml-devel] [PATCH] uml: use DIV_ROUND_UP
@ 2008-02-20 16:18   ` Jeff Dike
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Dike @ 2008-02-20 16:18 UTC (permalink / raw)
  To: WANG Cong; +Cc: kernel-janitors, user-mode-linux-devel

On Wed, Feb 20, 2008 at 10:44:44AM +0800, WANG Cong wrote:
> Looks good for me. ACK.

Me too, I'll send it on if Andrew doesn't pick it up on his own.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-20 16:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-19 21:49 [PATCH] uml: use DIV_ROUND_UP Jiri Olsa
2008-02-19 21:49 ` [uml-devel] " Jiri Olsa
2008-02-20  2:44 ` WANG Cong
2008-02-20  2:44   ` [uml-devel] " WANG Cong
2008-02-20 16:18 ` Jeff Dike
2008-02-20 16:18   ` Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.