Commit 79186cee authored by Nishanth Menon's avatar Nishanth Menon

[COMMON / OMAP4/ OMAP5] cast fget result to void

Seems fgets needs to have return value checked, but our existing logic
seems to have no need for it, so cast to void to make gcc 5.1 happy.

Fixes:
arch/arm/mach-omap/omap4/uc_audit44xx.c:887:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
arch/arm/mach-omap/omap5/lib54xx.c:500:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
arch/arm/mach-omap/omap5/lib54xx.c:501:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/cpuinfo.c:1576:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/cpuinfo.c:1704:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/cpuinfo.c:1707:4: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/cpuinfo.c:303:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:1110:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:1170:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:450:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:639:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:782:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:840:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:853:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:872:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:884:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:906:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:961:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
common/trace.c:984:3: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
Reported-by: default avatarRobert C Nelson <robertcnelson@gmail.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
parent 7fb33ae8
......@@ -884,7 +884,7 @@ char *cpufreq_governor_audit44xx(char gov[16], char gov_por[16],
}
/* Parse it to find out current scaling governor */
fgets(gov, 16, fp);
(void)fgets(gov, 16, fp);
if (strlen(gov) > 0)
gov[strlen(gov) - 1] = '\0'; /* remove new line character */
fclose(fp);
......
......@@ -497,8 +497,8 @@ int lib54xx_import(char *file)
}
/* Verify it was generated from OMAPCONF */
fgets(line, sizeof(line), fp); /* Jump empty line */
fgets(line, sizeof(line), fp);
(void)fgets(line, sizeof(line), fp); /* Jump empty line */
(void)fgets(line, sizeof(line), fp);
if (sscanf(line, "<omapconf_export %s>", dummy) != 1) {
printf("Oups, OMAPCONF header not found in \"%s\" file?! "
":-(\n\n", file);
......
......@@ -300,7 +300,7 @@ unsigned int cpu_is_omap(void)
__func__);
return 1;
}
fgets(line, 256, fp);
(void)fgets(line, 256, fp);
/* Truncate line at whitespace */
machine_name = strtok(line, " \n\t\v\f\r");
......@@ -1573,7 +1573,7 @@ int cpu_proc_stats_get(unsigned int cpu,
/* Get idle, iowait & sum stats from file */
for (i = 0; i <= cpu + 1; i++) {
fgets(line, sizeof(line), fp);
(void)fgets(line, sizeof(line), fp);
if (i != cpu + 1)
continue;
......@@ -1701,10 +1701,10 @@ unsigned int cpu_cores_count_get(void)
* ...
*/
cpu_cores_count = -1;
fgets(line, sizeof(line), fp);
(void)fgets(line, sizeof(line), fp);
while ((line != NULL) && (strstr(line, "cpu") != NULL)) {
cpu_cores_count++;
fgets(line, sizeof(line), fp);
(void)fgets(line, sizeof(line), fp);
};
dprintf("%s(): cpu_cores_count=%u\n", __func__,
cpu_cores_count);
......
......@@ -447,7 +447,7 @@ int trace_geninput_config_read(const char *filename,
if (buffer == NULL)
return -2;
fgets(buffer, BUFFER_SIZE, fp);
(void)fgets(buffer, BUFFER_SIZE, fp);
if (*buffer != '*')
continue;
......@@ -636,7 +636,7 @@ int trace_config_read(const char *filename, int flags[NUM_ITEMS])
}
while (!feof(fp)) {
fgets(buffer, BUFFER_SIZE, fp);
(void)fgets(buffer, BUFFER_SIZE, fp);
if (buffer[0] == '#' || buffer[0] == '\n' || buffer[0] == '*')
continue;
......@@ -779,7 +779,7 @@ int trace_config_show(char buffer[], int buffer_size, FILE *fp, int *p_error)
row++;
while (!feof(fp)) {
fgets(buffer, buffer_size, fp);
(void)fgets(buffer, buffer_size, fp);
if ((buffer[0] == '#') || (buffer[0] == '\n'))
continue;
......@@ -837,7 +837,7 @@ int trace_geninput_file_add(const char *filename)
/* Get name */
printf("\nEnter the name of the generic input file: ");
fgets(input, BUFFER_SIZE, stdin);
(void)fgets(input, BUFFER_SIZE, stdin);
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
printf("\nNo Generic Input File Added\n\n");
......@@ -850,7 +850,7 @@ int trace_geninput_file_add(const char *filename)
/* Get path */
while (1) {
printf("\nEnter the path of the generic input file: ");
fgets(input, BUFFER_SIZE, stdin);
(void)fgets(input, BUFFER_SIZE, stdin);
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
printf("\nNo Generic Input File Added\n\n");
......@@ -869,7 +869,7 @@ int trace_geninput_file_add(const char *filename)
/* Get Units */
printf("\nEnter the units of the generic input file: ");
fgets(input, BUFFER_SIZE, stdin);
(void)fgets(input, BUFFER_SIZE, stdin);
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
printf("\nNo Generic Input File Added\n\n");
......@@ -881,7 +881,7 @@ int trace_geninput_file_add(const char *filename)
/* Get accumulating */
while (1) {
printf("\nIs the counter accumulating (y/n)? ");
fgets(input, BUFFER_SIZE, stdin);
(void)fgets(input, BUFFER_SIZE, stdin);
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
......@@ -903,7 +903,7 @@ int trace_geninput_file_add(const char *filename)
/* Get flag */
while (1) {
printf("\nDo you want to trace this item now (y/n)? ");
fgets(input, BUFFER_SIZE, stdin);
(void)fgets(input, BUFFER_SIZE, stdin);
if (tolower(input[0]) == 'x' &&
(input[1] == '\n' || input[1] == '\0')) {
......@@ -958,7 +958,7 @@ int trace_geninput_file_remove(const char *filename,
while (1) {
printf("\nEnter the number of the file to be removed: ");
fgets(input_buffer, INPUT_SIZE, stdin);
(void)fgets(input_buffer, INPUT_SIZE, stdin);
if (tolower(input_buffer[0]) == 'x') {
printf("\nNo Generic Input File Removed\n\n");
......@@ -981,7 +981,7 @@ int trace_geninput_file_remove(const char *filename,
new_file = fopen(temp_filename, "w");
while (!feof(old_file)) {
fgets(buffer, BUFFER_SIZE, old_file);
(void)fgets(buffer, BUFFER_SIZE, old_file);
if (buffer[0] == '#' || buffer[0] == '\n') {
fputs(buffer, new_file);
......@@ -1107,7 +1107,7 @@ 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: ");
fgets(input_buffer, INPUT_SIZE, stdin);
(void)fgets(input_buffer, INPUT_SIZE, stdin);
if (tolower(input_buffer[0]) == 'q' &&
(input_buffer[1] == '\0' || input_buffer[1] == ' ' ||
input_buffer[1] == '\n')) {
......@@ -1167,7 +1167,7 @@ int trace_perf_setup(const char *filename)
new_file = fopen(TEMP_FILENAME, "w");
while (!feof(old_file)) {
fgets(line, BUFFER_SIZE, old_file);
(void)fgets(line, BUFFER_SIZE, old_file);
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