From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jaehee Park <jhpark1013@gmail.com>
Cc: "Jérôme Pouiller" <jerome.pouiller@silabs.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
outreachy@lists.linux.dev, "Stefano Brivio" <sbrivio@redhat.com>
Subject: Re: [PATCH v2] staging: wfx: use container_of() to get vif
Date: Fri, 8 Apr 2022 06:45:52 +0200 [thread overview]
Message-ID: <Yk++AMDTu7LCbjHu@kroah.com> (raw)
In-Reply-To: <20220408032349.GA2132476@jaehee-ThinkPad-X1-Extreme>
On Thu, Apr 07, 2022 at 11:23:49PM -0400, Jaehee Park wrote:
> Use container_of() to get vif. This improves the code in two ways:
> [1] it speeds up the compilation because container_of() saves steps to
> retrieve vif (the representation of ieee80211_vif), and
> [2] it eliminates the need to define multiple pointers. Previously,
> after setting the pointer to drv_priv, another pointer had to be
> defined by vif in struct wfx_vif to point back to ieee80211_vif.
> Remove vif from the struct wfx_vif, define a macro wvif_to_vif(ptr)
> for container_of(), and replace all wvif->vif with the newly defined
> container_of() construct.
>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> ---
> Note:
> This is a revised patch to sequence the wfx.h file (with the new defines) to show up first on the diff, which makes the ordering of the diff more logical.
>
> Questions:
> - These changes had built without errors for me but it would be great if someone can test it on the actual hardware.
> - We noticed that the development of the wfx driver is happening in the netdev tree instead of Greg's tree. Do you suggest that I use the net-next tree for this change?
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/log/drivers/staging/wfx
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/log/drivers/staging/wfx
>
> drivers/staging/wfx/wfx.h | 3 ++-
> drivers/staging/wfx/data_rx.c | 4 ++--
> drivers/staging/wfx/data_tx.c | 2 +-
> drivers/staging/wfx/key.c | 3 +--
> drivers/staging/wfx/queue.c | 2 +-
> drivers/staging/wfx/scan.c | 6 ++---
> drivers/staging/wfx/sta.c | 45 ++++++++++++++++-------------------
> 7 files changed, 31 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
> index 6594cc647c2f..78f2a416fe4f 100644
> --- a/drivers/staging/wfx/wfx.h
> +++ b/drivers/staging/wfx/wfx.h
> @@ -25,6 +25,8 @@
> #define USEC_PER_TXOP 32 /* see struct ieee80211_tx_queue_params */
> #define USEC_PER_TU 1024
>
> +#define wvif_to_vif(ptr)(container_of((void *)ptr, struct ieee80211_vif, drv_priv))
Always use whitespace properly.
> struct wfx_hwbus_ops;
>
> struct wfx_dev {
> @@ -61,7 +63,6 @@ struct wfx_dev {
>
> struct wfx_vif {
> struct wfx_dev *wdev;
> - struct ieee80211_vif *vif;
You need to test this on real hardware. For an outreachy-first-task,
this is not a good one at all.
Also this code is no longer in drivers/staging/ Please work on the
netdev mailing list as I can not take these changes anymore.
good luck!
greg k-h
next prev parent reply other threads:[~2022-04-08 4:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 3:23 [PATCH v2] staging: wfx: use container_of() to get vif Jaehee Park
2022-04-08 4:45 ` Greg Kroah-Hartman [this message]
2022-04-08 5:44 ` Stefano Brivio
2022-04-09 14:07 ` Jérôme Pouiller
2022-04-12 4:18 ` Jaehee Park
2022-04-08 5:43 ` Stefano Brivio
2022-04-08 22:07 ` Jaehee Park
2022-04-08 6:19 ` Dan Carpenter
2022-04-12 3:57 ` Jaehee Park
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=Yk++AMDTu7LCbjHu@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jerome.pouiller@silabs.com \
--cc=jhpark1013@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
--cc=sbrivio@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;
as well as URLs for NNTP newsgroup(s).