From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 03/12] mt76usb: change mt76u_fill_rx_sg arguments
Date: Fri, 22 Mar 2019 11:10:40 +0100 [thread overview]
Message-ID: <20190322101038.GA22889@localhost.localdomain> (raw)
In-Reply-To: <20190321152537.19105-4-sgruszka@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]
> We do not need to pass len and sglen to the function.
> Additionally pass gfp to control allocation context.
>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> drivers/net/wireless/mediatek/mt76/usb.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
> index 3f21599d52de..56e7a2ca8930 100644
> --- a/drivers/net/wireless/mediatek/mt76/usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/usb.c
> @@ -285,11 +285,13 @@ mt76u_set_endpoints(struct usb_interface *intf,
> }
>
> static int
> -mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76u_buf *buf,
> - int nsgs, int len, int sglen)
> +mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76u_buf *buf, int nsgs,
> + gfp_t gfp)
> {
> struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN];
> + int sglen = SKB_WITH_OVERHEAD(q->buf_size);
> struct urb *urb = buf->urb;
> +
please drop newline here
> int i;
>
> for (i = 0; i < nsgs; i++) {
> @@ -297,7 +299,7 @@ mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76u_buf *buf,
> void *data;
> int offset;
>
> - data = page_frag_alloc(&q->rx_page, len, GFP_ATOMIC);
> + data = page_frag_alloc(&q->rx_page, q->buf_size, gfp);
> if (!data)
> break;
>
> @@ -326,8 +328,7 @@ mt76u_refill_rx(struct mt76_dev *dev, struct mt76_queue *q,
> struct mt76u_buf *buf, int nsgs, gfp_t gfp)
> {
> if (dev->usb.sg_en) {
> - return mt76u_fill_rx_sg(dev, buf, nsgs, q->buf_size,
> - SKB_WITH_OVERHEAD(q->buf_size));
> + return mt76u_fill_rx_sg(dev, buf, nsgs, gfp);
> } else {
> buf->buf = page_frag_alloc(&q->rx_page, q->buf_size, gfp);
> return buf->buf ? 0 : -ENOMEM;
> --
> 2.20.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2019-03-22 10:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 15:25 [PATCH 00/12] mt76usb: some cleanups and optimizations Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 01/12] mt76usb: change mt76u_submit_buf Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 02/12] mt76: remove rx_page_lock Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 03/12] mt76usb: change mt76u_fill_rx_sg arguments Stanislaw Gruszka
2019-03-22 10:10 ` Lorenzo Bianconi [this message]
2019-03-22 12:45 ` Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 04/12] mt76usb: use usb_dev private data Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 05/12] mt76usb: remove mt76u_buf redundant fileds Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 06/12] mt76usb: move mt76u_buf->done to queue entry Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 07/12] mt76usb: remove mt76u_buf and use urb directly Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 08/12] mt76usb: remove MT_RXQ_MAIN queue from mt76u_urb_alloc Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 09/12] mt76usb: resue mt76u_urb_alloc for tx Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 10/12] mt76usb: remove unneded sg_init_table Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 11/12] mt76usb: allocate urb and sg as linear data Stanislaw Gruszka
2019-03-21 15:25 ` [PATCH 12/12] mt76usb: remove queue variable from rx_tasklet Stanislaw Gruszka
2019-03-22 11:02 ` [PATCH 00/12] mt76usb: some cleanups and optimizations Lorenzo Bianconi
2019-03-24 7:25 ` Felix Fietkau
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=20190322101038.GA22889@localhost.localdomain \
--to=lorenzo.bianconi@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=sgruszka@redhat.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