basic: delete loadavg.h copy

loadavg.h is an internal header of the Linux source repository, and as
such it is licensed as GPLv2-only, without syscall exception.

We use it only for 4 macros, which are simply doing some math calculations
that cannot thus be subject to copyright.
Reimplement the same calculations in another internal header and delete
loadavg.h from our tree.
This commit is contained in:
Luca Boccassi
2021-09-25 07:10:44 +09:00
committed by Yu Watanabe
parent 3f67dccca0
commit f0e2cfc6dc
9 changed files with 57 additions and 105 deletions
+4 -4
View File
@@ -740,13 +740,13 @@ int parse_oom_score_adjust(const char *s, int *ret) {
int store_loadavg_fixed_point(unsigned long i, unsigned long f, loadavg_t *ret) {
assert(ret);
if (i >= (~0UL << FSHIFT))
if (i >= (~0UL << PRECISION_BITS))
return -ERANGE;
i = i << FSHIFT;
f = DIV_ROUND_UP((f << FSHIFT), 100);
i = i << PRECISION_BITS;
f = DIV_ROUND_UP((f << PRECISION_BITS), 100);
if (f >= FIXED_1)
if (f >= FIXED_POINT_1_0)
return -ERANGE;
*ret = i | f;