Skip to contentSkip to conversation

iwlwifi: Remove unnecessary code in iwl3945 and iwl4965 drivers

PATCH In review Miguel Botón 3 participants 4 messages Nov 10, 2007 – Nov 15, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: Remove unnecessary code in iwl3945 and iwl4965 drivers

Remove unnecesary code in iwl3945 and iwl4965 drivers.

"final_mode" variable is already initialized with the value of the "mod= e" variable.

Index: linux-2.6.24-rc2/drivers/net/wireless/iwlwifi/iwl3945-base.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

drivers/net/wireless/iwlwifi/iwl3945-base.c +0 -3
@@ -2377,9 +2377,6 @@
 	case IWL_POWER_AC:
 		final_mode =3D IWL_POWER_MODE_CAM;
 		break;
-	default:
-		final_mode =3D mode;
-		break;
 	}

=20
iwl_update_power_cmd(priv, &cmd, final_mode);
Index: linux-2.6.24-rc2/drivers/net/wireless/iwlwifi/iwl4965-base.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -3
@@ -2233,9 +2233,6 @@
 	case IWL_POWER_AC:
 		final_mode =3D IWL_POWER_MODE_CAM;
 		break;
-	default:
-		final_mode =3D mode;
-		break;
 	}

=20
cmd.keep_alive_beacons =3D 0;

--=20
Miguel Bot=F3n
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 6 lines · On Sat, 2007-11-10 at 20:49 +0100, Miguel Bot=A8=AEn wrote:

Remove unnecesary code in iwl3945 and iwl4965 drivers. =20
"final_mode" variable is already initialized with the value of the "mode" variable.
=20

ACK. Or you can do "u32 uninitialized_var(final_mode);". Both are OK with me.

Thanks,
-yi
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 11 lines · Zhu Yi

=20

Quoted 6 lines · On Sat, 2007-11-10 at 20:49 +0100, Miguel Bot=F3n wrote:

Remove unnecesary code in iwl3945 and iwl4965 drivers. =20
"final_mode" variable is already initialized with the value of the "mode" variable.
=20

=20
ACK. Or you can do "u32 uninitialized_var(final_mode);". Both are OK with me.

I think I like this alternative better...

--=20
John W. Linville
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH 1/1 iwlwifi: remove redundant initialization of final_mode

In reply to Miguel Botón

Problem identified by Miguel Bot=C3=B3n <[email protected]>, altern= ate
solution suggested by Zhu Yi <[email protected]>, patch by me. :-)

Cc Miguel Bot=C3=B3n <[email protected]>
Cc Zhu Yi <[email protected]>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/= renamed from drivers/net/wireless/iwlwifi/iwl3945-base.c +0 -0

wireless/iwlwifi/iwl3945-base.c
index e2cbd9e..15937c0 100644

drivers/net/wireless/iwlwifi/iwl3945-base.c +0 -0
@@ -2139,7 +2139,7 @@ static int iwl3945_update_power_cmd(struct iwl394=

5_priv *priv,
=20
static int iwl3945_send_power_mode(struct iwl3945_priv *priv, u32 mode=
)
{
- u32 final_mode =3D mode;
+ u32 uninitialized_var(final_mode);
int rc;
struct iwl3945_powertable_cmd cmd;
=20

drivers/net/= renamed from drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -0

wireless/iwlwifi/iwl4965-base.c
index ef17a98..30acd13 100644

drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -0
@@ -2218,7 +2218,7 @@ static int iwl4965_update_power_cmd(struct iwl496=

5_priv *priv,
=20
static int iwl4965_send_power_mode(struct iwl4965_priv *priv, u32 mode=
)
{
- u32 final_mode =3D mode;
+ u32 uninitialized_var(final_mode);
int rc;
struct iwl4965_powertable_cmd cmd;
=20
--=20
1.5.3.3

-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html