backprots: add rounddown
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 17 Jun 2013 12:10:42 +0000 (14:10 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 19 Jun 2013 20:22:28 +0000 (22:22 +0200)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/kernel.h

index 79ad8896ab7412c7bb6472c1c80e35ff700b95ad..42aa91ddc79e9d38075334f955a8133620b1b1f1 100644 (file)
@@ -271,6 +271,15 @@ int hex_to_bin(char ch);
        __val > __max ? __max: __val; })
 #endif
 
+#ifndef rounddown
+#define rounddown(x, y) (                              \
+{                                                      \
+       typeof(x) __x = (x);                            \
+       __x - (__x % (y));                              \
+}                                                      \
+)
+#endif /* rounddown */
+
 #endif /* __BACKPORT_KERNEL_H */
 
 /*