Merge "Make inlines static"

am: 68c5ce22fb

Change-Id: I08c066b7c49015b07aa46cff884a97d9dd2f675d
This commit is contained in:
Pirama Arumuga Nainar 2019-02-12 22:42:21 -08:00 committed by android-build-merger
commit 4834824a37

View file

@ -50,7 +50,7 @@ enum lmk_cmd {
typedef int LMKD_CTRL_PACKET[CTRL_PACKET_MAX_SIZE / sizeof(int)];
/* Get LMKD packet command */
inline enum lmk_cmd lmkd_pack_get_cmd(LMKD_CTRL_PACKET pack) {
static inline enum lmk_cmd lmkd_pack_get_cmd(LMKD_CTRL_PACKET pack) {
return (enum lmk_cmd)ntohl(pack[0]);
}
@ -64,8 +64,8 @@ struct lmk_target {
* For LMK_TARGET packet get target_idx-th payload.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline void lmkd_pack_get_target(LMKD_CTRL_PACKET packet,
int target_idx, struct lmk_target *target) {
static inline void lmkd_pack_get_target(LMKD_CTRL_PACKET packet, int target_idx,
struct lmk_target* target) {
target->minfree = ntohl(packet[target_idx * 2 + 1]);
target->oom_adj_score = ntohl(packet[target_idx * 2 + 2]);
}
@ -74,9 +74,8 @@ inline void lmkd_pack_get_target(LMKD_CTRL_PACKET packet,
* Prepare LMK_TARGET packet and return packet size in bytes.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline size_t lmkd_pack_set_target(LMKD_CTRL_PACKET packet,
struct lmk_target *targets,
size_t target_cnt) {
static inline size_t lmkd_pack_set_target(LMKD_CTRL_PACKET packet, struct lmk_target* targets,
size_t target_cnt) {
int idx = 0;
packet[idx++] = htonl(LMK_TARGET);
while (target_cnt) {
@ -99,8 +98,7 @@ struct lmk_procprio {
* For LMK_PROCPRIO packet get its payload.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline void lmkd_pack_get_procprio(LMKD_CTRL_PACKET packet,
struct lmk_procprio *params) {
static inline void lmkd_pack_get_procprio(LMKD_CTRL_PACKET packet, struct lmk_procprio* params) {
params->pid = (pid_t)ntohl(packet[1]);
params->uid = (uid_t)ntohl(packet[2]);
params->oomadj = ntohl(packet[3]);
@ -110,8 +108,7 @@ inline void lmkd_pack_get_procprio(LMKD_CTRL_PACKET packet,
* Prepare LMK_PROCPRIO packet and return packet size in bytes.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline size_t lmkd_pack_set_procprio(LMKD_CTRL_PACKET packet,
struct lmk_procprio *params) {
static inline size_t lmkd_pack_set_procprio(LMKD_CTRL_PACKET packet, struct lmk_procprio* params) {
packet[0] = htonl(LMK_PROCPRIO);
packet[1] = htonl(params->pid);
packet[2] = htonl(params->uid);
@ -128,8 +125,8 @@ struct lmk_procremove {
* For LMK_PROCREMOVE packet get its payload.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline void lmkd_pack_get_procremove(LMKD_CTRL_PACKET packet,
struct lmk_procremove *params) {
static inline void lmkd_pack_get_procremove(LMKD_CTRL_PACKET packet,
struct lmk_procremove* params) {
params->pid = (pid_t)ntohl(packet[1]);
}
@ -137,8 +134,8 @@ inline void lmkd_pack_get_procremove(LMKD_CTRL_PACKET packet,
* Prepare LMK_PROCREMOVE packet and return packet size in bytes.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline size_t lmkd_pack_set_procremove(LMKD_CTRL_PACKET packet,
struct lmk_procprio *params) {
static inline size_t lmkd_pack_set_procremove(LMKD_CTRL_PACKET packet,
struct lmk_procprio* params) {
packet[0] = htonl(LMK_PROCREMOVE);
packet[1] = htonl(params->pid);
return 2 * sizeof(int);
@ -148,7 +145,7 @@ inline size_t lmkd_pack_set_procremove(LMKD_CTRL_PACKET packet,
* Prepare LMK_PROCPURGE packet and return packet size in bytes.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline size_t lmkd_pack_set_procpurge(LMKD_CTRL_PACKET packet) {
static inline size_t lmkd_pack_set_procpurge(LMKD_CTRL_PACKET packet) {
packet[0] = htonl(LMK_PROCPURGE);
return sizeof(int);
}
@ -163,8 +160,8 @@ struct lmk_getkillcnt {
* For LMK_GETKILLCNT packet get its payload.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline void lmkd_pack_get_getkillcnt(LMKD_CTRL_PACKET packet,
struct lmk_getkillcnt *params) {
static inline void lmkd_pack_get_getkillcnt(LMKD_CTRL_PACKET packet,
struct lmk_getkillcnt* params) {
params->min_oomadj = ntohl(packet[1]);
params->max_oomadj = ntohl(packet[2]);
}
@ -173,8 +170,8 @@ inline void lmkd_pack_get_getkillcnt(LMKD_CTRL_PACKET packet,
* Prepare LMK_GETKILLCNT packet and return packet size in bytes.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline size_t lmkd_pack_set_getkillcnt(LMKD_CTRL_PACKET packet,
struct lmk_getkillcnt *params) {
static inline size_t lmkd_pack_set_getkillcnt(LMKD_CTRL_PACKET packet,
struct lmk_getkillcnt* params) {
packet[0] = htonl(LMK_GETKILLCNT);
packet[1] = htonl(params->min_oomadj);
packet[2] = htonl(params->max_oomadj);
@ -185,7 +182,7 @@ inline size_t lmkd_pack_set_getkillcnt(LMKD_CTRL_PACKET packet,
* Prepare LMK_GETKILLCNT reply packet and return packet size in bytes.
* Warning: no checks performed, caller should ensure valid parameters.
*/
inline size_t lmkd_pack_set_getkillcnt_repl(LMKD_CTRL_PACKET packet, int kill_cnt) {
static inline size_t lmkd_pack_set_getkillcnt_repl(LMKD_CTRL_PACKET packet, int kill_cnt) {
packet[0] = htonl(LMK_GETKILLCNT);
packet[1] = htonl(kill_cnt);
return 2 * sizeof(int);