linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Remove unused VHT chan code
@ 2012-11-29  8:41 Mahesh Palivela
  2012-11-29  8:52 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Mahesh Palivela @ 2012-11-29  8:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

From: Mahesh Palivela <maheshp@posedge.com>

Cleanup of unused VHT channel config related code.

Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
---
  net/wireless/nl80211.c |   28 +---------------------------
  1 files changed, 1 insertions(+), 27 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7cce43b..0e7e8d5 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1371,9 +1371,7 @@ static int nl80211_parse_chandef(struct 
cfg80211_registered_device *rdev,
  				 struct genl_info *info,
  				 struct cfg80211_chan_def *chandef)
  {
-	struct ieee80211_sta_ht_cap *ht_cap;
-	struct ieee80211_sta_vht_cap *vht_cap;
-	u32 control_freq, width;
+	u32 control_freq;

  	if (!info->attrs[NL80211_ATTR_WIPHY_FREQ])
  		return -EINVAL;
@@ -1419,33 +1417,9 @@ static int nl80211_parse_chandef(struct 
cfg80211_registered_device *rdev,
  					info->attrs[NL80211_ATTR_CENTER_FREQ2]);
  	}

-	ht_cap = &rdev->wiphy.bands[chandef->chan->band]->ht_cap;
-	vht_cap = &rdev->wiphy.bands[chandef->chan->band]->vht_cap;
-
  	if (!cfg80211_chandef_valid(chandef))
  		return -EINVAL;

-	switch (chandef->width) {
-	case NL80211_CHAN_WIDTH_20:
-	case NL80211_CHAN_WIDTH_20_NOHT:
-		width = 20;
-		break;
-	case NL80211_CHAN_WIDTH_40:
-		width = 40;
-		break;
-	case NL80211_CHAN_WIDTH_80:
-		width = 80;
-		break;
-	case NL80211_CHAN_WIDTH_80P80:
-		width = 80;
-		break;
-	case NL80211_CHAN_WIDTH_160:
-		width = 160;
-		break;
-	default:
-		return -EINVAL;
-	}
-
  	if (!cfg80211_chandef_usable(&rdev->wiphy, chandef,
  				     IEEE80211_CHAN_DISABLED))
  		return -EINVAL;
-- 
Thanks,
Mahesh

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfg80211: Remove unused VHT chan code
  2012-11-29  8:41 [PATCH] cfg80211: Remove unused VHT chan code Mahesh Palivela
@ 2012-11-29  8:52 ` Johannes Berg
  2012-11-29  8:58   ` Mahesh Palivela
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2012-11-29  8:52 UTC (permalink / raw)
  To: Mahesh Palivela; +Cc: linux-wireless@vger.kernel.org

On Thu, 2012-11-29 at 14:11 +0530, Mahesh Palivela wrote:
> From: Mahesh Palivela <maheshp@posedge.com>
> 
> Cleanup of unused VHT channel config related code.

Huh, good catch, thanks. Applied.

johannes


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfg80211: Remove unused VHT chan code
  2012-11-29  8:52 ` Johannes Berg
@ 2012-11-29  8:58   ` Mahesh Palivela
  2012-11-29  9:05     ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Mahesh Palivela @ 2012-11-29  8:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

On 11/29/2012 02:22 PM, Johannes Berg wrote:
> On Thu, 2012-11-29 at 14:11 +0530, Mahesh Palivela wrote:
>> From: Mahesh Palivela <maheshp@posedge.com>
>>
>> Cleanup of unused VHT channel config related code.
>
> Huh, good catch, thanks. Applied.

Thanks. Even below also can be removed as cfg80211_chandef_usable() 
checks this at the beginning.

        if (!cfg80211_chandef_valid(chandef))
                return -EINVAL;

>
> johannes
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfg80211: Remove unused VHT chan code
  2012-11-29  8:58   ` Mahesh Palivela
@ 2012-11-29  9:05     ` Johannes Berg
  2012-11-29  9:06       ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2012-11-29  9:05 UTC (permalink / raw)
  To: Mahesh Palivela; +Cc: linux-wireless@vger.kernel.org

On Thu, 2012-11-29 at 14:28 +0530, Mahesh Palivela wrote:
> On 11/29/2012 02:22 PM, Johannes Berg wrote:
> > On Thu, 2012-11-29 at 14:11 +0530, Mahesh Palivela wrote:
> >> From: Mahesh Palivela <maheshp@posedge.com>
> >>
> >> Cleanup of unused VHT channel config related code.
> >
> > Huh, good catch, thanks. Applied.
> 
> Thanks. Even below also can be removed as cfg80211_chandef_usable() 
> checks this at the beginning.
> 
>         if (!cfg80211_chandef_valid(chandef))
>                 return -EINVAL;

Hmm good point I'll roll that in.

johannes


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfg80211: Remove unused VHT chan code
  2012-11-29  9:05     ` Johannes Berg
@ 2012-11-29  9:06       ` Johannes Berg
  2012-11-29 11:58         ` Mahesh Palivela
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2012-11-29  9:06 UTC (permalink / raw)
  To: Mahesh Palivela; +Cc: linux-wireless@vger.kernel.org

On Thu, 2012-11-29 at 10:05 +0100, Johannes Berg wrote:
> On Thu, 2012-11-29 at 14:28 +0530, Mahesh Palivela wrote:
> > On 11/29/2012 02:22 PM, Johannes Berg wrote:
> > > On Thu, 2012-11-29 at 14:11 +0530, Mahesh Palivela wrote:
> > >> From: Mahesh Palivela <maheshp@posedge.com>
> > >>
> > >> Cleanup of unused VHT channel config related code.
> > >
> > > Huh, good catch, thanks. Applied.
> > 
> > Thanks. Even below also can be removed as cfg80211_chandef_usable() 
> > checks this at the beginning.
> > 
> >         if (!cfg80211_chandef_valid(chandef))
> >                 return -EINVAL;
> 
> Hmm good point I'll roll that in.

No actually it can't, cfg80211_chandef_usable() triggers a warning which
we can't do if userspace just sends invalid information; however it's
doing that for all other in-kernel users intentionally.

johannes


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cfg80211: Remove unused VHT chan code
  2012-11-29  9:06       ` Johannes Berg
@ 2012-11-29 11:58         ` Mahesh Palivela
  0 siblings, 0 replies; 6+ messages in thread
From: Mahesh Palivela @ 2012-11-29 11:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

On 11/29/2012 2:36 PM, Johannes Berg wrote:
> On Thu, 2012-11-29 at 10:05 +0100, Johannes Berg wrote:
>> On Thu, 2012-11-29 at 14:28 +0530, Mahesh Palivela wrote:
>>> On 11/29/2012 02:22 PM, Johannes Berg wrote:
>>>> On Thu, 2012-11-29 at 14:11 +0530, Mahesh Palivela wrote:
>>>>> From: Mahesh Palivela <maheshp@posedge.com>
>>>>>
>>>>> Cleanup of unused VHT channel config related code.
>>>>
>>>> Huh, good catch, thanks. Applied.
>>>
>>> Thanks. Even below also can be removed as cfg80211_chandef_usable()
>>> checks this at the beginning.
>>>
>>>          if (!cfg80211_chandef_valid(chandef))
>>>                  return -EINVAL;
>>
>> Hmm good point I'll roll that in.
>
> No actually it can't, cfg80211_chandef_usable() triggers a warning which
> we can't do if userspace just sends invalid information; however it's
> doing that for all other in-kernel users intentionally.

ok. So in case of nl80211_parse_chandef() we will be calling 
cfg80211_chandef_valid() twice.
No problem.

>
> johannes
>

-- 
Thanks,
Mahesh

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-29 11:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29  8:41 [PATCH] cfg80211: Remove unused VHT chan code Mahesh Palivela
2012-11-29  8:52 ` Johannes Berg
2012-11-29  8:58   ` Mahesh Palivela
2012-11-29  9:05     ` Johannes Berg
2012-11-29  9:06       ` Johannes Berg
2012-11-29 11:58         ` Mahesh Palivela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).