Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: naresh.kernel@gmail.com (naresh kamboju)
Subject: [ltt-dev] Warning fix: __raw_spin_lock incompatible pointer type
Date: Mon, 22 Feb 2010 20:49:59 +0530	[thread overview]
Message-ID: <f5a7b3811002220719i52750eddm16508f3d2f9b56f9@mail.gmail.com> (raw)

Hi,

I have noticed below warning after enabling CONFIG_LTT_RELAY_LOCKED=y

And after the changes w.r.t http://lkml.org/lkml/2010/2/22/100


 CC      ltt/ltt-relay-locked.o
In file included from ltt/ltt-relay-locked.c:56:
ltt/ltt-relay-locked.h: In function 'ltt_reserve_slot':
ltt/ltt-relay-locked.h:249: warning: passing argument 1 of
'__raw_spin_lock' from incompatible pointer type
ltt/ltt-relay-locked.h:257: warning: passing argument 1 of
'__raw_spin_unlock' from incompatible pointer type
ltt/ltt-relay-locked.h: In function 'ltt_commit_slot':
ltt/ltt-relay-locked.h:364: warning: passing argument 1 of
'__raw_spin_unlock' from incompatible pointer type
ltt/ltt-relay-locked.c: In function 'get_subbuf':
ltt/ltt-relay-locked.c:238: warning: passing argument 1 of
'__raw_spin_lock' from incompatible pointer type
ltt/ltt-relay-locked.c:252: warning: passing argument 1 of
'__raw_spin_unlock' from incompatible pointer type
ltt/ltt-relay-locked.c:263: warning: passing argument 1 of
'__raw_spin_unlock' from incompatible pointer type
ltt/ltt-relay-locked.c:272: warning: passing argument 1 of
'__raw_spin_unlock' from incompatible pointer type
:
:
ltt/ltt-relay-locked.c: In function 'ltt_relay_create_buffer':
ltt/ltt-relay-locked.c:846: warning: missing braces around initializer
ltt/ltt-relay-locked.c:846: warning: (near initialization for
'(anonymous).raw_lock')
:
:


After my work around I have found warning cause and fixed.

---
 ltt/ltt-relay-locked.c |    2  1 +     1 -     0 !
 ltt/ltt-relay-locked.h |    2  1 +     1 -     0 !
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: b/ltt/ltt-relay-locked.h
===================================================================
--- a/ltt/ltt-relay-locked.h
+++ b/ltt/ltt-relay-locked.h
@@ -69,7 +69,7 @@ struct ltt_channel_buf_struct {
        long offset;                    /* Current offset in the buffer */
        long *commit_count;             /* Commit count per sub-buffer */
        unsigned long irqflags;         /* IRQ flags saved by reserve */
-       raw_spinlock_t lock;            /* Spinlock protecting buffer */
+       __raw_spinlock_t lock;          /* Spinlock protecting buffer */
        /* End of first 32 bytes cacheline */
 #ifdef CONFIG_LTT_VMCORE
        long *commit_seq;               /* Consecutive commits */
Index: b/ltt/ltt-relay-locked.c
===================================================================
--- a/ltt/ltt-relay-locked.c
+++ b/ltt/ltt-relay-locked.c
@@ -843,7 +843,7 @@ static int ltt_relay_create_buffer(struc
        RCHAN_SB_CLEAR_NOREF(buf->rchan_wsb[0].pages);
        ltt_buffer_begin(buf, trace->start_tsc, 0);
        ltt_buf->commit_count[0] += ltt_subbuffer_header_size();
-       ltt_buf->lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
+       ltt_buf->lock = (__raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
        ltt_buf->rbuf = buf;

        return 0;


Kernel: 2.6.29-RT
LTTng: 0.158
ARCH: ARM (SMP)

Please review the patch and provide your comments.

Best regards
Naresh Kamboju




                 reply	other threads:[~2010-02-22 15:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=f5a7b3811002220719i52750eddm16508f3d2f9b56f9@mail.gmail.com \
    --to=naresh.kernel@gmail.com \
    /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