[LTP] [PATCH 2/3] syscalls: sysinfo01: Rewrite

Cyril Hrubis chrubis@suse.cz
Tue Apr 7 14:16:55 CEST 2026


Hi!
> > +	sys_load1 = sys_buf->loads[0] / 65536.0;
> > +	sys_load5 = sys_buf->loads[1] / 65536.0;
> > +	sys_load15 = sys_buf->loads[2] / 65536.0;
> 
> I would go for:
> 
> 	sys_load1 = sys_buf->loads[0] / (float)(1 << SI_LOAD_SHIFT);
> 
> That "magic value" needs at least to be explained on a comment
> otherwise. With this fixed:

I've fixed the test to use SI_LOAD_SHIFT and TST_KB and also to use
:manpage:`sysinfo(2)` in the doc comment and pushed, thanks for the
reviews.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list