Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600263

Re: [PATCH] rtl8188eu: Correcting macro ROUND macro defination

From Pushkar Jambhlekar <pushkar.iit@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] rtl8188eu: Correcting macro ROUND macro defination
Date 2017-03-14 12:50 +0100
Message-ID <tkT7H-7Za-9@gated-at.bofh.it> (permalink)
References <tkSOl-7QC-15@gated-at.bofh.it> <tkSY3-7U6-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Alexander,

It is not needed for a macro. I am modifying do---while() loop for ROUND macro.

/**
 * Expand the cipher key into the encryption key schedule.
 *
 * @return      the number of rounds for the given cipher key size.
 */
#define ROUND(i, d, s) \
do {                                                                    \
        d##0 = TE0(s##0) ^ TE1(s##1) ^ TE2(s##2) ^ TE3(s##3) ^ rk[4 * i]; \
        d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \
        d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \
        d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]; \
} while (0)

On Tue, Mar 14, 2017 at 5:02 PM, Alexander Kapshuk
<alexander.kapshuk@gmail.com> wrote:
> On Tue, Mar 14, 2017 at 1:26 PM, Pushkar Jambhlekar
> <pushkar.iit@gmail.com> wrote:
>> Description:
>>     There should not be ';' after do ... while(0) in macro defination
>>
>> Signed-off-by: Pushkar Jambhlekar <pushkar.iit@gmail.com>
>> ---
>>  drivers/staging/rtl8188eu/core/rtw_security.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c
>> index b283a490..5b1ef22 100644
>> --- a/drivers/staging/rtl8188eu/core/rtw_security.c
>> +++ b/drivers/staging/rtl8188eu/core/rtw_security.c
>> @@ -1690,4 +1690,4 @@ do {                                                                      \
>>         d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \
>>         d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \
>>         d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]; \
>> -} while (0);
>> +} while (0)
>> --
>> 2.7.4
>>
>
> A semicolon is required after 'while(bool);' in 'do..while'.
> Without it, you get a compile time error.



-- 
Jambhlekar Pushkar Arun
M.Tech IIT Roorkee

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] rtl8188eu: Correcting macro ROUND macro defination Pushkar Jambhlekar <pushkar.iit@gmail.com> - 2017-03-14 12:30 +0100
  Re: [PATCH] rtl8188eu: Correcting macro ROUND macro defination Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2017-03-14 12:40 +0100
    Re: [PATCH] rtl8188eu: Correcting macro ROUND macro defination Pushkar Jambhlekar <pushkar.iit@gmail.com> - 2017-03-14 12:50 +0100
      Re: [PATCH] rtl8188eu: Correcting macro ROUND macro defination Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2017-03-14 13:00 +0100
        Re: [PATCH] rtl8188eu: Correcting macro ROUND macro defination Pushkar Jambhlekar <pushkar.iit@gmail.com> - 2017-03-14 13:20 +0100
  Re: [PATCH] rtl8188eu: Correcting macro ROUND macro defination Dan Carpenter <dan.carpenter@oracle.com> - 2017-03-14 13:20 +0100

csiph-web