From 774020c224653590110b30ea461d0ead34a6d875 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 3 Jun 2021 11:12:20 +0200 Subject: 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 --- networking/udhcp/common.c | 7 +++++++ networking/udhcp/common.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'networking') diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c index b325c41..31e525c 100644 --- a/networking/udhcp/common.c +++ b/networking/udhcp/common.c @@ -185,6 +185,13 @@ const uint8_t dhcp_option_lengths[] ALIGN1 = { */ }; +#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 +void FAST_FUNC log1s(const char *msg) +{ + if (dhcp_verbose >= 1) + bb_simple_info_msg(msg); +} +#endif #if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 2 static void log_option(const char *pfx, const uint8_t *opt) diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index 48a2379..8c678dd 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) # define IF_UDHCP_VERBOSE(...) __VA_ARGS__ extern unsigned dhcp_verbose; # define log1(...) do { if (dhcp_verbose >= 1) bb_info_msg(__VA_ARGS__); } while (0) -# define log1s(msg) do { if (dhcp_verbose >= 1) bb_simple_info_msg(msg); } while (0) +//# define log1s(msg) do { if (dhcp_verbose >= 1) bb_simple_info_msg(msg); } while (0) +void log1s(const char *msg) FAST_FUNC; # if CONFIG_UDHCP_DEBUG >= 2 void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; # define log2(...) do { if (dhcp_verbose >= 2) bb_info_msg(__VA_ARGS__); } while (0) -- cgit v1.1