[Replicant] [libsamsung-ril] [PATCH 2/8] network: ril2ipc_net_mode_sel function: cleanup ifdefs

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Fri Aug 21 04:06:58 UTC 2020


Since the whole content of the ril2ipc_net_mode_sel function is ifdefed,
it makes more sense to wrap the whole function with ifdefs instead, in
order to increase readability.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 network.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/network.c b/network.c
index dff666b..45e8aed 100644
--- a/network.c
+++ b/network.c
@@ -379,11 +379,7 @@ int ipc2ril_net_mode_sel(struct ipc_net_mode_sel_data *data)
 
 #if RIL_VERSION >= 6
 unsigned char ril2ipc_net_mode_sel(RIL_PreferredNetworkType type)
-#else
-unsigned char ril2ipc_net_mode_sel(int type)
-#endif
 {
-#if RIL_VERSION >= 6
 	switch (type) {
 		case PREF_NET_TYPE_GSM_WCDMA:
 		case PREF_NET_TYPE_GSM_WCDMA_AUTO:
@@ -395,7 +391,10 @@ unsigned char ril2ipc_net_mode_sel(int type)
 		default:
 			return IPC_NET_MODE_SEL_GSM_UMTS;
 	}
+}
 #else
+unsigned char ril2ipc_net_mode_sel(int type)
+{
 	switch (type) {
 		case 0:
 		case 3:
@@ -407,8 +406,8 @@ unsigned char ril2ipc_net_mode_sel(int type)
 		default:
 			return IPC_NET_MODE_SEL_GSM_UMTS;
 	}
-#endif
 }
+#endif
 
 int ipc_disp_icon_info(struct ipc_message *message)
 {
-- 
2.28.0



More information about the Replicant mailing list