linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] drivers/net/wireless/libertas/wext.c: remove dead code
@ 2007-07-01 20:20 Adrian Bunk
  2007-07-02  8:53 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2007-07-01 20:20 UTC (permalink / raw)
  To: Dan Williams, John W. Linville; +Cc: linux-wireless, linux-kernel

This patch removes dead code introduced by
commit 90a42210f275e1f828eb6c08bf8252c2d6a774e0 and spotted
by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/net/wireless/libertas/wext.c |    3 ---
 1 file changed, 3 deletions(-)

--- linux-2.6.22-rc6-mm1/drivers/net/wireless/libertas/wext.c.old	2007-06-29 21:52:56.000000000 +0200
+++ linux-2.6.22-rc6-mm1/drivers/net/wireless/libertas/wext.c	2007-06-29 21:53:43.000000000 +0200
@@ -1823,85 +1823,82 @@ static int wlan_set_encodeext(struct net
 	} else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) {
 		struct WLAN_802_11_KEY * pkey;
 
 		/* validate key length */
 		if (((alg == IW_ENCODE_ALG_TKIP)
 			&& (ext->key_len != KEY_LEN_WPA_TKIP))
 		    || ((alg == IW_ENCODE_ALG_CCMP)
 		        && (ext->key_len != KEY_LEN_WPA_AES))) {
 				lbs_deb_wext("invalid size %d for key of alg"
 				       "type %d\n",
 				       ext->key_len,
 				       alg);
 				ret = -EINVAL;
 				goto out;
 		}
 
 		if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
 			pkey = &assoc_req->wpa_mcast_key;
 			set_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags);
 		} else {
 			pkey = &assoc_req->wpa_unicast_key;
 			set_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags);
 		}
 
 		memset(pkey, 0, sizeof (struct WLAN_802_11_KEY));
 		memcpy(pkey->key, ext->key, ext->key_len);
 		pkey->len = ext->key_len;
 		if (pkey->len)
 			pkey->flags |= KEY_INFO_WPA_ENABLED;
 
 		/* Do this after zeroing key structure */
 		if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
 			pkey->flags |= KEY_INFO_WPA_MCAST;
 		} else {
 			pkey->flags |= KEY_INFO_WPA_UNICAST;
 		}
 
 		if (alg == IW_ENCODE_ALG_TKIP) {
 			pkey->type = KEY_TYPE_ID_TKIP;
 		} else if (alg == IW_ENCODE_ALG_CCMP) {
 			pkey->type = KEY_TYPE_ID_AES;
-		} else {
-			ret = -EINVAL;
-			goto out;
 		}
 
 		/* If WPA isn't enabled yet, do that now */
 		if (   assoc_req->secinfo.WPAenabled == 0
 		    && assoc_req->secinfo.WPA2enabled == 0) {
 			assoc_req->secinfo.WPAenabled = 1;
 			assoc_req->secinfo.WPA2enabled = 1;
 			set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags);
 		}
 
 		disable_wep (assoc_req);
 	}
 
 out:
 	if (ret == 0) {
 		wlan_postpone_association_work(priv);
 	} else {
 		wlan_cancel_association_work(priv);
 	}
 	mutex_unlock(&adapter->lock);
 
 	lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
 	return ret;
 }
 
 
 static int wlan_set_genie(struct net_device *dev,
 			  struct iw_request_info *info,
 			  struct iw_point *dwrq,
 			  char *extra)
 {
 	wlan_private *priv = dev->priv;
 	wlan_adapter *adapter = priv->adapter;
 	int ret = 0;
 	struct assoc_request * assoc_req;
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
 	mutex_lock(&adapter->lock);
 	assoc_req = wlan_get_association_request(adapter);
 	if (!assoc_req) {


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

* Re: [2.6 patch] drivers/net/wireless/libertas/wext.c: remove dead  code
  2007-07-01 20:20 [2.6 patch] drivers/net/wireless/libertas/wext.c: remove dead code Adrian Bunk
@ 2007-07-02  8:53 ` Johannes Berg
  2007-07-02  9:07   ` Michael Buesch
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2007-07-02  8:53 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Dan Williams, John W. Linville, linux-wireless, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

On Sun, 2007-07-01 at 22:20 +0200, Adrian Bunk wrote:
> This patch removes dead code introduced by
> commit 90a42210f275e1f828eb6c08bf8252c2d6a774e0 and spotted
> by the Coverity checker.

> --- linux-2.6.22-rc6-mm1/drivers/net/wireless/libertas/wext.c.old	2007-06-29 21:52:56.000000000 +0200
> +++ linux-2.6.22-rc6-mm1/drivers/net/wireless/libertas/wext.c	2007-06-29 21:53:43.000000000 +0200
> @@ -1823,85 +1823,82 @@ static int wlan_set_encodeext(struct net

out of curiosity, why so much context?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

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

* Re: [2.6 patch] drivers/net/wireless/libertas/wext.c: remove dead code
  2007-07-02  8:53 ` Johannes Berg
@ 2007-07-02  9:07   ` Michael Buesch
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Buesch @ 2007-07-02  9:07 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Adrian Bunk, Dan Williams, John W. Linville, linux-wireless,
	linux-kernel

On Monday 02 July 2007 10:53:54 Johannes Berg wrote:
> On Sun, 2007-07-01 at 22:20 +0200, Adrian Bunk wrote:
> > This patch removes dead code introduced by
> > commit 90a42210f275e1f828eb6c08bf8252c2d6a774e0 and spotted
> > by the Coverity checker.
> 
> > --- linux-2.6.22-rc6-mm1/drivers/net/wireless/libertas/wext.c.old	2007-06-29 21:52:56.000000000 +0200
> > +++ linux-2.6.22-rc6-mm1/drivers/net/wireless/libertas/wext.c	2007-06-29 21:53:43.000000000 +0200
> > @@ -1823,85 +1823,82 @@ static int wlan_set_encodeext(struct net
> 
> out of curiosity, why so much context?

Because you see why it's dead code in the context and don't have
to lookup the code tree. ;)

-- 
Greetings Michael.

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

end of thread, other threads:[~2007-07-02  9:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-01 20:20 [2.6 patch] drivers/net/wireless/libertas/wext.c: remove dead code Adrian Bunk
2007-07-02  8:53 ` Johannes Berg
2007-07-02  9:07   ` Michael Buesch

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).