Skip to content

Commit

Permalink
Fix for gcc7 warnings and removed unused variable.
Browse files Browse the repository at this point in the history
Change-Id: I527947873f14e109851dcb49c10c04c1a4f1952f
  • Loading branch information
ahetheri committed May 18, 2017
1 parent 433c9bd commit b13a8e5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/allocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ get_unused_cos(const unsigned id,
unsigned *class_id)
{
const int l2_req = ((technology & (1 << PQOS_CAP_TYPE_L2CA)) != 0);
unsigned used_classes[hi_class_id + 1];
unsigned used_classes[PQOS_MAX_L3CA_COS];
unsigned i, cos;
int ret;

Expand Down
8 changes: 6 additions & 2 deletions lib/os_allocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,14 @@ struct schemata {
*/
static void
schemata_fini(struct schemata *schemata) {
if (schemata->l2ca != NULL)
if (schemata->l2ca != NULL) {
free(schemata->l2ca);
if (schemata->l3ca != NULL)
schemata->l2ca = NULL;
}
if (schemata->l3ca != NULL) {
free(schemata->l3ca);
schemata->l3ca = NULL;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/os_monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ set_rdt_event_attrs(const int idx, const char *fname)
FILE *fd;
int config, ret;
double sf = 0;
char file[128], buf[32], *p = buf;
char file[512], buf[32], *p = buf;

/**
* Read event type from file system
Expand Down
20 changes: 10 additions & 10 deletions pqos/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,9 @@ print_text_row(FILE *fp,
mon_data->event & PQOS_MON_EVENT_LMEM_BW,
sel_events_max & PQOS_MON_EVENT_LMEM_BW);

offset += fillin_text_column(mbr, data + offset, sz_data - offset,
mon_data->event & PQOS_MON_EVENT_RMEM_BW,
sel_events_max & PQOS_MON_EVENT_RMEM_BW);
fillin_text_column(mbr, data + offset, sz_data - offset,
mon_data->event & PQOS_MON_EVENT_RMEM_BW,
sel_events_max & PQOS_MON_EVENT_RMEM_BW);

if (!process_mode())
fprintf(fp, "\n%8.8s %5.2f %7uk%s",
Expand Down Expand Up @@ -1046,10 +1046,10 @@ print_xml_row(FILE *fp, char *time,
sel_events_max & PQOS_MON_EVENT_LMEM_BW,
"mbm_local_MB");

offset += fillin_xml_column(mbr, data + offset, sz_data - offset,
mon_data->event & PQOS_MON_EVENT_RMEM_BW,
sel_events_max & PQOS_MON_EVENT_RMEM_BW,
"mbm_remote_MB");
fillin_xml_column(mbr, data + offset, sz_data - offset,
mon_data->event & PQOS_MON_EVENT_RMEM_BW,
sel_events_max & PQOS_MON_EVENT_RMEM_BW,
"mbm_remote_MB");

if (!process_mode())
fprintf(fp,
Expand Down Expand Up @@ -1122,9 +1122,9 @@ print_csv_row(FILE *fp, char *time,
mon_data->event & PQOS_MON_EVENT_LMEM_BW,
sel_events_max & PQOS_MON_EVENT_LMEM_BW);

offset += fillin_csv_column(mbr, data + offset, sz_data - offset,
mon_data->event & PQOS_MON_EVENT_RMEM_BW,
sel_events_max & PQOS_MON_EVENT_RMEM_BW);
fillin_csv_column(mbr, data + offset, sz_data - offset,
mon_data->event & PQOS_MON_EVENT_RMEM_BW,
sel_events_max & PQOS_MON_EVENT_RMEM_BW);

if (!process_mode())
fprintf(fp,
Expand Down

0 comments on commit b13a8e5

Please sign in to comment.