[ltt-dev] Warning fix: __raw_spin_lock incompatible pointer type

naresh kamboju naresh.kernel at gmail.com
Mon Feb 22 10:19:59 EST 2010


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




More information about the lttng-dev mailing list