libbb: introduce and use print_flags().
Mostly by Natanael Copa <natanael.copa AT gmail.com>

function                                             old     new   delta
print_e2flags                                          -     189    +189
print_flags_separated                                  -      86     +86
static.flag_labels                                     -      60     +60
static.dma_wmode_masks                                 -      32     +32
static.flag_masks                                      -      28     +28
static.arp_labels                                      -      16     +16
static.arp_masks                                       -      12     +12
ls_main                                              836     843      +7
...
popstring                                            140     134      -6
arp_show                                             740     708     -32
print_flags                                          189      25    -164
ipaddr_list_or_flush                                2396    2170    -226
process_dev                                         5306    4706    -600
------------------------------------------------------------------------------
(add/remove: 10/0 grow/shrink: 5/10 up/down: 458/-1043)      Total: -585 bytes
   text    data     bss     dec     hex filename
 810564     624    7060  818248   c7c48 busybox_old
 810002     624    7060  817686   c7a16 busybox_unstripped

diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 07b2787..faa3f2d 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -45,16 +45,15 @@
 
 static void print_link_flags(unsigned flags, unsigned mdown)
 {
+	static const int flag_masks[] = {
+		IFF_LOOPBACK, IFF_BROADCAST, IFF_POINTOPOINT,
+		IFF_MULTICAST, IFF_NOARP, IFF_UP, IFF_LOWER_UP };
+	static const char flag_labels[] ALIGN1 =
+		"LOOPBACK\0""BROADCAST\0""POINTOPOINT\0"
+		"MULTICAST\0""NOARP\0""UP\0""LOWER_UP\0";
+
 	bb_putchar('<');
 	flags &= ~IFF_RUNNING;
-#define _PF(f) if (flags & IFF_##f) { \
-		  flags &= ~IFF_##f; \
-		  printf(#f "%s", flags ? "," : ""); }
-	_PF(LOOPBACK);
-	_PF(BROADCAST);
-	_PF(POINTOPOINT);
-	_PF(MULTICAST);
-	_PF(NOARP);
 #if 0
 	_PF(ALLMULTI);
 	_PF(PROMISC);
@@ -66,9 +65,7 @@
 	_PF(PORTSEL);
 	_PF(NOTRAILERS);
 #endif
-	_PF(UP);
-	_PF(LOWER_UP);
-#undef _PF
+	flags = print_flags_separated(flag_masks, flag_labels, flags, ",");
 	if (flags)
 		printf("%x", flags);
 	if (mdown)