ieee1394: Use DIV_ROUND_UP
authorJulia Lawall <julia@diku.dk>
Sat, 2 Aug 2008 15:13:09 +0000 (17:13 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 15 Oct 2008 20:21:07 +0000 (22:21 +0200)
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/ieee1394/csr1212.c
drivers/ieee1394/eth1394.c

index 9f95337139e3144424aba9c2e452939563f24586..5e38a68b8af279b0f6ad5a1280ef74db312f5730 100644 (file)
@@ -84,7 +84,7 @@ static const u8 csr1212_key_id_type_map[0x30] = {
 
 
 #define quads_to_bytes(_q) ((_q) * sizeof(u32))
-#define bytes_to_quads(_b) (((_b) + sizeof(u32) - 1) / sizeof(u32))
+#define bytes_to_quads(_b) DIV_ROUND_UP(_b, sizeof(u32))
 
 static void free_keyval(struct csr1212_keyval *kv)
 {
index b166b3575fa6d8904126e8a61ccaf604d5b9739f..20128692b3398be1c3a8556e78b593718894bdc1 100644 (file)
@@ -1361,7 +1361,7 @@ static unsigned int ether1394_encapsulate_prep(unsigned int max_payload,
                hdr->ff.dgl = dgl;
                adj_max_payload = max_payload - hdr_type_len[ETH1394_HDR_LF_FF];
        }
-       return (dg_size + adj_max_payload - 1) / adj_max_payload;
+       return DIV_ROUND_UP(dg_size, adj_max_payload);
 }
 
 static unsigned int ether1394_encapsulate(struct sk_buff *skb,