aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2016-05-31 18:35:59 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2016-06-07 18:19:25 +0300
commitdf5d1c17b6d9a436a3fcedcc16fa6fb8d28d2f07 (patch)
tree5422bce02f67265c9fbed9c694d272ee381e793c /hw/net
parent5d61cafd0b1c77e154a9777c07b675f840d7fbd7 (diff)
rocker: Use DIV_ROUND_UP
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 <sfeldma@gmail.com> Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/rocker/rocker_of_dpa.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c
index 0a134ebca8..9b1e0d2441 100644
--- a/hw/net/rocker/rocker_of_dpa.c
+++ b/hw/net/rocker/rocker_of_dpa.c
@@ -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;