All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] scripts: Enable error messages while hush up unnecessary warnings
@ 2010-09-11  5:10 Jean Sacren
  2010-09-11  5:13 ` [PATCH 1/1] " Jean Sacren
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Sacren @ 2010-09-11  5:10 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,

We need to know when fgets() returns with error or end of file, but the
assignment approach deprives us of such information. Also, the fix
properly handles the unnecessary warnings. What a deal!


Jean Sacren (1):
  scripts: Enable error messages while hush up unnecessary warnings

 scripts/kallsyms.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)


-- 
Jean Sacren
Bring LAMP To People

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] scripts: Enable error messages while hush up unnecessary warnings
  2010-09-11  5:10 [PATCH 0/1] scripts: Enable error messages while hush up unnecessary warnings Jean Sacren
@ 2010-09-11  5:13 ` Jean Sacren
  2010-09-29 14:19   ` Michal Marek
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Sacren @ 2010-09-11  5:13 UTC (permalink / raw)
  To: Linux Kernel Mailing List

As no error was handled, we wouldn't be able to know when an error does
occur. The fix preserves error messages while it doesn't let unnecessary
compiling warnings show up.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
 scripts/kallsyms.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index e3902fb..60dd3eb 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -107,12 +107,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 
 	rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
 	if (rc != 3) {
-		if (rc != EOF) {
-			/* skip line. sym is used as dummy to
-			 * shut of "warn_unused_result" warning.
-			 */
-			sym = fgets(str, 500, in);
-		}
+		if (rc != EOF && fgets(str, 500, in) == NULL)
+			fprintf(stderr, "Read error or end of file.\n");
 		return -1;
 	}
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] scripts: Enable error messages while hush up unnecessary warnings
  2010-09-11  5:13 ` [PATCH 1/1] " Jean Sacren
@ 2010-09-29 14:19   ` Michal Marek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Marek @ 2010-09-29 14:19 UTC (permalink / raw)
  To: Jean Sacren; +Cc: Linux Kernel Mailing List

On Fri, Sep 10, 2010 at 11:13:33PM -0600, Jean Sacren wrote:
> As no error was handled, we wouldn't be able to know when an error does
> occur. The fix preserves error messages while it doesn't let unnecessary
> compiling warnings show up.
> 
> Signed-off-by: Jean Sacren <sakiwit@gmail.com>
> ---
>  scripts/kallsyms.c |    8 ++------
>  1 files changed, 2 insertions(+), 6 deletions(-)

Thanks, applied.

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-29 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11  5:10 [PATCH 0/1] scripts: Enable error messages while hush up unnecessary warnings Jean Sacren
2010-09-11  5:13 ` [PATCH 1/1] " Jean Sacren
2010-09-29 14:19   ` Michal Marek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.