public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Thiago Rafael Becker <trbecker@trbecker.org>
To: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Cc: Thiago Rafael Becker <trbecker@trbecker.org>,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org, a.p.zijlstra@chello.nl,
	jason.wessel@windriver.com, jan.kiszka@siemens.com,
	dhowells@redhat.com
Subject: [PATCH] kgbd: clear compilation warning
Date: Fri, 11 May 2012 04:13:40 +0000	[thread overview]
Message-ID: <1336709620-19351-1-git-send-email-trbecker@trbecker.org> (raw)

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'

Signed-off-by: Thiago Rafael Becker <trbecker@trbecker.org>
---
 arch/x86/kernel/kgdb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 8bfb614..7c54c78 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -746,7 +746,6 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
 int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
 {
 	int err;
-	char opc[BREAK_INSTR_SIZE];
 
 	bpt->type = BP_BREAKPOINT;
 	err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
@@ -756,6 +755,8 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
 	err = probe_kernel_write((char *)bpt->bpt_addr,
 				 arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
 #ifdef CONFIG_DEBUG_RODATA
+	char opc[BREAK_INSTR_SIZE];
+
 	if (!err)
 		return err;
 	/*
-- 
1.7.10.1


             reply	other threads:[~2012-05-11  4:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11  4:13 Thiago Rafael Becker [this message]
2012-05-11  6:23 ` [PATCH] kgbd: clear compilation warning Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336709620-19351-1-git-send-email-trbecker@trbecker.org \
    --to=trbecker@trbecker.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dhowells@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jason.wessel@windriver.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox