public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] This patch to profile.c fixes a few errors reported by checkpatch.pl
Date: Fri, 4 Jan 2008 14:07:02 +0100	[thread overview]
Message-ID: <20080104130702.GC20981@elte.hu> (raw)
In-Reply-To: <4d8e3fd30801040318q2e3be951rbf517f7d6022ae04@mail.gmail.com>


* Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:

> paolo@paolo-desktop:~/linux-2.6/kernel$ ../scripts/checkpatch.pl
> --file profile.c

that's OK.

> What I still don't understand are the following options:
>  --no-tree    => run without a kernel tree
>  --root       => path to the kernel tree root
> 
> Should I specify the path to the kernel tree root? If so, why?

it figures it out itself - if it cannot it will tell you.

> That said, the errors reported by checkpatch.pl are now:
> paolo@paolo-desktop:~/linux-2.6/kernel$ ../scripts/checkpatch.pl
> --terse --file profile.c |grep ERROR
> profile.c:128: ERROR: "foo * bar" should be "foo *bar"
> I just forgot to fix it, very trivial. Will do in a minute.
> 
> profile.c:460: ERROR: do not use assignment in if condition (+  if
> (!(entry = create_proc_entry("XXXXXXXXXXXXX", 0600, root_irq_dir))))
> profile.c:594: ERROR: do not use assignment in if condition (+  if
> (!(entry = create_proc_entry("XXXXXXX", S_IWUSR | S_IRUGO, NULL))))
> Here I need an hint ( or an example) about how to fix these two errors :-)

transform:

  if (!(x = y))

to:

  x = y
  if (!x)

i.e. take the implicit assignment out of the condition. (it's easy to 
mistake it for '==' while reviewing the code and forgetting about the 
assignment's side-effect)

	Ingo

  reply	other threads:[~2008-01-04 13:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03 23:32 [PATCH] This patch to profile.c fixes a few errors reported by checkpatch.pl Paolo Ciarrocchi
2008-01-03 23:37 ` Jesper Juhl
2008-01-04  8:34 ` Ingo Molnar
2008-01-04 11:18   ` Paolo Ciarrocchi
2008-01-04 13:07     ` Ingo Molnar [this message]
2008-01-04 13:18       ` Paolo Ciarrocchi
2008-01-04 13:23         ` Ingo Molnar
2008-01-04 13:43           ` Paolo Ciarrocchi

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=20080104130702.GC20981@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.ciarrocchi@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