Thread (10 messages) 10 messages, 4 authors, 2005-07-30

Re: [PATCH] swsusp: simpler calculation of number of pages in PBE list

From: Rafael J. Wysocki <hidden>
Date: 2005-07-30 13:28:10
Also in: lkml

Hi,

On Saturday, 30 of July 2005 15:13, Pavel Machek wrote:
Hi!
quoted
quoted
	px >= n + x

or

	(p-1)x >= n

or

	x >= n / (p-1).

The obvious solution is

	x = ceiling(n / (p-1)),

so calc_nr should return n + ceiling(n / (p-1)), which is exactly what 
Michal's patch computes.
Nice. :-)

Could we perhaps add your proof to the Michal's patch as a comment,
for reference?
No, thanks. It only proves that it is equivalent to old code, but says
nothing about quality of code, and we really do not want to keep old
code around.
IMHO it rather says that the formula is OK and would save some time to
people reading the code for the _first_ time and trying to understand it,
but you decide. :-)

Greets,
Rafael


-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help