Staging: rtl8712: rtl871x_security: fixed a camel case variable name coding style issue
PATCH 1/1 Staging: rtl8712: rtl871x_security: fixed a camel case variable name coding style issue
Fixed a coding style issue.
--- drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------ drivers/staging/rtl8712/rtl871x_security.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8712/rtl871x_security.c +6 -6
@@ -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);
drivers/staging/rtl8712/rtl871x_security.h +3 -3
@@ -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 */ }; void seccalctkipmic(
@@ -200,11 +200,11 @@ void seccalctkipmic( u8 *header, u8 *data, u32 data_len, - u8 *Miccode, + u8 *miccode, u8 priority);void r8712_secmicsetkey (struct mic_data *pmicdata,u8 *key); -void r8712_secmicappend (struct mic_data *pmicdata,u8 *src,u32 nBytes); +void r8712_secmicappend (struct mic_data *pmicdata,u8 *src,u32 nbytes);void r8712_secgetmic (struct mic_data *pmicdata,u8 *dst);u32 r8712_aes_encrypt (struct _adapter *padapter,u8 *pxmitframe);u32 r8712_tkip_encrypt (struct _adapter *padapter,u8 *pxmitframe);
Signature · 1 line
2.20.1
Quoted 58 lines · Zoeb Mithaiwala
Fixed a coding style issue.
Signed-off-by Zoeb Mithaiwala <[email protected]>--- drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------ drivers/staging/rtl8712/rtl871x_security.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)drivers/staging/rtl8712/rtl871x_security.c +6
-6@@ -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);drivers/staging/rtl8712/rtl871x_security.h +0
-0
drivers/staging/rtl8712/rtl871x_security.h struct mic_data { · line 195
Quoted 5 lines
drivers/staging/rtl8712/rtl871x_security.h +1
-1@@ -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"?
drivers/staging/rtl8712/rtl871x_security.h void seccalctkipmic( · line 203
Quoted 9 lines
drivers/staging/rtl8712/rtl871x_security.h +1
-1}; 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
PATCH 2/2 Staging: rtl8712: rtl871x_security: fixed a camel case variable name coding style issue
Changed additional 'n' from variable name. Corrected comment indentation.
--- drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------ drivers/staging/rtl8712/rtl871x_security.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8712/rtl871x_security.c +6 -6
@@ -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->nbytes_in_m =0 ; + pmicdata->bytes_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->n_bytes_in_m); - pmicdata->nbytes_in_m++; + pmicdata->M |= ((u32 )b) << (8 * pmicdata->bytes_in_m); + pmicdata->bytes_in_m++;/* Process the word if it is full. */ -if (pmicdata->nbytes_in_m >=4 ) { +if (pmicdata->bytes_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->nbytes_in_m =0 ; + pmicdata->bytes_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->nbytes_in_m !=0 ) +while (pmicdata->bytes_in_m !=0 )secmicappendbyte (pmicdata,0 );/* The appendByte function has already computed the result. */ secmicputuint32 (dst, pmicdata->L);
drivers/staging/rtl8712/rtl871x_security.h +3 -3
@@ -192,7 +192,7 @@ struct mic_data {u32 K0 ,K1 ;/* Key */ u32 L ,R ;/* Current state */ u32 M ;/* Message accumulator (single word) */ -u32 nbytes_in_m;/* # bytes in M */ +u32 bytes_in_m;/* # bytes in M */ }; void seccalctkipmic(
@@ -200,11 +200,11 @@ void seccalctkipmic( u8 *header, u8 *data, u32 data_len, - u8 *miccode, + u8 *Miccode, u8 priority);void r8712_secmicsetkey (struct mic_data *pmicdata,u8 *key); -void r8712_secmicappend (struct mic_data *pmicdata,u8 *src,u32 nbytes); +void r8712_secmicappend (struct mic_data *pmicdata,u8 *src,u32 nBytes);void r8712_secgetmic (struct mic_data *pmicdata,u8 *dst);u32 r8712_aes_encrypt (struct _adapter *padapter,u8 *pxmitframe);u32 r8712_tkip_encrypt (struct _adapter *padapter,u8 *pxmitframe);
Signature · 1 line
2.20.1
Quoted 2 lines · Zoeb Mithaiwala
Changed additional 'n' from variable name. Corrected comment indentation.
This is not how you're supposed to send a v2 patch.
https://kernelnewbies.org/FirstKernelPatch See the section on "Revising your patches".
drivers/staging/rtl8712/rtl871x_security.h void seccalctkipmic( · line 205
Quoted 8 lines
drivers/staging/rtl8712/rtl871x_security.h +1
-1@@ -200,11 +200,11 @@ void seccalctkipmic( u8 *header, u8 *data, u32 data_len, - u8 *miccode, + u8 *Miccode, u8 priority);
Take a look at the naming in the .c file where the function is implemented and use the same name in the .h file where it's declared.
regards,
dan carpenter
PATCH v3 3/3 Staging: rtl8712: Fixes a camel case variable name style issue
Changes the names of variables in rtl871x_security from camel case to snake case to match coding style.
---
Changes in v3:
- Fixes commit messages for patch.
- Uses the same variable names in header file as implementation files.
Changes in v2:
- Changes the variable name from nBytesInM to bytes_in_m.
- Removes changes to other variables in the file.
--- drivers/staging/rtl8712/rtl871x_security.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/rtl871x_security.h +2 -2
@@ -200,11 +200,11 @@ void seccalctkipmic( u8 *header, u8 *data, u32 data_len, - u8 *Miccode, + u8 *mic_code, u8 priority);void r8712_secmicsetkey (struct mic_data *pmicdata,u8 *key); -void r8712_secmicappend (struct mic_data *pmicdata,u8 *src,u32 nBytes); +void r8712_secmicappend (struct mic_data *pmicdata,u8 *src,u32 nbytes);void r8712_secgetmic (struct mic_data *pmicdata,u8 *dst);u32 r8712_aes_encrypt (struct _adapter *padapter,u8 *pxmitframe);u32 r8712_tkip_encrypt (struct _adapter *padapter,u8 *pxmitframe);
Signature · 1 line
2.20.1
Re: [PATCH v3 3/3] Staging: rtl8712: Fixes a camel case variable name style issue
Quoted 11 lines · Zoeb Mithaiwala
Changes the names of variables in
rtl871x_securityfrom camel case to snake case to match coding style.Signed-off-by Zoeb Mithaiwala <[email protected]>---
Changes in v3:
- Fixes commit messages for patch.
- Uses the same variable names in header file as implementation files.
Changes in v2:
- Changes the variable name from nBytesInM tobytes_in_m.
- Removes changes to other variables in the file.
Where are patches 1/3 and 2/3 of this series?
And this looks like it does not apply to any tree at all, are you sure you made it against the correct kernel branch? If so, what one?
thanks,
greg k-h
Re: [PATCH v3 3/3] Staging: rtl8712: Fixes a camel case variable name style issue
Quoted 1 line
Where are patches 1/3 and 2/3 of this series?
Apologies, I was unaware that the preferred method is a single email containing all the patches instead of a reply on the thread with only a single latest patch.
Quoted 1 line
And this looks like it does not apply to any tree at all, are you sure
you made it against the correct kernel branch? If so, what one? This was against torvalds/linux, but I just saw that
https://kernelnewbies.org/FirstKernelPatch suggests using gregkh/staging, I will clone and make further changes on that.
Thanks,
Zoeb
Re: [PATCH v3 3/3] Staging: rtl8712: Fixes a camel case variable name style issue
Quoted 4 lines · Zoeb Mithaiwala
Quoted 1 line
Where are patches 1/3 and 2/3 of this series?
Apologies, I was unaware that the preferred method is a single email containing all the patches instead of a reply on the thread with only a single latest patch.
No one could work with a reply thread like that, right? Would you want to review patches sent that way? :)
Quoted 5 lines
Quoted 1 line
And this looks like it does not apply to any tree at all, are you sure
you made it against the correct kernel branch? If so, what one? This was against torvalds/linux, but I just saw that
https://kernelnewbies.org/FirstKernelPatch suggests using gregkh/staging, I will clone and make further changes on that.
Wonderful, good luck!
greg k-h
Greg KH
maintainerQuoted 7 lines · Zoeb Mithaiwala
Changed additional 'n' from variable name. Corrected comment indentation.
Signed-off-by Zoeb Mithaiwala <[email protected]>--- drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------ drivers/staging/rtl8712/rtl871x_security.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)
Where is patch 1/2 of this series? I only received patch 2/2
thanks,
greg k-h
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Zoeb,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/0day-ci/linux/commits/Zoeb-Mithaiwala/Staging-rtl8712-rtl871x_security-fixed-a-camel-case-variable-name-coding-style-issue/20211120-160918 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 1189d2fb15a4b09b2e8dd01d60a0817d985d933d config: x86_64-randconfig-a015-20211121 (attached as .config)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8c1ab61206da180488d1d32547a73288052736cd
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zoeb-Mithaiwala/Staging-rtl8712-rtl871x_security-fixed-a-camel-case-variable-name-coding-style-issue/20211120-160918 git checkout 8c1ab61206da180488d1d32547a73288052736cd
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> drivers/staging/rtl8712/rtl871x_security.c:288:44: error: no member named 'n_bytes_in_m' in 'struct mic_data'; did you mean 'nbytes_in_m'?
pmicdata->M |= ((u32)b) << (8 * pmicdata->n_bytes_in_m);
^~~~~~~~~~~~
nbytes_in_m drivers/staging/rtl8712/rtl871x_security.h:195:7: note: 'nbytes_in_m' declared here
u32 nbytes_in_m; /* # bytes in M */
^
1 error generated.
vim +288 drivers/staging/rtl8712/rtl871x_security.c
284
285 static void secmicappendbyte(struct mic_data *pmicdata, u8 b)
286 {
287 /* Append the byte to our word-sized buffer */
> 288 pmicdata->M |= ((u32)b) << (8 * pmicdata->n_bytes_in_m);
289 pmicdata->nbytes_in_m++;
290 /* Process the word if it is full. */
291 if (pmicdata->nbytes_in_m >= 4) {
292 pmicdata->L ^= pmicdata->M;
293 pmicdata->R ^= ROL32(pmicdata->L, 17);
294 pmicdata->L += pmicdata->R;
295 pmicdata->R ^= ((pmicdata->L & 0xff00ff00) >> 8) |
296 ((pmicdata->L & 0x00ff00ff) << 8);
297 pmicdata->L += pmicdata->R;
298 pmicdata->R ^= ROL32(pmicdata->L, 3);
299 pmicdata->L += pmicdata->R;
300 pmicdata->R ^= ROR32(pmicdata->L, 2);
301 pmicdata->L += pmicdata->R;
302 /* Clear the buffer */
303 pmicdata->M = 0;
304 pmicdata->nbytes_in_m = 0;
305 }
306 }
307
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Zoeb,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/0day-ci/linux/commits/Zoeb-Mithaiwala/Staging-rtl8712-rtl871x_security-fixed-a-camel-case-variable-name-coding-style-issue/20211120-160918 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 1189d2fb15a4b09b2e8dd01d60a0817d985d933d config: m68k-randconfig-r026-20211121 (https://download.01.org/0day-ci/archive/20211126/202111261635.wXZz1PMT-lkp(a)intel.com/config) compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8c1ab61206da180488d1d32547a73288052736cd
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zoeb-Mithaiwala/Staging-rtl8712-rtl871x_security-fixed-a-camel-case-variable-name-coding-style-issue/20211120-160918 git checkout 8c1ab61206da180488d1d32547a73288052736cd
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/staging/rtl8712/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
drivers/staging/rtl8712/rtl871x_security.c: In function 'secmicappendbyte':
>> drivers/staging/rtl8712/rtl871x_security.c:288:51: error: 'struct mic_data' has no member named 'n_bytes_in_m'; did you mean 'nbytes_in_m'?
288 | pmicdata->M |= ((u32)b) << (8 * pmicdata->n_bytes_in_m);
| ^~~~~~~~~~~~
| nbytes_in_mvim +288 drivers/staging/rtl8712/rtl871x_security.c
284
285 static void secmicappendbyte(struct mic_data *pmicdata, u8 b)
286 {
287 /* Append the byte to our word-sized buffer */
> 288 pmicdata->M |= ((u32)b) << (8 * pmicdata->n_bytes_in_m);
289 pmicdata->nbytes_in_m++;
290 /* Process the word if it is full. */
291 if (pmicdata->nbytes_in_m >= 4) {
292 pmicdata->L ^= pmicdata->M;
293 pmicdata->R ^= ROL32(pmicdata->L, 17);
294 pmicdata->L += pmicdata->R;
295 pmicdata->R ^= ((pmicdata->L & 0xff00ff00) >> 8) |
296 ((pmicdata->L & 0x00ff00ff) << 8);
297 pmicdata->L += pmicdata->R;
298 pmicdata->R ^= ROL32(pmicdata->L, 3);
299 pmicdata->L += pmicdata->R;
300 pmicdata->R ^= ROR32(pmicdata->L, 2);
301 pmicdata->L += pmicdata->R;
302 /* Clear the buffer */
303 pmicdata->M = 0;
304 pmicdata->nbytes_in_m = 0;
305 }
306 }
307
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org