All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave <kilroyd@googlemail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: David Kilroy <kilroyd@googlemail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] check spinlock_t/rwlock_t argument type on non-SMP builds
Date: Fri, 03 Jul 2009 20:02:01 +0100	[thread overview]
Message-ID: <4A4E55A9.7090001@gmail.com> (raw)
In-Reply-To: <20090703073801.GA10191@elte.hu>

Ingo Molnar wrote:
> * David Kilroy <kilroyd@googlemail.com> wrote:
> 
>> When writing code for UP without CONFIG_DEBUG_SPINLOCK it's easy 
>> to get the first argument to the spinlock/rwlock functions wrong. 
>> This is because the parameter is not actually used in this 
>> configuration.
>>
>> Typically you will only find out it's wrong
>>  * by rebuilding with CONFIG_SMP or CONFIG_DEBUG_SPINLOCK
>>  * after you've submitted your beautiful patch series.
>>
>> The first means a long wait, and the latter is a bit late.
>>
>> Add typechecking on the first argument of these macro functions. 
>> Note that since the typecheck now references the variable, the 
>> explicit read is redundant and can be removed.
>>
>> This change causes compiler warnings in net/ipv4/route.c, as this 
>> passes NULL as the first argument in the UP configuration. Simply 
>> cast this.
> 
> Wondering - can the wrappers be moved from CPP land to C land by 
> turning them into inlines? (i havent checked all usages so there 
> might be some surprises, but by and large it ought to be possible.)

I thought about doing it that way. I decided not to because I suspected
it would be harder to verify that the behaviour is unchanged.

Also the _lock_irqsave functions output to the flags parameter (which
isn't a pointer) so that has to remain a macro.

If you'd really rather an inline version, I can spend some time looking
into it.


Dave.

  reply	other threads:[~2009-07-03 19:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-02 18:44 [PATCH] check spinlock_t/rwlock_t argument type on non-SMP builds David Kilroy
2009-07-03  7:38 ` Ingo Molnar
2009-07-03 19:02   ` Dave [this message]
2009-07-18 12:14     ` Ingo Molnar
2009-07-22 18:11       ` [PATCH v2] " David Kilroy
2009-08-02 13:14         ` [tip:core/locking] locking: Check spinlock_t/rwlock_t argument type on non-SMP builds too tip-bot for David Kilroy
2009-08-02 13:40           ` Ingo Molnar
2009-08-02 16:45             ` Dave
2009-08-02 18:05               ` Ingo Molnar
2009-08-02 18:41         ` [PATCH v3] locking: check " David Kilroy
2009-08-02 19:30           ` [tip:core/locking] locking: Check " tip-bot for David Kilroy
2009-08-03 11:39             ` Ingo Molnar
2009-08-03 19:52               ` Dave
2009-08-04  3:05                 ` Mike Frysinger

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=4A4E55A9.7090001@gmail.com \
    --to=kilroyd@googlemail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.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 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.