From: David Laight <David.Laight@ACULAB.COM>
To: 'Michael Straube' <straube.linux@gmail.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
"phil@philpotter.co.uk" <phil@philpotter.co.uk>,
"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 3/5] staging: r8188eu: use round_up() instead of _RND8()
Date: Thu, 7 Apr 2022 08:36:46 +0000 [thread overview]
Message-ID: <b00d9bc1cbe24fe4b0f83706427b84db@AcuMS.aculab.com> (raw)
In-Reply-To: <20220406172219.15565-4-straube.linux@gmail.com>
From: Michael Straube
> Sent: 06 April 2022 18:22
>
> Use in-kernel round_up() instead of custom _RND8().
...
> diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
> b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
...
> @@ -488,7 +488,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit
>
> len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE + (pxmitframe->pkt_offset *
> PACKET_OFFSET_SZ);
>
> - if (_RND8(pbuf + len) > MAX_XMITBUF_SZ) {
> + if (round_up(pbuf + len, 8) > MAX_XMITBUF_SZ) {
It can't be necessary to round_up there.
It is equivalent to:
if (pbuf + len > (MAX_XMITBUF_SZ & ~7))
and the limit is/should be a multiple of 8.
David
> pxmitframe->agg_num = 1;
> pxmitframe->pkt_offset = 1;
> break;
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2022-04-07 8:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 17:22 [PATCH v2 0/5] staging: r8188eu: use round_up() Michael Straube
2022-04-06 17:22 ` [PATCH v2 1/5] staging: r8188eu: use PTR_ALIGN() instead of RND4() Michael Straube
2022-04-06 17:22 ` [PATCH v2 2/5] staging: r8188eu: use round_up() instead of _RND4() Michael Straube
2022-04-06 17:22 ` [PATCH v2 3/5] staging: r8188eu: use round_up() instead of _RND8() Michael Straube
2022-04-07 8:36 ` David Laight [this message]
2022-04-06 17:22 ` [PATCH v2 4/5] staging: r8188eu: use round_up() instead of _RND128() Michael Straube
2022-04-06 17:22 ` [PATCH v2 5/5] staging: r8188eu: remove unused _RND* from osdep_service.h Michael Straube
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=b00d9bc1cbe24fe4b0f83706427b84db@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@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;
as well as URLs for NNTP newsgroup(s).