Skip to contentSkip to conversation

: nl80211: Eliminate reference to BUS_ID_SIZE.

PATCH In review David Miller 2 participants 4 messages May 27, 2009 – May 28, 2009

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 5/6 : nl80211: Eliminate reference to BUS_ID_SIZE.

It's going away. Just leave the constant "20" here so that behavior doesn't change.

---
 net/wireless/nl80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/nl80211.c +1 -1
index 56d729c..4b4d3c8 100644
@@ -57,7 +57,7 @@ static int get_drv_dev_by_info_ifindex(struct nlattr **attrs,
 static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = {
 	[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING,
-				      .len = BUS_ID_SIZE-1 },
+				      .len = 20-1 },
 	[NL80211_ATTR_WIPHY_TXQ_PARAMS] = { .type = NLA_NESTED },
 	[NL80211_ATTR_WIPHY_FREQ] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_CHANNEL_TYPE] = { .type = NLA_U32 },
Signature · 1 line
1.6.3
#1 lore raw

Hi Dave,

Quoted 13 lines

It's going away. Just leave the constant "20" here so that behavior doesn't change.

---
 net/wireless/nl80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/nl80211.c +0 -0
index 56d729c..4b4d3c8 100644

net/wireless/nl80211.c static int get_drv_dev_by_info_ifindex(struct nlattr **attrs, · line 63

Quoted 8 lines
net/wireless/nl80211.c +1 -1
@@ -57,7 +57,7 @@ static int get_drv_dev_by_info_ifindex(struct nlattr **attrs,
 static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = {
 	[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING,
-				      .len = BUS_ID_SIZE-1 },
+				      .len = 20-1 },
 	[NL80211_ATTR_WIPHY_TXQ_PARAMS] = { .type = NLA_NESTED },
 	[NL80211_ATTR_WIPHY_FREQ] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_CHANNEL_TYPE] = { .type = NLA_U32 },

this patch is actually wrong. You should remove the .len value all together since the phy name has no limit anymore and so shouldn't the netlink API.

Please remember to CC Johannes or John on these changes.

Regards

Marcel

author maintainer
#2 lore raw

From: Marcel Holtmann <[email protected]>
Date: Thu, 28 May 2009 09:27:23 +0200

Quoted 11 lines

net/wireless/nl80211.c static int get_drv_dev_by_info_ifindex(struct nlattr **attrs, · line 63

Quoted 9 lines
net/wireless/nl80211.c +1 -1
@@ -57,7 +57,7 @@ static int get_drv_dev_by_info_ifindex(struct nlattr **attrs,
 static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = {
 	[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING,
-				      .len = BUS_ID_SIZE-1 },
+				      .len = 20-1 },
 	[NL80211_ATTR_WIPHY_TXQ_PARAMS] = { .type = NLA_NESTED },
 	[NL80211_ATTR_WIPHY_FREQ] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_CHANNEL_TYPE] = { .type = NLA_U32 },

this patch is actually wrong.

It cannot be right or wrong, it is merely replacing an existing value with the constant equivalent. It is a change which does absolutely nothing.

Quoted 2 lines

You should remove the .len value all together since the phy name has no limit anymore and so shouldn't the netlink API.

Anyone is free to make that improvement. But that's now what I am trying to accomplish here.

#3 lore raw

Hi Dave,

Quoted 12 lines
Quoted 11 lines

net/wireless/nl80211.c static int get_drv_dev_by_info_ifindex(struct nlattr **attrs, · line 63

Quoted 9 lines
net/wireless/nl80211.c +1 -1
@@ -57,7 +57,7 @@ static int get_drv_dev_by_info_ifindex(struct nlattr **attrs,
 static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = {
 	[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING,
-				      .len = BUS_ID_SIZE-1 },
+				      .len = 20-1 },
 	[NL80211_ATTR_WIPHY_TXQ_PARAMS] = { .type = NLA_NESTED },
 	[NL80211_ATTR_WIPHY_FREQ] = { .type = NLA_U32 },
 	[NL80211_ATTR_WIPHY_CHANNEL_TYPE] = { .type = NLA_U32 },

this patch is actually wrong.

Quoted 3 lines

It cannot be right or wrong, it is merely replacing an existing value with the constant equivalent. It is a change which does absolutely nothing.

okay, fair enough. It was required when BUS_ID_SIZE was limited and with the removal of that, the length limitation here should be also removed.

Quoted 5 lines
Quoted 2 lines

You should remove the .len value all together since the phy name has no limit anymore and so shouldn't the netlink API.

Anyone is free to make that improvement. But that's now what I am trying to accomplish here.

That is again fair enough, but you could just go ahead and remove it ;)

Regards

Marcel