lkml.org 
[lkml]   [2022]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/5] staging: r8188eu: use round_up() instead of RND4()
From
On 4/6/22 11:54, Joe Perches wrote:
> On Wed, 2022-04-06 at 08:18 +0200, Michael Straube wrote:
>> Use in-kernel round_up() instead of custom RND4().
> []
>> diff --git a/drivers/staging/r8188eu/core/rtw_security.c b/drivers/staging/r8188eu/core/rtw_security.c
> []
>> @@ -63,7 +63,7 @@ void rtw_wep_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe)
>> arc4_crypt(ctx, payload + length, crc.f1, 4);
>>
>> pframe += pxmitpriv->frag_len;
>> - pframe = (u8 *)RND4((size_t)(pframe));
>> + pframe = (u8 *)round_up((size_t)pframe, 4);
>
> Perhaps use PTR_ALIGN
>
> pframe = PTR_ALIGN(pframe, 4);
>
> etc...

Sounds reasonable, I'll send v2 soon.

Thanks,
Michael

\
 
 \ /
  Last update: 2022-04-06 18:52    [W:0.053 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site