Skip to contentSkip to conversation

station: Simplify and comply with coding style

PATCH Applied Tim Kourt 2 participants 2 messages Oct 8, 2019 – Oct 9, 2019

lore
Share & tools
lore

Tim Kourt

author
#0 lore raw

PATCH 1/1 station: Simplify and comply with coding style

---
 src/station.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
src/station.c +12 -10
index 9b3e087e..72393d51 100644
@@ -1164,19 +1164,20 @@ static void station_enter_state(struct station *station,
 	case STATION_STATE_CONNECTED:
 		periodic_scan_stop(station);
 
+		if (!station->netconfig)
+			break;
+
 		if (station->state == STATION_STATE_ROAMING) {
-			if (station->netconfig)
-				netconfig_reconfigure(station->netconfig);
+			netconfig_reconfigure(station->netconfig);
 
 			break;
 		}
 
-		if (station->netconfig)
-			netconfig_configure(station->netconfig,
-						network_get_settings(
-							station->connected_network),
-						netdev_get_address(
-								station->netdev));
+		netconfig_configure(station->netconfig,
+					network_get_settings(
+						station->connected_network),
+					netdev_get_address(
+							station->netdev));
 		break;
 	case STATION_STATE_DISCONNECTING:
 	case STATION_STATE_ROAMING:
@@ -3066,9 +3067,10 @@ static void station_free(struct station *station)
 	if (station->connected_bss)
 		netdev_disconnect(station->netdev, NULL, NULL);
 
-	if (station->netconfig)
+	if (station->netconfig) {
 		netconfig_destroy(station->netconfig);
-	station->netconfig = NULL;
+		station->netconfig = NULL;
+	}
 
 	periodic_scan_stop(station);
 
Signature · 1 line
2.13.6
#1 lore raw

Hi Tim,

Quoted 4 lines · Tim Kourt
---
  src/station.c | 22 ++++++++++++----------
  1 file changed, 12 insertions(+), 10 deletions(-)

Applied, thanks.

Regards,
-Denis