public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling
@ 2017-05-22 14:17 Jarod Wilson
       [not found] ` <20170522141722.50502-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Jarod Wilson @ 2017-05-22 14:17 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jarod Wilson

Only ntohll was being checked to see if it wasn't defined, and was then
redefining htonll as well as ntohll. This was causing some problems for
the compile of the opa-ff package. Simple enough to rearrange this code a
bit such that htonll and ntohll are handled entirely independent of one
another.

Reported-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 libibumad/umad.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libibumad/umad.h b/libibumad/umad.h
index 81811380..479165a8 100644
--- a/libibumad/umad.h
+++ b/libibumad/umad.h
@@ -247,15 +247,17 @@ static inline void umad_free(void *umad)
 	free(umad);
 }
 
+/* Users should use the glibc functions directly, not these wrappers */
 #ifndef ntohll
-#undef htonll
 #undef ntohll
-/* Users should use the glibc functions directly, not these wrappers */
-static inline __attribute__((deprecated)) uint64_t htonll(uint64_t x) { return htobe64(x); }
 static inline __attribute__((deprecated)) uint64_t ntohll(uint64_t x) { return be64toh(x); }
-#define htonll htonll
 #define ntohll ntohll
 #endif
+#ifndef htonll
+#undef htonll
+static inline __attribute__((deprecated)) uint64_t htonll(uint64_t x) { return htobe64(x); }
+#define htonll htonll
+#endif
 
 END_C_DECLS
 #endif				/* _UMAD_H */
-- 
2.12.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-30  3:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 14:17 [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling Jarod Wilson
     [not found] ` <20170522141722.50502-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-05-22 15:31   ` Hal Rosenstock
2017-05-24 16:33   ` Jason Gunthorpe
     [not found]     ` <20170524163301.GA7054-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-05-27 22:01       ` Jarod Wilson
2017-05-30  3:52   ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox