Skip to content

Commit 324a455

Browse files
Krishna Tfabiobaltieri
authored andcommitted
net: wifi: Fix unnecessary intermediate variable
Directly return the function return value. Signed-off-by: Krishna T <[email protected]>
1 parent 7a117b6 commit 324a455

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

subsys/net/l2/wifi/wifi_mgmt.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_DISABLE, wifi_ap_disable);
168168
static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface,
169169
void *data, size_t len)
170170
{
171-
int ret;
172171
const struct device *dev = net_if_get_device(iface);
173172
struct net_wifi_mgmt_offload *off_api =
174173
(struct net_wifi_mgmt_offload *) dev->api;
@@ -182,13 +181,7 @@ static int wifi_iface_status(uint32_t mgmt_request, struct net_if *iface,
182181
return -EINVAL;
183182
}
184183

185-
ret = off_api->iface_status(dev, status);
186-
187-
if (ret) {
188-
return ret;
189-
}
190-
191-
return 0;
184+
return off_api->iface_status(dev, status);
192185
}
193186
NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_IFACE_STATUS, wifi_iface_status);
194187

@@ -204,7 +197,6 @@ void wifi_mgmt_raise_iface_status_event(struct net_if *iface,
204197
static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface,
205198
void *data, size_t len)
206199
{
207-
int ret;
208200
const struct device *dev = net_if_get_device(iface);
209201
struct net_wifi_mgmt_offload *off_api =
210202
(struct net_wifi_mgmt_offload *) dev->api;
@@ -218,13 +210,7 @@ static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface,
218210
return -EINVAL;
219211
}
220212

221-
ret = off_api->get_stats(dev, stats);
222-
223-
if (ret) {
224-
return ret;
225-
}
226-
227-
return 0;
213+
return off_api->get_stats(dev, stats);
228214
}
229215
NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats);
230216
#endif /* CONFIG_NET_STATISTICS_WIFI */

0 commit comments

Comments
 (0)