logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0005-Avoid-statement-expressions-in-container_of-macro.patch (925B)


  1. From 29eff3ebdf14cc6238208648a389f92adcedf1d1 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Mon, 6 Sep 2021 19:55:48 -0700
  4. Subject: [PATCH] Avoid statement-expressions in container_of macro
  5. ---
  6. slirp/ip_input.c | 5 ++---
  7. 1 file changed, 2 insertions(+), 3 deletions(-)
  8. diff --git a/slirp/ip_input.c b/slirp/ip_input.c
  9. index 50ab951..ca004c9 100644
  10. --- a/slirp/ip_input.c
  11. +++ b/slirp/ip_input.c
  12. @@ -41,9 +41,8 @@
  13. #include "slirp.h"
  14. #include "ip_icmp.h"
  15. -#define container_of(ptr, type, member) ({ \
  16. - const typeof( ((type *)0)->member ) *__mptr = (ptr); \
  17. - (type *)( (char *)__mptr - offsetof(type,member) );})
  18. +#define container_of(ptr, type, member) \
  19. + (type *)((char *)ptr - offsetof(type, member))
  20. static struct ip *ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp);
  21. static void ip_freef(Slirp *slirp, struct ipq *fp);
  22. --
  23. 2.32.0