diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2007-08-28 18:50:33 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:48:37 -0400 |
commit | 172589ccdde41b59861c92c4a971b95514ef24e3 (patch) | |
tree | ae775e6db4cb85aad1c74b6d93ba359f9dfe88ea /net/ieee80211 | |
parent | c45248c70125cc374fdf264659643276c72801bf (diff) |
[NET]: DIV_ROUND_UP cleanup (part two)
Hopefully captured all single statement cases under net/. I'm
not too sure if there is some policy about #includes that are
"guaranteed" (ie., in the current tree) to be available through
some other #included header, so I just added linux/kernel.h to
each changed file that didn't #include it previously.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/ieee80211_crypt_ccmp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c index b016b4104de6..2e6b099fc84c 100644 --- a/net/ieee80211/ieee80211_crypt_ccmp.c +++ b/net/ieee80211/ieee80211_crypt_ccmp.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * more details. | 9 | * more details. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/kernel.h> | ||
12 | #include <linux/err.h> | 13 | #include <linux/err.h> |
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
@@ -241,7 +242,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
241 | hdr = (struct ieee80211_hdr_4addr *)skb->data; | 242 | hdr = (struct ieee80211_hdr_4addr *)skb->data; |
242 | ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); | 243 | ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); |
243 | 244 | ||
244 | blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; | 245 | blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
245 | last = data_len % AES_BLOCK_LEN; | 246 | last = data_len % AES_BLOCK_LEN; |
246 | 247 | ||
247 | for (i = 1; i <= blocks; i++) { | 248 | for (i = 1; i <= blocks; i++) { |
@@ -351,7 +352,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
351 | ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b); | 352 | ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b); |
352 | xor_block(mic, b, CCMP_MIC_LEN); | 353 | xor_block(mic, b, CCMP_MIC_LEN); |
353 | 354 | ||
354 | blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; | 355 | blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
355 | last = data_len % AES_BLOCK_LEN; | 356 | last = data_len % AES_BLOCK_LEN; |
356 | 357 | ||
357 | for (i = 1; i <= blocks; i++) { | 358 | for (i = 1; i <= blocks; i++) { |