Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable warnings as errors #182

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#CFLAGS_msr_batch.o := -DDEBUG
#CFLAGS_msr-smp.o := -DDEBUG

CFLAGS := -Wall -Wextra -Werror

obj-m += msr-safe.o
msr-safe-objs := msr_entry.o msr_allowlist.o msr-smp.o msr_batch.o msr_version.o

Expand Down
12 changes: 6 additions & 6 deletions msrsave/msrsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int msr_parse_allowlist(const char *allowlist_path, size_t *num_msr_ptr,
enum {BUFFER_SIZE = 8192};
int err = 0;
int tmp_err = 0;
int i;
size_t i;
int tmp_fd = -1;
int allowlist_fd = -1;
size_t num_scan = 0;
Expand All @@ -53,7 +53,6 @@ static int msr_parse_allowlist(const char *allowlist_path, size_t *num_msr_ptr,
uint64_t *msr_mask = NULL;
struct stat allowlist_stat;
char tmp_path[NAME_MAX] = "/tmp/msrsave_allowlist_XXXXXX";
char err_msg[NAME_MAX];
char copy_buffer[BUFFER_SIZE];

/* Copy allowlist into temporary file */
Expand Down Expand Up @@ -253,11 +252,12 @@ static int msr_parse_allowlist(const char *allowlist_path, size_t *num_msr_ptr,
return err;
}

int msr_save(const char *save_path, const char *allowlist_path, const char *msr_path_format, int num_cpu, FILE *output_log, FILE *error_log)
int msr_save(const char *save_path, const char *allowlist_path, const char *msr_path_format, int num_cpu, FILE *error_log)
{
int err = 0;
int tmp_err = 0;
int i, j;
int i;
size_t j;
int msr_fd = -1;
size_t num_msr = 0;
uint64_t *msr_offset = NULL;
Expand Down Expand Up @@ -394,7 +394,8 @@ int msr_restore(const char *restore_path, const char *allowlist_path, const char
{
int err = 0;
int tmp_err = 0;
int i, j;
int i;
size_t j;
int msr_fd = -1;
int do_print_header = 1;
size_t num_msr = 0;
Expand All @@ -407,7 +408,6 @@ int msr_restore(const char *restore_path, const char *allowlist_path, const char
FILE *restore_fid = NULL;
struct stat restore_stat;
struct stat allowlist_stat;
char err_msg[NAME_MAX];

err = msr_parse_allowlist(allowlist_path, &num_msr, &msr_offset, &msr_mask, error_log);
if (err)
Expand Down
1 change: 0 additions & 1 deletion msrsave/msrsave.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ int msr_save(const char *out_path,
const char *allowlist_path,
const char *msr_path,
int num_cpu,
FILE *output_log,
FILE *error_log);

int msr_restore(const char *in_path,
Expand Down
2 changes: 1 addition & 1 deletion msrsave/msrsave_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int main(int argc, char **argv)
}
else
{
err = msr_save(file_name, msr_allowlist_path, msr_path, num_cpu, stdout, stderr);
err = msr_save(file_name, msr_allowlist_path, msr_path, num_cpu, stderr);
}
}

Expand Down
Loading