]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Remove 'inline' attributes from static functions in .c files (#11426)
authorTopi Miettinen <topimiettinen@users.noreply.github.com>
Tue, 15 Jan 2019 07:12:28 +0000 (09:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 15 Jan 2019 07:12:28 +0000 (08:12 +0100)
Let the compiler perform inlining (see #11397).

21 files changed:
src/basic/hashmap.c
src/basic/siphash24.c
src/basic/user-util.c
src/boot/efi/linux.c
src/core/automount.c
src/core/dbus-socket.c
src/coredump/coredump.c
src/journal-remote/journal-upload-journal.c
src/journal-remote/microhttpd-util.c
src/journal/mmap-cache.c
src/libsystemd/sd-bus/bus-match.c
src/libsystemd/sd-login/sd-login.c
src/libsystemd/sd-network/sd-network.c
src/libudev/libudev-list.c
src/network/networkd-brvlan.c
src/resolve/resolved-etc-hosts.c
src/shared/bus-unit-util.c
src/shared/install.c
src/udev/udev-builtin-input_id.c
src/udev/udev-builtin-keyboard.c
src/udev/udev-rules.c

index 5a4bb37b8229b09d7d500f23c3a7a02ea9df0907..f2e33d22656389459f669d2015ef77ca351182e1 100644 (file)
@@ -345,7 +345,7 @@ static unsigned base_bucket_hash(HashmapBase *h, const void *p) {
 }
 #define bucket_hash(h, p) base_bucket_hash(HASHMAP_BASE(h), p)
 
-static inline void base_set_dirty(HashmapBase *h) {
+static void base_set_dirty(HashmapBase *h) {
         h->dirty = true;
 }
 #define hashmap_set_dirty(h) base_set_dirty(HASHMAP_BASE(h))
index bf365b505d521f8b442815147ce83ea723aa347b..61180819b1bf0f995cddb9ca2ee9f02e1be9bb28 100644 (file)
 #include "siphash24.h"
 #include "unaligned.h"
 
-static inline uint64_t rotate_left(uint64_t x, uint8_t b) {
+static uint64_t rotate_left(uint64_t x, uint8_t b) {
         assert(b < 64);
 
         return (x << b) | (x >> (64 - b));
 }
 
-static inline void sipround(struct siphash *state) {
+static void sipround(struct siphash *state) {
         assert(state);
 
         state->v0 += state->v1;
index d410c9068b937cf2bb8f120820e40ce819d57826..65738a760de27df66832c02cc50ad7b9c5c3d6a1 100644 (file)
@@ -87,7 +87,7 @@ char *getusername_malloc(void) {
         return uid_to_name(getuid());
 }
 
-static inline bool is_nologin_shell(const char *shell) {
+static bool is_nologin_shell(const char *shell) {
 
         return PATH_IN_SET(shell,
                            /* 'nologin' is the friendliest way to disable logins for a user account. It prints a nice
index d1605523d870ccca32dff7b79813fe383b5791cf..5b4c0858805f3b9e7cab3153ef2d89546678e9cc 100644 (file)
@@ -52,7 +52,7 @@ struct SetupHeader {
 
 #ifdef __x86_64__
 typedef VOID(*handover_f)(VOID *image, EFI_SYSTEM_TABLE *table, struct SetupHeader *setup);
-static inline VOID linux_efi_handover(EFI_HANDLE image, struct SetupHeader *setup) {
+static VOID linux_efi_handover(EFI_HANDLE image, struct SetupHeader *setup) {
         handover_f handover;
 
         asm volatile ("cli");
@@ -61,7 +61,7 @@ static inline VOID linux_efi_handover(EFI_HANDLE image, struct SetupHeader *setu
 }
 #else
 typedef VOID(*handover_f)(VOID *image, EFI_SYSTEM_TABLE *table, struct SetupHeader *setup) __attribute__((regparm(0)));
-static inline VOID linux_efi_handover(EFI_HANDLE image, struct SetupHeader *setup) {
+static VOID linux_efi_handover(EFI_HANDLE image, struct SetupHeader *setup) {
         handover_f handover;
 
         handover = (handover_f)((UINTN)setup->code32_start + setup->handover_offset);
index de8010bf2e5d86865cb7fff98033423713959e77..6db13ab08fa8becb9b81b1009c4f61c1da925281 100644 (file)
@@ -48,7 +48,7 @@ struct expire_data {
         int ioctl_fd;
 };
 
-static inline void expire_data_free(struct expire_data *data) {
+static void expire_data_free(struct expire_data *data) {
         if (!data)
                 return;
 
index 37cf9d204c726a66c6e0216398c21858c8065a62..83ac7ad1107874df565c4bee528953f2ddafda46 100644 (file)
@@ -134,11 +134,11 @@ const sd_bus_vtable bus_socket_vtable[] = {
         SD_BUS_VTABLE_END
 };
 
-static inline bool check_size_t_truncation(uint64_t t) {
+static bool check_size_t_truncation(uint64_t t) {
         return (size_t) t == t;
 }
 
-static inline const char* socket_protocol_to_string(int32_t i) {
+static const char* socket_protocol_to_string(int32_t i) {
         if (i == IPPROTO_IP)
                 return "";
 
index 516f63d3e099b1ef6f491b6e117a82ad99205b0f..ecbb4bffc904a320778256c2c73eecad22551a1f 100644 (file)
@@ -142,7 +142,7 @@ static int parse_config(void) {
                                         CONFIG_PARSE_WARN, NULL);
 }
 
-static inline uint64_t storage_size_max(void) {
+static uint64_t storage_size_max(void) {
         if (arg_storage == COREDUMP_STORAGE_EXTERNAL)
                 return arg_external_size_max;
         if (arg_storage == COREDUMP_STORAGE_JOURNAL)
@@ -229,7 +229,7 @@ static int fix_xattr(int fd, const char *context[_CONTEXT_MAX]) {
 
 #define filename_escape(s) xescape((s), "./ ")
 
-static inline const char *coredump_tmpfile_name(const char *s) {
+static const char *coredump_tmpfile_name(const char *s) {
         return s ? s : "(unnamed temporary file)";
 }
 
index be39f7c0476e48e508c4dee7572f55ca1ee68c54..7d7e7384bf38bf583bf237637c5a08fc2450d9f0 100644 (file)
@@ -235,7 +235,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
         assert_not_reached("WTF?");
 }
 
-static inline void check_update_watchdog(Uploader *u) {
+static void check_update_watchdog(Uploader *u) {
         usec_t after;
         usec_t elapsed_time;
 
index 6d049d11f786c893416c5c2044db938ca7e3c4f1..5f5691995da537cd13b40cd142d932c3bbf45306 100644 (file)
@@ -244,7 +244,7 @@ static int get_auth_dn(gnutls_x509_crt_t client_cert, char **buf) {
         return 0;
 }
 
-static inline void gnutls_x509_crt_deinitp(gnutls_x509_crt_t *p) {
+static void gnutls_x509_crt_deinitp(gnutls_x509_crt_t *p) {
         gnutls_x509_crt_deinit(*p);
 }
 
index 90549f1c9f820d76591225b687cca331f6c4e02d..0dc453e709e074f4ca9b776e25735580446c1f17 100644 (file)
@@ -132,7 +132,7 @@ static void window_free(Window *w) {
         free(w);
 }
 
-_pure_ static inline bool window_matches(Window *w, int prot, uint64_t offset, size_t size) {
+_pure_ static bool window_matches(Window *w, int prot, uint64_t offset, size_t size) {
         assert(w);
         assert(size > 0);
 
index ad135406f686c52c08ddcd1d67f785c5663cfdaf..9642de10c3e6f74963335baabca8c21c12c24b61 100644 (file)
  *      ` BUS_MATCH_LEAF: E
  */
 
-static inline bool BUS_MATCH_IS_COMPARE(enum bus_match_node_type t) {
+static bool BUS_MATCH_IS_COMPARE(enum bus_match_node_type t) {
         return t >= BUS_MATCH_SENDER && t <= BUS_MATCH_ARG_HAS_LAST;
 }
 
-static inline bool BUS_MATCH_CAN_HASH(enum bus_match_node_type t) {
+static bool BUS_MATCH_CAN_HASH(enum bus_match_node_type t) {
         return (t >= BUS_MATCH_MESSAGE_TYPE && t <= BUS_MATCH_PATH) ||
                 (t >= BUS_MATCH_ARG && t <= BUS_MATCH_ARG_LAST) ||
                 (t >= BUS_MATCH_ARG_HAS && t <= BUS_MATCH_ARG_HAS_LAST);
index a904c6b544410bcbff294add89ee0807f802a430..07f21e84de534cfcea365915545995f03cb38d36 100644 (file)
@@ -945,11 +945,11 @@ _public_ int sd_machine_get_ifindices(const char *machine, int **ifindices) {
         return nr;
 }
 
-static inline int MONITOR_TO_FD(sd_login_monitor *m) {
+static int MONITOR_TO_FD(sd_login_monitor *m) {
         return (int) (unsigned long) m - 1;
 }
 
-static inline sd_login_monitor* FD_TO_MONITOR(int fd) {
+static sd_login_monitor* FD_TO_MONITOR(int fd) {
         return (sd_login_monitor*) (unsigned long) (fd + 1);
 }
 
index d4b5e248cca595da331619b99e18c001b958c2ee..812826fe3dbd9ac752feff1ac57319a90ad29fc6 100644 (file)
@@ -276,11 +276,11 @@ _public_ int sd_network_link_get_carrier_bound_by(int ifindex, int **ret) {
         return network_link_get_ifindexes(ifindex, "CARRIER_BOUND_BY", ret);
 }
 
-static inline int MONITOR_TO_FD(sd_network_monitor *m) {
+static int MONITOR_TO_FD(sd_network_monitor *m) {
         return (int) (unsigned long) m - 1;
 }
 
-static inline sd_network_monitor* FD_TO_MONITOR(int fd) {
+static sd_network_monitor* FD_TO_MONITOR(int fd) {
         return (sd_network_monitor*) (unsigned long) (fd + 1);
 }
 
index 5f6726c2d8262c205c827930faeca433f96460a8..273732618781beaca5566863af98ef4d1c389795 100644 (file)
@@ -61,7 +61,7 @@ static void udev_list_node_remove(struct udev_list_node *entry) {
 }
 
 /* return list entry which embeds this node */
-static inline struct udev_list_entry *list_node_to_entry(struct udev_list_node *node) {
+static struct udev_list_entry *list_node_to_entry(struct udev_list_node *node) {
         return container_of(node, struct udev_list_entry, node);
 }
 
index 1d18e29b7c164167fe2ce7048089397ffbdaa7e2..8f9103f1466d2a54bafa66021aea3214bb88b490 100644 (file)
@@ -22,7 +22,7 @@ static bool is_bit_set(unsigned bit, uint32_t scope) {
         return scope & (1 << bit);
 }
 
-static inline void set_bit(unsigned nr, uint32_t *addr) {
+static void set_bit(unsigned nr, uint32_t *addr) {
         if (nr < BRIDGE_VLAN_BITMAP_MAX)
                 addr[nr / 32] |= (((uint32_t) 1) << (nr % 32));
 }
index 01cde4acf7b1e7ad0555507bc32b2f02eac08d62..ee21222e50768c96c312852670335a5b0820fe59 100644 (file)
 /* Recheck /etc/hosts at most once every 2s */
 #define ETC_HOSTS_RECHECK_USEC (2*USEC_PER_SEC)
 
-static inline void etc_hosts_item_free(EtcHostsItem *item) {
+static void etc_hosts_item_free(EtcHostsItem *item) {
         strv_free(item->names);
         free(item);
 }
 
-static inline void etc_hosts_item_by_name_free(EtcHostsItemByName *item) {
+static void etc_hosts_item_by_name_free(EtcHostsItemByName *item) {
         free(item->name);
         free(item->addresses);
         free(item);
index dce8646f377e49209765feedde6ff5d246d33787..9a8051d0635abfc878ec4649be8d0029226e5419 100644 (file)
@@ -118,7 +118,7 @@ DEFINE_BUS_APPEND_PARSE_PTR("u", uint32_t, mode_t, parse_mode);
 DEFINE_BUS_APPEND_PARSE_PTR("u", uint32_t, unsigned, safe_atou);
 DEFINE_BUS_APPEND_PARSE_PTR("x", int64_t, int64_t, safe_atoi64);
 
-static inline int bus_append_string(sd_bus_message *m, const char *field, const char *eq) {
+static int bus_append_string(sd_bus_message *m, const char *field, const char *eq) {
         int r;
 
         r = sd_bus_message_append(m, "(sv)", field, "s", eq);
index 3104043af64233534d5518fcd792496379d089db..8629304cef4b1b17b707f2bf840ec2b56d0dac1b 100644 (file)
@@ -68,7 +68,7 @@ typedef struct {
         size_t n_rules;
 } Presets;
 
-static inline bool unit_file_install_info_has_rules(const UnitFileInstallInfo *i) {
+static bool unit_file_install_info_has_rules(const UnitFileInstallInfo *i) {
         assert(i);
 
         return !strv_isempty(i->aliases) ||
@@ -76,13 +76,13 @@ static inline bool unit_file_install_info_has_rules(const UnitFileInstallInfo *i
                !strv_isempty(i->required_by);
 }
 
-static inline bool unit_file_install_info_has_also(const UnitFileInstallInfo *i) {
+static bool unit_file_install_info_has_also(const UnitFileInstallInfo *i) {
         assert(i);
 
         return !strv_isempty(i->also);
 }
 
-static inline void presets_freep(Presets *p) {
+static void presets_freep(Presets *p) {
         size_t i;
 
         if (!p)
index 13e9f0108d72136439768b54671cb1e9ee082d24..e3db55b1a9d98490e4323ab1c467174310a2714d 100644 (file)
@@ -42,7 +42,7 @@ static const struct range high_key_blocks[] = {
         { KEY_ALS_TOGGLE, BTN_TRIGGER_HAPPY }
 };
 
-static inline int abs_size_mm(const struct input_absinfo *absinfo) {
+static int abs_size_mm(const struct input_absinfo *absinfo) {
         /* Resolution is defined to be in units/mm for ABS_X/Y */
         return (absinfo->maximum - absinfo->minimum) / absinfo->resolution;
 }
index 1eb91f0a788f82957ae19802df1f5915fda66bfc..d80cdd26aa7da1f303cf0e495b5d209e1952c1a4 100644 (file)
@@ -89,7 +89,7 @@ static int map_keycode(sd_device *dev, int fd, int scancode, const char *keycode
         return 0;
 }
 
-static inline char* parse_token(const char *current, int32_t *val_out) {
+static char* parse_token(const char *current, int32_t *val_out) {
         char *next;
         int32_t val;
 
index f697972debe51613f185d36fc65b0cc5c446a1fd..7d5b9b7935110d408b39b19278fdb75a61b14605 100644 (file)
@@ -441,8 +441,8 @@ static void dump_rules(UdevRules *rules) {
                 dump_token(rules, &rules->tokens[i]);
 }
 #else
-static inline void dump_token(UdevRules *rules, struct token *token) {}
-static inline void dump_rules(UdevRules *rules) {}
+static void dump_token(UdevRules *rules, struct token *token) {}
+static void dump_rules(UdevRules *rules) {}
 #endif /* ENABLE_DEBUG_UDEV */
 
 static int add_token(UdevRules *rules, struct token *token) {