Re: [PATCH] scripts/kallsyms build warning fix

From: AmÃrico Wang
Date: Mon Jan 25 2010 - 22:02:42 EST


On Tue, Jan 26, 2010 at 5:41 AM, Himanshu Chauhan
<hschauhan@xxxxxxxxxxxxx> wrote:
> Hi all,
>
> This is a small patch that fixes the build warning
> of scripts/kallsyms.c
>
> Regards
> Himanshu
>
> Signed-off-by: Himanshu Chauhan <hschauhan@xxxxxxxxxxxxx>
> ---
> Âscripts/kallsyms.c | Â Â6 ++++--
> Â1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
> index 86c3896..e3902fb 100644
> --- a/scripts/kallsyms.c
> +++ b/scripts/kallsyms.c
> @@ -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;
> Â Â Â Â}

Why not use the return value to do some useful checking?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/