All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: driverdev-devel@linuxdriverproject.org, wsa@the-dreams.de
Subject: [PATCH 03/12] staging: ks7010: avoid camel cases in MichaelAppend function
Date: Wed, 28 Mar 2018 17:24:19 +0200	[thread overview]
Message-ID: <1522250668-3296-4-git-send-email-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <1522250668-3296-1-git-send-email-sergio.paracuellos@gmail.com>

This commit avoid camel cases in MichaelAppend function and params
renaming it to michael_append.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/michael_mic.c | 45 ++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c
index bc92db1..276ecd9 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);
 }
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-03-28 15:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 15:24 [PATCH 00/12] staging: ks7010: Some clean ups Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 01/12] staging: ks7010: avoid camel cases in MichaelMICFunction Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 02/12] staging: ks7010: avoid camel cases for MichaelInitFunction Sergio Paracuellos
2018-03-28 15:24 ` Sergio Paracuellos [this message]
2018-03-28 15:24 ` [PATCH 04/12] staging: ks7010: replace macro MichaelClear with inline function Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 05/12] staging: ks7010: avoid camel cases in MichaelGetMIC function Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 06/12] staging: ks7010: replace PutUInt32 macro with put_unaligned_le32() Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 07/12] staging: ks7010: replace GetUInt32 macro with get_unaligned_le32 Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 08/12] staging: ks7010: replace MichaelBlockFunction macro with inline function Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 09/12] staging: ks7010: remove some dead code from ks_wlan_set_essid function Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 10/12] staging: ks7010: replace uint8_t in favour of u8 in michael_init Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 11/12] staging: ks7010: replace uint8_t in favour of u8 in michael_append Sergio Paracuellos
2018-03-28 15:24 ` [PATCH 12/12] staging: ks7010: replace uint8_t in favour of u8 in michael_get_mic Sergio Paracuellos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522250668-3296-4-git-send-email-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.