mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Ross Schmidt' <ross.schm.dev@gmail.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/8] staging: rtl8723bs: replace RND4 with round_up()
Date: Sun, 4 Oct 2020 10:01:23 +0000	[thread overview]
Message-ID: <4f67bdfee5d74096b4ea0e92524e4951@AcuMS.aculab.com> (raw)
In-Reply-To: <20201004011743.10750-1-ross.schm.dev@gmail.com>

From: Ross Schmidt
> Sent: 04 October 2020 02:18
> 
> Use round_up instead of define RND4.

RND4 was also particularly horrid!
...
> diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c
> b/drivers/staging/rtl8723bs/core/rtw_security.c
> index 7f74e1d05b3a..159d32ace2bc 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_security.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_security.c
> @@ -260,7 +260,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
>  				arcfour_encrypt(&mycontext, payload+length, crc, 4);
> 
>  				pframe += pxmitpriv->frag_len;
> -				pframe = (u8 *)RND4((SIZE_PTR)(pframe));
> +				pframe = (u8 *)round_up((SIZE_PTR)(pframe), 4);

I also suspect this is equivalent to:
				pframe == round_up(pxmitpriv->frag_len, 4);

Does make one wonder whether the skipped bytes need to be
zeroed though.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


      parent reply	other threads:[~2020-10-04 10:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04  1:17 Ross Schmidt
2020-10-04  1:17 ` [PATCH 2/8] staging: rtl8723bs: replace _RND4 " Ross Schmidt
2020-10-04  1:17 ` [PATCH 3/8] staging: rtl8723bs: replace _RND8 " Ross Schmidt
2020-10-04  1:17 ` [PATCH 4/8] staging: rtl8723bs: remove unused macros Ross Schmidt
2020-10-04  1:17 ` [PATCH 5/8] staging: rtl8723bs: replace RTW_GET_BE24 with get_unaligned_be24 Ross Schmidt
2020-10-04  1:17 ` [PATCH 6/8] staging: rtl8723bs: replace RTW_GET_LE16 with get_unaligned_le16 Ross Schmidt
2020-10-04  1:17 ` [PATCH 7/8] staging: rtl8723bs: replace RTW_GET_BE16 with get_unaligned_be16 Ross Schmidt
2020-10-04  1:17 ` [PATCH 8/8] staging: rtl8723bs: replace _cancel_timer with del_timer_sync Ross Schmidt
2020-10-04 10:01 ` David Laight [this message]

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=4f67bdfee5d74096b4ea0e92524e4951@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ross.schm.dev@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome