All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com,
	acme@ghostprotocols.net
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] kernel/events: using uninitialized variable: slots.flexible for arm cross-compiling
Date: Wed, 06 Feb 2013 15:53:39 +0800	[thread overview]
Message-ID: <51120C03.20308@asianux.com> (raw)


for arm cross-compiling, in function __reserve_bp_slot:

  slots.flexible may be used without initializing.

    slots.flexible is not initialized when define it.
    it is as a parameter passed to fetch_bp_busy_slots.
    in function fetch_bp_busy_slots:
      if bp->cpu < 0
        slots->flexible will be used for comparing, firstly.
        that will cause issue.


building:
  make EXTRA_CFLAGS=-W ARCH=arm
  ...
  linux/kernel/events/hw_breakpoint.c:300:
    warning: missing initializer
  linux/kernel/events/hw_breakpoint.c:300:
    warning: (near initialization for 'slots.flexible')
  ...

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 kernel/events/hw_breakpoint.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index fe8a916..ef69215 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -297,7 +297,7 @@ __weak void arch_unregister_hw_breakpoint(struct perf_event *bp)
  */
 static int __reserve_bp_slot(struct perf_event *bp)
 {
-	struct bp_busy_slots slots = {0};
+	struct bp_busy_slots slots = {0, 0};
 	enum bp_type_idx type;
 	int weight;
 
-- 
1.7.7.6

             reply	other threads:[~2013-02-06  7:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06  7:53 Chen Gang [this message]
2013-02-06  8:25 ` [PATCH] kernel/events: using uninitialized variable: slots.flexible for arm cross-compiling Chen Gang

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=51120C03.20308@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.