~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/asm-generic/bug.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
        unlikely(__ret_warn_once);                              \
163
163
})
164
164
 
165
 
#define WARN_ON_RATELIMIT(condition, state)                     \
166
 
                WARN_ON((condition) && __ratelimit(state))
167
 
 
 
165
/*
 
166
 * WARN_ON_SMP() is for cases that the warning is either
 
167
 * meaningless for !SMP or may even cause failures.
 
168
 * This is usually used for cases that we have
 
169
 * WARN_ON(!spin_is_locked(&lock)) checks, as spin_is_locked()
 
170
 * returns 0 for uniprocessor settings.
 
171
 * It can also be used with values that are only defined
 
172
 * on SMP:
 
173
 *
 
174
 * struct foo {
 
175
 *  [...]
 
176
 * #ifdef CONFIG_SMP
 
177
 *      int bar;
 
178
 * #endif
 
179
 * };
 
180
 *
 
181
 * void func(struct foo *zoot)
 
182
 * {
 
183
 *      WARN_ON_SMP(!zoot->bar);
 
184
 *
 
185
 * For CONFIG_SMP, WARN_ON_SMP() should act the same as WARN_ON(),
 
186
 * and should be a nop and return false for uniprocessor.
 
187
 *
 
188
 * if (WARN_ON_SMP(x)) returns true only when CONFIG_SMP is set
 
189
 * and x is true.
 
190
 */
168
191
#ifdef CONFIG_SMP
169
192
# define WARN_ON_SMP(x)                 WARN_ON(x)
170
193
#else
171
 
# define WARN_ON_SMP(x)                 do { } while (0)
 
194
/*
 
195
 * Use of ({0;}) because WARN_ON_SMP(x) may be used either as
 
196
 * a stand alone line statement or as a condition in an if ()
 
197
 * statement.
 
198
 * A simple "0" would cause gcc to give a "statement has no effect"
 
199
 * warning.
 
200
 */
 
201
# define WARN_ON_SMP(x)                 ({0;})
172
202
#endif
173
203
 
174
204
#endif