public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: remove biggest_unsigned_int() macro
@ 2012-04-28 19:31 Antonio Quartulli
  2012-04-29  8:35 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-04-28 19:31 UTC (permalink / raw)
  To: b.a.t.m.a.n

As suggested by David S. Miller, this macro is not very useful. So we can remove
it and use its expanded version instead.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---


This patch should be committed into next because it has to be sent to David S.
Miller within the next pull request.

Thank you

 distributed-arp-table.h |    2 +-
 main.h                  |    3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/distributed-arp-table.h b/distributed-arp-table.h
index 5e23577..6c0acde 100644
--- a/distributed-arp-table.h
+++ b/distributed-arp-table.h
@@ -29,7 +29,7 @@
 
 #include <linux/if_arp.h>
 
-#define DAT_ADDR_MAX biggest_unsigned_int(dat_addr_t)
+#define DAT_ADDR_MAX ((dat_addr_t)~(dat_addr_t)0)
 
 #define ARP_HW_SRC(skb, hdr_size) ((uint8_t *)(skb->data + hdr_size) + \
 				   ETH_HLEN + sizeof(struct arphdr))
diff --git a/main.h b/main.h
index 97d0258..426a0d5 100644
--- a/main.h
+++ b/main.h
@@ -241,9 +241,6 @@ static inline bool has_timed_out(unsigned long timestamp, unsigned int timeout)
 /* Returns the smallest signed integer in two's complement with the sizeof x */
 #define smallest_signed_int(x) (1u << (7u + 8u * (sizeof(x) - 1u)))
 
-/* Returns the biggest unsigned integer with the sizeof x */
-#define biggest_unsigned_int(x) (~(x)0)
-
 /* Checks if a sequence number x is a predecessor/successor of y.
  * they handle overflows/underflows and can correctly check for a
  * predecessor/successor unless the variable sequence number has grown by
-- 
1.7.9.4


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

end of thread, other threads:[~2012-04-29  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-28 19:31 [B.A.T.M.A.N.] [PATCH] batman-adv: remove biggest_unsigned_int() macro Antonio Quartulli
2012-04-29  8:35 ` Marek Lindner

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