Jaehee Park <jhpark1013@xxxxxxxxx> 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 <jhpark1013@xxxxxxxxx> [...] > +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. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches