Re: [PATCH] kgbd: clear compilation warning

From: Dan Carpenter
Date: Fri May 11 2012 - 02:20:54 EST


On Fri, May 11, 2012 at 01:13:40AM -0300, Thiago Rafael Becker wrote:
> In the function kgbd_arch_set_breakpoint, the variable is only used
> if DEBUG_RODATA is configured. This clears the following compilation
> warning:
>
> arch/x86/kernel/kgdb.c:749:7: warning: unused variable 'opc'
>

This doesn't work. Now there is a "warning: mixing declarations and
code" warning message for people who have CONFIG_DEBUG_RODATA
turned on.

I sent one of these yesterday where I did:

if (!config_enabled(CONFIG_DEBUG_RODATA))
return err;

But test it both ways and do a make arch/x86/kernel/kgdb.i and
make sure the code looks ok.

regards,
dan carpenter

--
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/