Re: [PATCH] Staging: rtl8712: rtl871x_security: fixed a camel case variable name coding style issue

From: Greg KH
Date: Sat Nov 20 2021 - 03:31:21 EST


On Sat, Nov 20, 2021 at 08:06:58AM +0000, Zoeb Mithaiwala wrote:
> Fixed a coding style issue.
>
> Signed-off-by: Zoeb Mithaiwala <zoebm@xxxxxxxxxx>
> ---
> drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------
> drivers/staging/rtl8712/rtl871x_security.h | 6 +++---
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
> index e0a1c30a8fe6..4b341074b1b2 100644
> --- a/drivers/staging/rtl8712/rtl871x_security.c
> +++ b/drivers/staging/rtl8712/rtl871x_security.c
> @@ -269,7 +269,7 @@ static void secmicclear(struct mic_data *pmicdata)
> /* Reset the state to the empty message. */
> pmicdata->L = pmicdata->K0;
> pmicdata->R = pmicdata->K1;
> - pmicdata->nBytesInM = 0;
> + pmicdata->nbytes_in_m = 0;
> pmicdata->M = 0;
> }
>
> @@ -285,10 +285,10 @@ void r8712_secmicsetkey(struct mic_data *pmicdata, u8 *key)
> static void secmicappendbyte(struct mic_data *pmicdata, u8 b)
> {
> /* Append the byte to our word-sized buffer */
> - pmicdata->M |= ((u32)b) << (8 * pmicdata->nBytesInM);
> - pmicdata->nBytesInM++;
> + pmicdata->M |= ((u32)b) << (8 * pmicdata->n_bytes_in_m);
> + pmicdata->nbytes_in_m++;
> /* Process the word if it is full. */
> - if (pmicdata->nBytesInM >= 4) {
> + if (pmicdata->nbytes_in_m >= 4) {
> pmicdata->L ^= pmicdata->M;
> pmicdata->R ^= ROL32(pmicdata->L, 17);
> pmicdata->L += pmicdata->R;
> @@ -301,7 +301,7 @@ static void secmicappendbyte(struct mic_data *pmicdata, u8 b)
> pmicdata->L += pmicdata->R;
> /* Clear the buffer */
> pmicdata->M = 0;
> - pmicdata->nBytesInM = 0;
> + pmicdata->nbytes_in_m = 0;
> }
> }
>
> @@ -323,7 +323,7 @@ void r8712_secgetmic(struct mic_data *pmicdata, u8 *dst)
> secmicappendbyte(pmicdata, 0);
> secmicappendbyte(pmicdata, 0);
> /* and then zeroes until the length is a multiple of 4 */
> - while (pmicdata->nBytesInM != 0)
> + while (pmicdata->nbytes_in_m != 0)
> secmicappendbyte(pmicdata, 0);
> /* The appendByte function has already computed the result. */
> secmicputuint32(dst, pmicdata->L);
> diff --git a/drivers/staging/rtl8712/rtl871x_security.h b/drivers/staging/rtl8712/rtl871x_security.h
> index 8461b7f05359..006ce05c798f 100644
> --- a/drivers/staging/rtl8712/rtl871x_security.h
> +++ b/drivers/staging/rtl8712/rtl871x_security.h
> @@ -192,7 +192,7 @@ struct mic_data {
> u32 K0, K1; /* Key */
> u32 L, R; /* Current state */
> u32 M; /* Message accumulator (single word) */
> - u32 nBytesInM; /* # bytes in M */
> + u32 nbytes_in_m; /* # bytes in M */

The comments are not alined anymore?

And why "n"?


> };
>
> void seccalctkipmic(
> @@ -200,11 +200,11 @@ void seccalctkipmic(
> u8 *header,
> u8 *data,
> u32 data_len,
> - u8 *Miccode,
> + u8 *miccode,

This is a different change :(

greg k-h