diff options
author | Sergio Paracuellos <sergio.paracuellos@gmail.com> | 2018-03-28 18:24:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-29 12:49:11 +0300 |
commit | 79955850b18081e58a17ecf44e03fae2d0e3628d (patch) | |
tree | 058d660ee5992047a685f0316b1b653576e7122f | |
parent | 808a05c007cdf408b6ca640bf5673538b68ddd30 (diff) | |
download | linux-79955850b18081e58a17ecf44e03fae2d0e3628d.tar.xz |
staging: ks7010: avoid camel cases in MichaelAppend function
This commit avoid camel cases in MichaelAppend function and params
renaming it to michael_append.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/ks7010/michael_mic.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c index bc92db143977..276ecd91f572 100644 --- a/drivers/staging/ks7010/michael_mic.c +++ b/drivers/staging/ks7010/michael_mic.c @@ -57,38 +57,37 @@ do { \ L += R; \ } while (0) -static -void MichaelAppend(struct michael_mic_t *Mic, uint8_t *src, int nBytes) +static void michael_append(struct michael_mic_t *mic, uint8_t *src, int bytes) { int addlen; - if (Mic->m_bytes) { - addlen = 4 - Mic->m_bytes; - if (addlen > nBytes) - addlen = nBytes; - memcpy(&Mic->m[Mic->m_bytes], src, addlen); - Mic->m_bytes += addlen; + if (mic->m_bytes) { + addlen = 4 - mic->m_bytes; + if (addlen > bytes) + addlen = bytes; + memcpy(&mic->m[mic->m_bytes], src, addlen); + mic->m_bytes += addlen; src += addlen; - nBytes -= addlen; + bytes -= addlen; - if (Mic->m_bytes < 4) + if (mic->m_bytes < 4) return; - Mic->l ^= getUInt32(Mic->m, 0); - MichaelBlockFunction(Mic->l, Mic->r); - Mic->m_bytes = 0; + mic->l ^= getUInt32(mic->m, 0); + MichaelBlockFunction(mic->l, mic->r); + mic->m_bytes = 0; } - while (nBytes >= 4) { - Mic->l ^= getUInt32(src, 0); - MichaelBlockFunction(Mic->l, Mic->r); + while (bytes >= 4) { + mic->l ^= getUInt32(src, 0); + MichaelBlockFunction(mic->l, mic->r); src += 4; - nBytes -= 4; + bytes -= 4; } - if (nBytes > 0) { - Mic->m_bytes = nBytes; - memcpy(Mic->m, src, nBytes); + if (bytes > 0) { + mic->m_bytes = bytes; + memcpy(mic->m, src, bytes); } } @@ -137,8 +136,8 @@ void michael_mic_function(struct michael_mic_t *mic, u8 *key, * +--+--+--------+--+----+--+--+--+--+--+--+--+--+ */ michael_init(mic, key); - MichaelAppend(mic, (uint8_t *)data, 12); /* |DA|SA| */ - MichaelAppend(mic, pad_data, 4); /* |Priority|0|0|0| */ - MichaelAppend(mic, (uint8_t *)(data + 12), len - 12); /* |Data| */ + michael_append(mic, (uint8_t *)data, 12); /* |DA|SA| */ + michael_append(mic, pad_data, 4); /* |Priority|0|0|0| */ + michael_append(mic, (uint8_t *)(data + 12), len - 12); /* |Data| */ MichaelGetMIC(mic, result); } |