mirror of
https://github.com/AetherDroid/android_kernel_samsung_on5xelte.git
synced 2025-10-30 15:48:52 +01:00
Fixed MTP to work with TWRP
This commit is contained in:
commit
f6dfaef42e
50820 changed files with 20846062 additions and 0 deletions
38
tools/perf/ui/progress.c
Normal file
38
tools/perf/ui/progress.c
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include "../cache.h"
|
||||
#include "progress.h"
|
||||
|
||||
static void null_progress__update(struct ui_progress *p __maybe_unused)
|
||||
{
|
||||
}
|
||||
|
||||
static struct ui_progress_ops null_progress__ops =
|
||||
{
|
||||
.update = null_progress__update,
|
||||
};
|
||||
|
||||
struct ui_progress_ops *ui_progress__ops = &null_progress__ops;
|
||||
|
||||
void ui_progress__update(struct ui_progress *p, u64 adv)
|
||||
{
|
||||
p->curr += adv;
|
||||
|
||||
if (p->curr >= p->next) {
|
||||
p->next += p->step;
|
||||
ui_progress__ops->update(p);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_progress__init(struct ui_progress *p, u64 total, const char *title)
|
||||
{
|
||||
p->curr = 0;
|
||||
p->next = p->step = total / 16;
|
||||
p->total = total;
|
||||
p->title = title;
|
||||
|
||||
}
|
||||
|
||||
void ui_progress__finish(void)
|
||||
{
|
||||
if (ui_progress__ops->finish)
|
||||
ui_progress__ops->finish();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue