Remove 'inline' attributes from static functions in .c files (#11426)

Let the compiler perform inlining (see #11397).
This commit is contained in:
Topi Miettinen 2019-01-15 09:12:28 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 1c8e48f506
commit a1e92eee3e
21 changed files with 32 additions and 32 deletions

View 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))

View File

@ -23,13 +23,13 @@
#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;

View 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

View 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);

View 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;

View 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 "";

View 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)";
}

View 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;

View 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);
}

View 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);

View File

@ -49,11 +49,11 @@
* ` 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);

View 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);
}

View 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);
}

View 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);
}

View 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));
}

View File

@ -12,12 +12,12 @@
/* 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);

View 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);

View 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)

View 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;
}

View 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;

View 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) {