]> Git Repo - qemu.git/commitdiff
rocker: Use DIV_ROUND_UP
authorLaurent Vivier <[email protected]>
Tue, 31 May 2016 16:35:59 +0000 (18:35 +0200)
committerMichael Tokarev <[email protected]>
Tue, 7 Jun 2016 15:19:25 +0000 (18:19 +0300)
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Scott Feldman <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
hw/net/rocker/rocker_of_dpa.c

index 0a134ebca85494bfd2011cdc7a66d59b214dddfb..9b1e0d24412686fb0e3c0f9c05653689c9d7567d 100644 (file)
@@ -103,9 +103,8 @@ typedef struct of_dpa_flow_key {
 
 /* Width of key which includes field 'f' in u64s, rounded up */
 #define FLOW_KEY_WIDTH(f) \
-    ((offsetof(OfDpaFlowKey, f) + \
-      sizeof(((OfDpaFlowKey *)0)->f) + \
-      sizeof(uint64_t) - 1) / sizeof(uint64_t))
+    DIV_ROUND_UP(offsetof(OfDpaFlowKey, f) + sizeof(((OfDpaFlowKey *)0)->f), \
+    sizeof(uint64_t))
 
 typedef struct of_dpa_flow_action {
     uint32_t goto_tbl;
This page took 0.024985 seconds and 4 git commands to generate.