All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehee Park <jhpark1013@gmail.com>
To: "Jérôme Pouiller" <jerome.pouiller@silabs.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	outreachy@lists.linux.dev, Stefano Brivio <sbrivio@redhat.com>
Subject: Re: [PATCH V3] wfx: use container_of() to get vif
Date: Mon, 18 Apr 2022 00:56:10 -0400	[thread overview]
Message-ID: <20220418045610.GB1127014@jaehee-ThinkPad-X1-Extreme> (raw)
In-Reply-To: <2778504.mvXUDI8C0e@pc-42>

On Wed, Apr 13, 2022 at 09:26:45AM +0200, Jérôme Pouiller wrote:
> Hello Jaehee,
> 
> On Tuesday 12 April 2022 06:12:18 CEST Jaehee Park wrote:
> > 
> > Currently, upon virtual interface creation, wfx_add_interface() stores
> > a reference to the corresponding struct ieee80211_vif in private data,
> > for later usage. This is not needed when using the container_of
> > construct. This construct already has all the info it needs to retrieve
> > the reference to the corresponding struct from the offset that is
> > already available, inherent in container_of(), between its type and
> > member inputs (struct ieee80211_vif and drv_priv, respectively).
> > Remove vif (which was previously storing the reference to the struct
> > ieee80211_vif) from the struct wfx_vif, define a macro
> > wvif_to_vif(wvif) for container_of(), and replace all wvif->vif with
> > the newly defined container_of construct.
> > 
> > Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> > ---
> > 
> > Changes in v3:
> > - Made edits to the commit message.
> > - Shortened the macro name from wvif_to_vif to to_vif.
> 
> hmm... wvif_to_vif() was fine for me (while to_vif() is a bit too
> generic).
> 
> > - For functions that had more than one instance of vif, defined one
> > reference vif at the beginning of the function and used that instead.
> 
> I suggest to declare a new variable even if there is only one instance
> of vif. So:
>   - the code is unified
>   - it avoids the syntax foo(var)->bar
> 
> > - Broke the if-statements that ran long into two lines.
> > (There are 3 lines that exceed 80 by less than 4 characters. Two of
> > those lines of code could be shorted but it involved defining two more
> > variables, and could potentially make the code less readable.)
> > 
> > Note: I will mail this patch to the wireless-next tree after testing.
> > 
> > 
> >  drivers/staging/wfx/wfx.h     |  2 +-
> >  drivers/staging/wfx/data_rx.c |  5 ++--
> >  drivers/staging/wfx/data_tx.c |  2 +-
> >  drivers/staging/wfx/key.c     |  2 +-
> >  drivers/staging/wfx/queue.c   |  2 +-
> >  drivers/staging/wfx/scan.c    | 10 +++++---
> >  drivers/staging/wfx/sta.c     | 46 +++++++++++++++++++----------------
> >  7 files changed, 38 insertions(+), 31 deletions(-)
> > 
> > diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
> > index 78f2a416fe4f..a07baadc5e70 100644
> > --- a/drivers/staging/wfx/wfx.h
> > +++ b/drivers/staging/wfx/wfx.h
> > @@ -25,7 +25,7 @@
> >  #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))
> > +#define to_vif(wvif)container_of((void *)wvif, struct ieee80211_vif, drv_priv)
> 
> It seems you have stacked up this v3 on your v2. So this v3 does not apply
> on any public tree. You have to merge your v2 and your v3.
> 
> > 
> >  struct wfx_hwbus_ops;
> > 
> > diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
> > index 98c2223089b8..3677b3431467 100644
> > --- a/drivers/staging/wfx/data_rx.c
> > +++ b/drivers/staging/wfx/data_rx.c
> 
> The wfx driver has moved, you have to rebase your work.
> 
> [...]
> 
> -- 
> Jérôme Pouiller
> 
> 
>

Hi Jérôme, Sorry about the delay! I have sent a revised patch to the
wireless-next mailing list for your review.
Thanks,
Jaehee

      reply	other threads:[~2022-04-18  4:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  4:12 [PATCH V3] wfx: use container_of() to get vif Jaehee Park
2022-04-12  4:59 ` Greg Kroah-Hartman
2022-04-12  7:34 ` Dan Carpenter
2022-04-13  7:26 ` Jérôme Pouiller
2022-04-18  4:56   ` Jaehee Park [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=20220418045610.GB1127014@jaehee-ThinkPad-X1-Extreme \
    --to=jhpark1013@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jerome.pouiller@silabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.