aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-06-03 11:12:20 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-06-03 11:12:20 +0200
commit774020c224653590110b30ea461d0ead34a6d875 (patch)
treeb79e5b1ed837a552122e62f397e190b065f5beec
parent1c7253726fcbab09917f143f0b703efbd2df55c3 (diff)
downloadbusybox-w32-774020c224653590110b30ea461d0ead34a6d875.tar.gz
busybox-w32-774020c224653590110b30ea461d0ead34a6d875.tar.bz2
busybox-w32-774020c224653590110b30ea461d0ead34a6d875.zip
udhcp: convert log1s() macro to function
function old new delta log1s - 15 +15 udhcp_recv_kernel_packet 134 125 -9 d6_recv_kernel_packet 118 109 -9 change_listen_mode 280 271 -9 send_packet 162 141 -21 udhcpc_main 2625 2598 -27 udhcpc6_main 2655 2628 -27 d6_recv_raw_packet 255 216 -39 udhcp_recv_raw_packet 562 484 -78 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/8 up/down: 15/-219) Total: -204 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/udhcp/common.c7
-rw-r--r--networking/udhcp/common.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index b325c4112..31e525cb0 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -185,6 +185,13 @@ const uint8_t dhcp_option_lengths[] ALIGN1 = {
185 */ 185 */
186}; 186};
187 187
188#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1
189void FAST_FUNC log1s(const char *msg)
190{
191 if (dhcp_verbose >= 1)
192 bb_simple_info_msg(msg);
193}
194#endif
188 195
189#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 2 196#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 2
190static void log_option(const char *pfx, const uint8_t *opt) 197static void log_option(const char *pfx, const uint8_t *opt)
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index 48a23792a..8c678dd32 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -275,7 +275,8 @@ struct option_set *udhcp_find_option(struct option_set *opt_list, uint8_t code)
275# define IF_UDHCP_VERBOSE(...) __VA_ARGS__ 275# define IF_UDHCP_VERBOSE(...) __VA_ARGS__
276extern unsigned dhcp_verbose; 276extern unsigned dhcp_verbose;
277# define log1(...) do { if (dhcp_verbose >= 1) bb_info_msg(__VA_ARGS__); } while (0) 277# define log1(...) do { if (dhcp_verbose >= 1) bb_info_msg(__VA_ARGS__); } while (0)
278# define log1s(msg) do { if (dhcp_verbose >= 1) bb_simple_info_msg(msg); } while (0) 278//# define log1s(msg) do { if (dhcp_verbose >= 1) bb_simple_info_msg(msg); } while (0)
279void log1s(const char *msg) FAST_FUNC;
279# if CONFIG_UDHCP_DEBUG >= 2 280# if CONFIG_UDHCP_DEBUG >= 2
280void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; 281void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC;
281# define log2(...) do { if (dhcp_verbose >= 2) bb_info_msg(__VA_ARGS__); } while (0) 282# define log2(...) do { if (dhcp_verbose >= 2) bb_info_msg(__VA_ARGS__); } while (0)