Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/kallsyms: suppress build warning

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 <hschauhan@nulltrace.org>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>

authored by

Himanshu Chauhan and committed by
Michal Marek
71d41aed d4987bd7

+4 -2
+4 -2
scripts/kallsyms.c
··· 108 108 rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str); 109 109 if (rc != 3) { 110 110 if (rc != EOF) { 111 - /* skip line */ 112 - fgets(str, 500, in); 111 + /* skip line. sym is used as dummy to 112 + * shut of "warn_unused_result" warning. 113 + */ 114 + sym = fgets(str, 500, in); 113 115 } 114 116 return -1; 115 117 }