Skip to contentSkip to conversation

mbim: add an optional TEMP_FAILURE_RETRY macro copy

PATCH In review Khem Raj 2 participants 2 messages May 24, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 mbim: add an optional TEMP_FAILURE_RETRY macro copy

Fixes build on musl which does not provide this macro

---
 drivers/mbimmodem/mbim-private.h | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/mbimmodem/mbim-private.h +9 -0
index e159235..51693ea 100644
@@ -21,6 +21,15 @@
 
 #define align_len(len, boundary) (((len)+(boundary)-1) & ~((boundary)-1))
 
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) ({     \
+  __typeof(expression) __result;              \
+  do {                                        \
+    __result = (expression);                  \
+  } while (__result == -1 && errno == EINTR); \
+  __result; })
+#endif
+
 enum mbim_control_message {
 	MBIM_OPEN_MSG = 0x1,
 	MBIM_CLOSE_MSG = 0x2,
Signature · 1 line
2.21.0
#1 lore raw

Hi,

Quoted 3 lines · Khem Raj

Fixes build on musl which does not provide this macro

No Signed-off-by for oFono patch submissions please

Quoted 4 lines
---
  drivers/mbimmodem/mbim-private.h | 9 +++++++++
  1 file changed, 9 insertions(+)

I solved this by introducing L_TFR in ell, commit:
8198b3689490eb81fdc7ce42f4ec1ac7321a1e3c

And reworked all use of TFR/TEMP_FAILURE_RETRY to use that instead.

Regards,
-Denis