add round_up utility function

OF protocols need this in many places.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
FUJITA Tomonori 2012-06-25 13:37:19 +09:00
parent b0d77225fd
commit 910563941d

View File

@ -61,3 +61,7 @@ def find_flagfile(default_path=RYU_DEFAULT_FLAG_FILE):
sys.argv.insert(1, flagfile)
LOG.debug('flagfile = %s', filename)
return
def round_up(x, y):
return ((x + y - 1) / y) * y