Skip to content
Permalink
Browse files

Fix use of container_of macro for ISO C

Linux 4.13 improves the type checking for the container_of macro. This
trips cases for which there is a type mismatch in ISO C but works with
GNU C. Some versions of GCC still issue a warning though.

URL: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20170529&id=daa2ac80834dc6c6752f198087aeb75fcc2afb03
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
  • Loading branch information
seragh committed Jun 6, 2017
1 parent 22d08c4 commit b37f306899e5c1f5d76c2f2cb3d5b6a63c7f45ac
Showing with 10 additions and 10 deletions.
  1. +2 −2 core.c
  2. +8 −8 debugfs.c
4 core.c
@@ -549,8 +549,8 @@ static void mwl_chnl_switch_event(struct work_struct *work)

spin_lock_bh(&priv->vif_lock);
list_for_each_entry(mwl_vif, &priv->vif_list, list) {
vif = container_of((char *)mwl_vif, struct ieee80211_vif,
drv_priv[0]);
vif = container_of((void *)mwl_vif, struct ieee80211_vif,
drv_priv);

if (vif->csa_active)
ieee80211_csa_finish(vif);
@@ -210,8 +210,8 @@ static ssize_t mwl_debugfs_vif_read(struct file *file, char __user *ubuf,
len += scnprintf(p + len, size - len, "\n");
spin_lock_bh(&priv->vif_lock);
list_for_each_entry(mwl_vif, &priv->vif_list, list) {
vif = container_of((char *)mwl_vif, struct ieee80211_vif,
drv_priv[0]);
vif = container_of((void *)mwl_vif, struct ieee80211_vif,
drv_priv);
len += scnprintf(p + len, size - len,
"macid: %d\n", mwl_vif->macid);
switch (vif->type) {
@@ -281,8 +281,8 @@ static ssize_t mwl_debugfs_sta_read(struct file *file, char __user *ubuf,
len += scnprintf(p + len, size - len, "\n");
spin_lock_bh(&priv->sta_lock);
list_for_each_entry(sta_info, &priv->sta_list, list) {
sta = container_of((char *)sta_info, struct ieee80211_sta,
drv_priv[0]);
sta = container_of((void *)sta_info, struct ieee80211_sta,
drv_priv);
len += scnprintf(p + len, size - len,
"mac address: %pM\n", sta->addr);
len += scnprintf(p + len, size - len, "aid: %u\n", sta->aid);
@@ -373,9 +373,9 @@ static ssize_t mwl_debugfs_ampdu_read(struct file *file, char __user *ubuf,
list_for_each_entry(sta_info, &priv->sta_list, list) {
for (i = 0; i < MWL_MAX_TID; i++) {
if (sta_info->check_ba_failed[i]) {
sta = container_of((char *)sta_info,
sta = container_of((void *)sta_info,
struct ieee80211_sta,
drv_priv[0]);
drv_priv);
len += scnprintf(p + len, size - len,
"%pM(%d): %d\n",
sta->addr, i,
@@ -793,8 +793,8 @@ static ssize_t mwl_debugfs_ratetable_read(struct file *file, char __user *ubuf,

spin_lock_bh(&priv->sta_lock);
list_for_each_entry(sta_info, &priv->sta_list, list) {
sta = container_of((char *)sta_info, struct ieee80211_sta,
drv_priv[0]);
sta = container_of((void *)sta_info, struct ieee80211_sta,
drv_priv);
if (priv->sta_aid == sta->aid) {
ether_addr_copy(addr, sta->addr);
break;

0 comments on commit b37f306

Please sign in to comment.
You can’t perform that action at this time.