From: Andy Zhou Date: Tue, 27 Aug 2013 23:19:53 +0000 (-0700) Subject: datapath: add rounddown() definition into compatibility code X-Git-Tag: sliver-openvswitch-2.0.90-1~18^2~8 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=7061a497b10b0c830cebcd463ceac053ba81dea5 datapath: add rounddown() definition into compatibility code rounddown() was not available in older kenrel, such as kernel 2.6.32.61. Add it to the compatibility code. Signed-off-by: Andy Zhou Signed-off-by: Jesse Gross --- diff --git a/datapath/linux/compat/include/linux/kernel.h b/datapath/linux/compat/include/linux/kernel.h index fdd20058c..6e248c572 100644 --- a/datapath/linux/compat/include/linux/kernel.h +++ b/datapath/linux/compat/include/linux/kernel.h @@ -87,4 +87,13 @@ #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #endif +#ifndef rounddown +#define rounddown(x, y) ( \ +{ \ + typeof(x) __x = (x); \ + __x - (__x % (y)); \ +} \ +) +#endif + #endif /* linux/kernel.h */