Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452809 > unrolled thread

[PATCH 1/1] mwifiex: remove superfluous condition (2)

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2016-07-31 13:00 +0200
Last post2016-08-01 12:50 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] mwifiex: remove superfluous condition (2) Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-07-31 13:00 +0200
    Re: [PATCH 1/1] mwifiex: remove superfluous condition (2) Kalle Valo <kvalo@codeaurora.org> - 2016-07-31 14:10 +0200
      [PATCH 1/1] mwifiex: key_material_v2 remove superfluous condition Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-07-31 14:20 +0200
        RE: [PATCH 1/1] mwifiex: key_material_v2 remove superfluous condition Amitkumar Karwar <akarwar@marvell.com> - 2016-08-01 12:50 +0200

#1452809 — [PATCH 1/1] mwifiex: remove superfluous condition (2)

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-07-31 13:00 +0200
Subject[PATCH 1/1] mwifiex: remove superfluous condition (2)
Message-ID<s0WDn-7rm-9@gated-at.bofh.it>
We are using mac as source address in a memcpy.
In the lines below we can assume mac is not NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index 128add8..0d4f9fe 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -706,15 +706,10 @@ mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv,
 				    (priv->wep_key_curr_index & KEY_INDEX_MASK))
 					key_info |= KEY_DEFAULT;
 			} else {
-				if (mac) {
-					if (is_broadcast_ether_addr(mac))
-						key_info |= KEY_MCAST;
-					else
-						key_info |= KEY_UNICAST |
-							    KEY_DEFAULT;
-				} else {
+				if (is_broadcast_ether_addr(mac))
 					key_info |= KEY_MCAST;
-				}
+				else
+					key_info |= KEY_UNICAST | KEY_DEFAULT;
 			}
 		}
 		km->key_param_set.key_info = cpu_to_le16(key_info);
-- 
2.8.1

[toc] | [next] | [standalone]


#1452817

FromKalle Valo <kvalo@codeaurora.org>
Date2016-07-31 14:10 +0200
Message-ID<s0XJ7-8n0-11@gated-at.bofh.it>
In reply to#1452809
Heinrich Schuchardt <xypron.glpk@gmx.de> writes:

> We are using mac as source address in a memcpy.
> In the lines below we can assume mac is not NULL.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Please try to make the commit titles unique, for example you can use
function names or something else. Adding "(2)" is not the way to do
that.

-- 
Kalle Valo

[toc] | [prev] | [next] | [standalone]


#1452820 — [PATCH 1/1] mwifiex: key_material_v2 remove superfluous condition

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-07-31 14:20 +0200
Subject[PATCH 1/1] mwifiex: key_material_v2 remove superfluous condition
Message-ID<s0XSN-8qj-3@gated-at.bofh.it>
In reply to#1452817
We are using mac as source address in a memcpy.
In the lines below we can assume mac is not NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index 128add8..0d4f9fe 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -706,15 +706,10 @@ mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv,
 				    (priv->wep_key_curr_index & KEY_INDEX_MASK))
 					key_info |= KEY_DEFAULT;
 			} else {
-				if (mac) {
-					if (is_broadcast_ether_addr(mac))
-						key_info |= KEY_MCAST;
-					else
-						key_info |= KEY_UNICAST |
-							    KEY_DEFAULT;
-				} else {
+				if (is_broadcast_ether_addr(mac))
 					key_info |= KEY_MCAST;
-				}
+				else
+					key_info |= KEY_UNICAST | KEY_DEFAULT;
 			}
 		}
 		km->key_param_set.key_info = cpu_to_le16(key_info);
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1453130 — RE: [PATCH 1/1] mwifiex: key_material_v2 remove superfluous condition

FromAmitkumar Karwar <akarwar@marvell.com>
Date2016-08-01 12:50 +0200
SubjectRE: [PATCH 1/1] mwifiex: key_material_v2 remove superfluous condition
Message-ID<s1iXf-5ai-25@gated-at.bofh.it>
In reply to#1452820
> From: Heinrich Schuchardt [mailto:xypron.glpk@gmx.de]
> Sent: Sunday, July 31, 2016 5:41 PM
> To: Amitkumar Karwar; Nishant Sarmukadam; Kalle Valo
> Cc: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; Heinrich Schuchardt
> Subject: [PATCH 1/1] mwifiex: key_material_v2 remove superfluous
> condition
> 
> We are using mac as source address in a memcpy.
> In the lines below we can assume mac is not NULL.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> index 128add8..0d4f9fe 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> @@ -706,15 +706,10 @@ mwifiex_cmd_802_11_key_material_v2(struct
> mwifiex_private *priv,
>  				    (priv->wep_key_curr_index & KEY_INDEX_MASK))
>  					key_info |= KEY_DEFAULT;
>  			} else {
> -				if (mac) {
> -					if (is_broadcast_ether_addr(mac))
> -						key_info |= KEY_MCAST;
> -					else
> -						key_info |= KEY_UNICAST |
> -							    KEY_DEFAULT;
> -				} else {
> +				if (is_broadcast_ether_addr(mac))
>  					key_info |= KEY_MCAST;
> -				}
> +				else
> +					key_info |= KEY_UNICAST | KEY_DEFAULT;
>  			}
>  		}
>  		km->key_param_set.key_info = cpu_to_le16(key_info);
> --
> 2.8.1

Looks ok to me.

Acked-by: Amitkumar Karwar <akarwar@marvell.com>

Regards,
Amitkumar

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web