Commit 50631878 authored by Nishanth Menon's avatar Nishanth Menon

[COMMON / OMAP4/ OMAP5] dummy check fget to make gcc 5.2 happy

gcc 5.2 is finicky. Looks like it does not get the idea of casting
to ignore results ;)...

Fixes: 79186cee ("[COMMON / OMAP4/ OMAP5] cast fget result to void")
Reported-by: default avatarRobert C Nelson <robertcnelson@gmail.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
parent 3760d585
......@@ -884,7 +884,9 @@ char *cpufreq_governor_audit44xx(char gov[16], char gov_por[16],
}
/* Parse it to find out current scaling governor */
(void)fgets(gov, 16, fp);
if (fgets(gov, 16, fp)) {
dprintf("unexpected read\n");
}
if (strlen(gov) > 0)
gov[strlen(gov) - 1] = '\0'; /* remove new line character */
fclose(fp);
......
......@@ -497,8 +497,12 @@ int lib54xx_import(char *file)
}
/* Verify it was generated from OMAPCONF */
(void)fgets(line, sizeof(line), fp); /* Jump empty line */
(void)fgets(line, sizeof(line), fp);
if (fgets(line, sizeof(line), fp)) { /* Jump empty line */
dprintf("unexpected read\n");
}
if (fgets(line, sizeof(line), fp)) {
dprintf("unexpected read\n");
}
if (sscanf(line, "<omapconf_export %s>", dummy) != 1) {
printf("Oups, OMAPCONF header not found in \"%s\" file?! "
":-(\n\n", file);
......
......@@ -301,7 +301,9 @@ unsigned int cpu_is_omap(void)
__func__);
return 1;
}
(void)fgets(line, 256, fp);
if (fgets(line, 256, fp)) {
dprintf("unexpected read\n");
}
/* Truncate line at whitespace */
machine_name = strtok(line, " \n\t\v\f\r");
......@@ -1578,7 +1580,9 @@ int cpu_proc_stats_get(unsigned int cpu,
/* Get idle, iowait & sum stats from file */
for (i = 0; i <= cpu + 1; i++) {
(void)fgets(line, sizeof(line), fp);
if (fgets(line, sizeof(line), fp)) {
dprintf("unexpected read\n");
}
if (i != cpu + 1)
continue;
......@@ -1706,10 +1710,14 @@ unsigned int cpu_cores_count_get(void)
* ...
*/
cpu_cores_count = -1;
(void)fgets(line, sizeof(line), fp);
if (fgets(line, sizeof(line), fp)) {
dprintf("unexpected read\n");
}
while ((line != NULL) && (strstr(line, "cpu") != NULL)) {
cpu_cores_count++;
(void)fgets(line, sizeof(line), fp);
if (fgets(line, sizeof(line), fp)) {
dprintf("unexpected read\n");
}
};
dprintf("%s(): cpu_cores_count=%u\n", __func__,
cpu_cores_count);
......
......@@ -447,7 +447,9 @@ int trace_geninput_config_read(const char *filename,
if (buffer == NULL)
return -2;
(void)fgets(buffer, BUFFER_SIZE, fp);
if (fgets(buffer, BUFFER_SIZE, fp)) {
dprintf("unexpected read\n");
}
if (*buffer != '*')
continue;
......@@ -636,7 +638,9 @@ int trace_config_read(const char *filename, int flags[NUM_ITEMS])
}
while (!feof(fp)) {
(void)fgets(buffer, BUFFER_SIZE, fp);
if (fgets(buffer, BUFFER_SIZE, fp)) {
dprintf("unexpected read\n");
}
if (buffer[0] == '#' || buffer[0] == '\n' || buffer[0] == '*')
continue;
......@@ -779,7 +783,9 @@ int trace_config_show(char buffer[], int buffer_size, FILE *fp, int *p_error)
row++;
while (!feof(fp)) {
(void)fgets(buffer, buffer_size, fp);
if (fgets(buffer, buffer_size, fp)) {
dprintf("unexpected read\n");
}
if ((buffer[0] == '#') || (buffer[0] == '\n'))
continue;
......@@ -837,7 +843,9 @@ int trace_geninput_file_add(const char *filename)
/* Get name */
printf("\nEnter the name of the generic input file: ");
(void)fgets(input, BUFFER_SIZE, stdin);
if (fgets(input, BUFFER_SIZE, stdin)) {
dprintf("unexpected read\n");
}
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
printf("\nNo Generic Input File Added\n\n");
......@@ -850,7 +858,9 @@ int trace_geninput_file_add(const char *filename)
/* Get path */
while (1) {
printf("\nEnter the path of the generic input file: ");
(void)fgets(input, BUFFER_SIZE, stdin);
if (fgets(input, BUFFER_SIZE, stdin)) {
dprintf("unexpected read\n");
}
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
printf("\nNo Generic Input File Added\n\n");
......@@ -869,7 +879,9 @@ int trace_geninput_file_add(const char *filename)
/* Get Units */
printf("\nEnter the units of the generic input file: ");
(void)fgets(input, BUFFER_SIZE, stdin);
if (fgets(input, BUFFER_SIZE, stdin)) {
dprintf("unexpected read\n");
}
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
printf("\nNo Generic Input File Added\n\n");
......@@ -881,7 +893,9 @@ int trace_geninput_file_add(const char *filename)
/* Get accumulating */
while (1) {
printf("\nIs the counter accumulating (y/n)? ");
(void)fgets(input, BUFFER_SIZE, stdin);
if (fgets(input, BUFFER_SIZE, stdin)) {
dprintf("unexpected read\n");
}
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
......@@ -903,7 +917,9 @@ int trace_geninput_file_add(const char *filename)
/* Get flag */
while (1) {
printf("\nDo you want to trace this item now (y/n)? ");
(void)fgets(input, BUFFER_SIZE, stdin);
if (fgets(input, BUFFER_SIZE, stdin)) {
dprintf("unexpected read\n");
}
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
......@@ -958,7 +974,9 @@ int trace_geninput_file_remove(const char *filename,
while (1) {
printf("\nEnter the number of the file to be removed: ");
(void)fgets(input_buffer, INPUT_SIZE, stdin);
if (fgets(input_buffer, INPUT_SIZE, stdin)) {
dprintf("unexpected read\n");
}
if (tolower(input_buffer[0]) == 'x') {
printf("\nNo Generic Input File Removed\n\n");
......@@ -981,7 +999,9 @@ int trace_geninput_file_remove(const char *filename,
new_file = fopen(temp_filename, "w");
while (!feof(old_file)) {
(void)fgets(buffer, BUFFER_SIZE, old_file);
if (fgets(buffer, BUFFER_SIZE, old_file)) {
dprintf("unexpected read\n");
}
if (buffer[0] == '#' || buffer[0] == '\n') {
fputs(buffer, new_file);
......@@ -1107,7 +1127,9 @@ int trace_perf_setup(const char *filename)
"Enter R at any time to remove a generic input file from the config.\n\n");
printf("Command or item number: ");
(void)fgets(input_buffer, INPUT_SIZE, stdin);
if (fgets(input_buffer, INPUT_SIZE, stdin)) {
dprintf("unexpected read\n");
}
if (tolower(input_buffer[0]) == 'q' &&
(input_buffer[1] == '\0' || input_buffer[1] == ' ' ||
input_buffer[1] == '\n')) {
......@@ -1167,7 +1189,9 @@ int trace_perf_setup(const char *filename)
new_file = fopen(TEMP_FILENAME, "w");
while (!feof(old_file)) {
(void)fgets(line, BUFFER_SIZE, old_file);
if (fgets(line, BUFFER_SIZE, old_file)) {
dprintf("unexpected read\n");
}
if (line[0] == '#') {
fputs(line, new_file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment