lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 Apr 2022 14:57:57 +0300
From:   Kalle Valo <>
To:     Jaehee Park <>
Cc:     Jérôme Pouiller <>,
        "David S. Miller" <>,
        Jakub Kicinski <>,
        Paolo Abeni <>,,,,,, Stefano Brivio <>
Subject: Re: [PATCH] wfx: use container_of() to get vif

Jaehee Park <> writes:

> 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 function
> wvif_to_vif(wvif) for container_of(), and replace all wvif->vif with
> the newly defined container_of construct.
> Signed-off-by: Jaehee Park <>


> +static inline struct ieee80211_vif *wvif_to_vif(struct wfx_vif *wvif)
> +{
> +	return container_of((void *)wvif, struct ieee80211_vif, drv_priv);
> +}

Why the void pointer cast? Avoid casts as much possible.


Powered by blists - more mailing lists