FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
linux/include/linux/average.h at master · fabgithub/linux · GitHub
fabgithub
linux
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
linux
/
include
/
linux
/
average.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (23 loc) · 653 Bytes
Breadcrumbs
linux
/
include
/
linux
/
average.h
Copy path
File metadata and controls
30 lines (23 loc) · 653 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef
_LINUX_AVERAGE_H
#define
_LINUX_AVERAGE_H
/* Exponentially weighted moving average (EWMA) */
/* For more documentation see lib/average.c */
struct
ewma
{
unsigned long
internal
;
unsigned long
factor
;
unsigned long
weight
;
};
extern
void
ewma_init
(
struct
ewma
*
avg
,
unsigned long
factor
,
unsigned long
weight
);
extern
struct
ewma
*
ewma_add
(
struct
ewma
*
avg
,
unsigned long
val
);
/**
* ewma_read() - Get average value
* @avg: Average structure
*
* Returns the average value held in @avg.
*/
static
inline
unsigned long
ewma_read
(
const
struct
ewma
*
avg
)
{
return
avg
->
internal
>>
avg
->
factor
;
}
#endif
/* _LINUX_AVERAGE_H */
Back
|
FazBrowse Home
|
New Git URL