scripts/kallsyms: suppress build warning
authorHimanshu Chauhan <[email protected]>
Thu, 28 Jan 2010 00:53:20 +0000 (16:53 -0800)
committerMichal Marek <[email protected]>
Tue, 2 Feb 2010 13:33:56 +0000 (14:33 +0100)
Suppress a warn_unused_result warning.

fgets is called as a part of error handling.  It is called just to drop a
line and return immediately.  read_map is reading the file in a loop and
read_symbol reads line by line.  So I think there is no point in using
return value for useful checking.  Other checks like 3 items were returned
or !EOF have already been done.

Signed-off-by: Himanshu Chauhan <[email protected]>
Cc: WANG Cong <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
scripts/kallsyms.c

index 86c3896a1e01862b222adeaac4e33bc9b8a01aad..e3902fb39afd1f2c53f63c0cfa9aaa1273956a02 100644 (file)
@@ -108,8 +108,10 @@ 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 */
-                       fgets(str, 500, in);
+                       /* skip line. sym is used as dummy to
+                        * shut of "warn_unused_result" warning.
+                        */
+                       sym = fgets(str, 500, in);
                }
                return -1;
        }