mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Anand Moon <moon.linux@yahoo.com>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix add missing include guard
Date: Mon, 8 Sep 2014 08:15:52 +0200	[thread overview]
Message-ID: <20140908061552.GQ19379@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1410106356-3543-1-git-send-email-moon.linux@yahoo.com>

On Sun, Sep 07, 2014 at 09:42:36PM +0530, Anand Moon wrote:
> If a header file happens to be included twice, the compiler will process
> its contents twice. This is very likely to cause an error, e.g. when the
> compiler sees the same structure definition twice. Even if it does not,
> it will certainly waste time.



> --- a/kernel/locking/lockdep_states.h
> +++ b/kernel/locking/lockdep_states.h
> @@ -4,6 +4,12 @@
>   * please update XXX_LOCK_USAGE_STATES in include/linux/lockdep.h whenever
>   * you add one, or come up with a nice dynamic solution.
>   */
> +
> +#ifndef __LOCKDEPSTATE_H__
> +#define __LOCKDEPSTATE_H__
> +
>  LOCKDEP_STATE(HARDIRQ)
>  LOCKDEP_STATE(SOFTIRQ)
>  LOCKDEP_STATE(RECLAIM_FS)
> +
> +#endif /* __LOCKDEPSTATE_H__ */


That file is actually designed to be included multiple times; you
clearly didn't understand what you were doing.

           reply	other threads:[~2014-09-08  6:15 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1410106356-3543-1-git-send-email-moon.linux@yahoo.com>]

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=20140908061552.GQ19379@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=moon.linux@yahoo.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

all inboxes | Powered by JetHome®