logo

oasis

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

0004-Avoid-statement-expression-in-ATTR_DIFF-macro.patch (862B)


  1. From e56f5df0379c7dc70f6ce61a31167185daa51cae Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sun, 11 Aug 2019 21:57:03 +0000
  4. Subject: [PATCH] Avoid statement expression in ATTR_DIFF macro
  5. ---
  6. include/netlink-private/object-api.h | 5 +----
  7. 1 file changed, 1 insertion(+), 4 deletions(-)
  8. diff --git a/include/netlink-private/object-api.h b/include/netlink-private/object-api.h
  9. index 517e672..269cd4b 100644
  10. --- a/include/netlink-private/object-api.h
  11. +++ b/include/netlink-private/object-api.h
  12. @@ -260,10 +260,7 @@ struct nl_object
  13. * @endcode
  14. */
  15. #define ATTR_DIFF(LIST, ATTR, A, B, EXPR) \
  16. -({ uint64_t diff = 0; \
  17. - if (((LIST) & (ATTR)) && ATTR_MISMATCH(A, B, ATTR, EXPR)) \
  18. - diff = ATTR; \
  19. - diff; })
  20. + ((uint64_t)(((LIST) & (ATTR)) && ATTR_MISMATCH(A, B, ATTR, EXPR) ? (ATTR) : 0))
  21. /**
  22. * Object Operations
  23. --
  24. 2.23.0